<div dir="ltr"><div>Here are some more resources regarding PBR in glTF and potentially X3D.<br><br>Sturm et al. proposal which was adopted by glTF:<br><br><a href="https://dl.acm.org/citation.cfm?id=2945293">https://dl.acm.org/citation.cfm?id=2945293</a><br><a href="https://instantuv.org/wp-content/uploads/2017/03/pbr2016.pdf">https://instantuv.org/wp-content/uploads/2017/03/pbr2016.pdf</a><br><br>The metallic-roughness flavor is the glTF core material.<br><br>Here is a relevant excerpt:<br><br><font size="1">The first node is the PhysicalMaterial node that is used to specify<br>the parameters for a surface. It is used as alternative to the Material<br>node. The attributes are albedoFactor, roughnessFactor and metal-<br>licFactor that represent the albedo, roughness and metallic values<br>as desribed in Section 5. All three parameters can optionally be<br>replaced by a texture representation with the corresponding names<br>albedoMap, roughnessMap and metallicMap. The textures are pro-<br>vided by the ImageTexture node. If any parameter is specified with<br>a texture, texture coordindates for the vertices are required.<br>The second node we propose is the PhysicalEnvironmentLight<br>node. The PhysicalEnvironmentLight node is used to specify the<br>environmental textures for the shading and is placed inside a scene<br>node. The attributes are diffuse, specular and brdf LUT. The diffuse<br>and specular fields contain the baked lighting information in form<br>of a ImageCubeMapTexture and the brdf slot the lookup table for<br>the brdf function as described in Section 4.<br><span style="font-family:monospace,monospace">X3D-based PhysicalMaterial with only factors<br><PhysicalMaterial albedoFactor="0.22 0.3 0.5" roughnessFactor="0.5" metallicFactor="1.0" /><br>X3D-based PBRMaterial with textures<br><PhysicalMaterial><br>  <ImageTexture url="albedo.png" containerField="albedoMap" /><br>  <ImageTexture url="roughness.png" containerField="roughnessMap" /><br>  <ImageTexture url="metallic.png" containerField="metallicMap" /><br></PhysicalMaterial><br>X3D-based PhysicalEnvironmentLight for IBL<br><PhysicalEnvironmentLight><br>  <ImageCubeMapTexture url="diffuse_env.dds" containerField="diffuse" /><br>  <ImageCubeMapTexture url="specular_env.dds" containerField="specular" /><br>  <ImageTexture url="brdf.png" containerField="brdf" /><br></PhysicalEnvironmentLight></span><br><br></font></div><div><br></div><div>Transparency seems to be missing but presumably could be just added.</div><div> <br></div><div>Appendix B in the glTF 2.0 spec. is now available and outlines the implementation:<br><br><a href="https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#appendix-b-brdf-implementation">https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#appendix-b-brdf-implementation</a><br><br></div>I believe the math follows the proposal above. baseColor and albedo should be the same, more or less.<br><div><br></div><div><br></div><div><a href="https://github.com/KhronosGroup/glTF-WebGL-PBR/tree/master/shaders">https://github.com/KhronosGroup/glTF-WebGL-PBR/tree/master/shaders</a><br></div><div><br></div><div>has an actual implementation as webgl shaders which should be useful also as basis for an opengl implementation. This includes texture maps ala common surface shader.<br></div><div><br></div><div>There are also other open implementations in the various glTF capable engines (three, babylon ...) but not as accessible. <br></div><div><br></div><div>To me, it looks like PBR at least as understood for glTF is now standardized sufficiently that it becomes a candidate for adoption for X3D as well.<br></div><div><br></div><div>-Andreas<br></div><div><br>On Wed, Sep 6, 2017 at 3:00 PM,  <<a href="mailto:x3d-public-request@web3d.org">x3d-public-request@web3d.org</a>> wrote:<br>><br>> Message: 1<br>> Date: Wed, 6 Sep 2017 11:20:30 -0700<br>> From: Leonard Daly <<a href="mailto:Leonard.Daly@realism.com">Leonard.Daly@realism.com</a>><br>> To: X3D WG <<a href="mailto:x3d@web3d.org">x3d@web3d.org</a>>, X3D Public <<a href="mailto:x3d-public@web3d.org">x3d-public@web3d.org</a>><br>> Subject: [x3d-public] glTF Materials<br>> Message-ID: <<a href="mailto:a5bab52e-2e31-a116-09f9-f41ed5524840@realism.com">a5bab52e-2e31-a116-09f9-f41ed5524840@realism.com</a>><br>> Content-Type: text/plain; charset="utf-8"; Format="flowed"<br>><br>> The topic of glTF material libraries came up during the X3D WG meeting.<br>> I volunteered to report back on what is available. This is the report.<br>> Because all of this is publicly available and generally useful, I am<br>> also posting it to 'x3d-public'<br>><br>> The glTF V2 specification<br>> (<a href="https://github.com/KhronosGroup/glTF/tree/master/specification/2.0">https://github.com/KhronosGroup/glTF/tree/master/specification/2.0</a>)<br>> uses Physically Based Rendering (PBR).<br>><br>> Note: PBR Articles are plentiful. Listed here are a couple I used when<br>> writing this up. These are useful to help in term definition and<br>> understanding<br>>  ?*<br>> <a href="https://www.marmoset.co/posts/basic-theory-of-physically-based-rendering/">https://www.marmoset.co/posts/basic-theory-of-physically-based-rendering/</a><br>>  ?*<br>> <a href="https://www.marmoset.co/posts/physically-based-rendering-and-you-can-too/">https://www.marmoset.co/posts/physically-based-rendering-and-you-can-too/</a><br>><br>> Khronos works by defining a specification and allowing extensions -<br>> either Khronos or vendor developed. This discussion is just about the<br>> approved spec and does not include draft or extension documents. At this<br>> time there is no? common material library; however, there is a draft<br>> document for glTF V1 that is posted.<br>><br>><br>> The glTF V2 specification that discusses materials is at<br>> <a href="https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#materials">https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#materials</a>.<br>> It includes an illustrative (image) example plus example (JSON) code.<br>> Appendix B is currently unwritten.<br>><br>> PBR is mostly used to handle metals. Most non-metallic surfaces are<br>> special cases or otherwise covered in the metallic-roughness model. This<br>> model specifies what happens to light when it strikes the surface of the<br>> object - it is the bidirectional reflectance distribution function<br>> (BRDF). It is the responsibility of the lighting system to use these<br>> values with the various light sources (including reflection from other<br>> objects) to determine an objects perceived appearance.<br>><br>> For each supplied pixel, the objects BRDF is calculated from six number,<br>> (RGBA, metallic-factor, roughness-factor; described in Appendix B -<br>> currently unwritten). Each value comes from a texmap (image; 2 total -<br>> metallic and roughness are combined) so the BRDF is a function of<br>> surface coordinates. If the inputs for the six numbers are constant over<br>> the object (i.e., the texmaps are a single color), then the object's<br>> BRDF will produce the same value for each point on the object's surface.<br>><br>> The glTF system does not specify a "rust" texture (as in variation over<br>> the surface). That is content.<br>><br>> As far as I can tell, there is no effort at any organization affiliated<br>> with glTF to provide a library of various textures (e.g., dirt, brick,<br>> stone, rust, wood, leaf-litter, etc.). This is content and out-of-scope<br>> of the glTF work. It is more along the lines of A-Frame asset or Unity<br>> libraries -- somewhat akin to the Universal Media library for X3D content.<br>><br>> --<br>> *Leonard Daly*<br>> 3D Systems & Cloud Consultant<br>> LA ACM SIGGRAPH Chair<br>> President, Daly Realism - /Creating the Future/<br><br>-- <br>Andreas Plesch<br>Waltham, MA 02453</div></div>