[x3d-public] glTF Materials (Leonard Daly)

Andreas Plesch andreasplesch at gmail.com
Fri Dec 1 15:13:43 PST 2017


Here are some more resources regarding PBR in glTF and potentially X3D.

Sturm et al. proposal which was adopted by glTF:

https://dl.acm.org/citation.cfm?id=2945293
https://instantuv.org/wp-content/uploads/2017/03/pbr2016.pdf

The metallic-roughness flavor is the glTF core material.

Here is a relevant excerpt:

The first node is the PhysicalMaterial node that is used to specify
the parameters for a surface. It is used as alternative to the Material
node. The attributes are albedoFactor, roughnessFactor and metal-
licFactor that represent the albedo, roughness and metallic values
as desribed in Section 5. All three parameters can optionally be
replaced by a texture representation with the corresponding names
albedoMap, roughnessMap and metallicMap. The textures are pro-
vided by the ImageTexture node. If any parameter is specified with
a texture, texture coordindates for the vertices are required.
The second node we propose is the PhysicalEnvironmentLight
node. The PhysicalEnvironmentLight node is used to specify the
environmental textures for the shading and is placed inside a scene
node. The attributes are diffuse, specular and brdf LUT. The diffuse
and specular fields contain the baked lighting information in form
of a ImageCubeMapTexture and the brdf slot the lookup table for
the brdf function as described in Section 4.
X3D-based PhysicalMaterial with only factors
<PhysicalMaterial albedoFactor="0.22 0.3 0.5" roughnessFactor="0.5"
metallicFactor="1.0" />
X3D-based PBRMaterial with textures
<PhysicalMaterial>
  <ImageTexture url="albedo.png" containerField="albedoMap" />
  <ImageTexture url="roughness.png" containerField="roughnessMap" />
  <ImageTexture url="metallic.png" containerField="metallicMap" />
</PhysicalMaterial>
X3D-based PhysicalEnvironmentLight for IBL
<PhysicalEnvironmentLight>
  <ImageCubeMapTexture url="diffuse_env.dds" containerField="diffuse" />
  <ImageCubeMapTexture url="specular_env.dds" containerField="specular" />
  <ImageTexture url="brdf.png" containerField="brdf" />
</PhysicalEnvironmentLight>


Transparency seems to be missing but presumably could be just added.

Appendix B in the glTF 2.0 spec. is now available and outlines the
implementation:

https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#appendix-b-brdf-implementation

I believe the math follows the proposal above. baseColor and albedo should
be the same, more or less.


https://github.com/KhronosGroup/glTF-WebGL-PBR/tree/master/shaders

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.

There are also other open implementations in the various glTF capable
engines (three, babylon ...) but not as accessible.

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.

-Andreas

On Wed, Sep 6, 2017 at 3:00 PM,  <x3d-public-request at web3d.org> wrote:
>
> Message: 1
> Date: Wed, 6 Sep 2017 11:20:30 -0700
> From: Leonard Daly <Leonard.Daly at realism.com>
> To: X3D WG <x3d at web3d.org>, X3D Public <x3d-public at web3d.org>
> Subject: [x3d-public] glTF Materials
> Message-ID: <a5bab52e-2e31-a116-09f9-f41ed5524840 at realism.com>
> Content-Type: text/plain; charset="utf-8"; Format="flowed"
>
> The topic of glTF material libraries came up during the X3D WG meeting.
> I volunteered to report back on what is available. This is the report.
> Because all of this is publicly available and generally useful, I am
> also posting it to 'x3d-public'
>
> The glTF V2 specification
> (https://github.com/KhronosGroup/glTF/tree/master/specification/2.0)
> uses Physically Based Rendering (PBR).
>
> Note: PBR Articles are plentiful. Listed here are a couple I used when
> writing this up. These are useful to help in term definition and
> understanding
>  ?*
> https://www.marmoset.co/posts/basic-theory-of-physically-based-rendering/
>  ?*
> https://www.marmoset.co/posts/physically-based-rendering-and-you-can-too/
>
> Khronos works by defining a specification and allowing extensions -
> either Khronos or vendor developed. This discussion is just about the
> approved spec and does not include draft or extension documents. At this
> time there is no? common material library; however, there is a draft
> document for glTF V1 that is posted.
>
>
> The glTF V2 specification that discusses materials is at
>
https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#materials
.
> It includes an illustrative (image) example plus example (JSON) code.
> Appendix B is currently unwritten.
>
> PBR is mostly used to handle metals. Most non-metallic surfaces are
> special cases or otherwise covered in the metallic-roughness model. This
> model specifies what happens to light when it strikes the surface of the
> object - it is the bidirectional reflectance distribution function
> (BRDF). It is the responsibility of the lighting system to use these
> values with the various light sources (including reflection from other
> objects) to determine an objects perceived appearance.
>
> For each supplied pixel, the objects BRDF is calculated from six number,
> (RGBA, metallic-factor, roughness-factor; described in Appendix B -
> currently unwritten). Each value comes from a texmap (image; 2 total -
> metallic and roughness are combined) so the BRDF is a function of
> surface coordinates. If the inputs for the six numbers are constant over
> the object (i.e., the texmaps are a single color), then the object's
> BRDF will produce the same value for each point on the object's surface.
>
> The glTF system does not specify a "rust" texture (as in variation over
> the surface). That is content.
>
> As far as I can tell, there is no effort at any organization affiliated
> with glTF to provide a library of various textures (e.g., dirt, brick,
> stone, rust, wood, leaf-litter, etc.). This is content and out-of-scope
> of the glTF work. It is more along the lines of A-Frame asset or Unity
> libraries -- somewhat akin to the Universal Media library for X3D content.
>
> --
> *Leonard Daly*
> 3D Systems & Cloud Consultant
> LA ACM SIGGRAPH Chair
> President, Daly Realism - /Creating the Future/

-- 
Andreas Plesch
Waltham, MA 02453
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20171201/f3a1ffe6/attachment.html>


More information about the x3d-public mailing list