[x3d-public] Spec 9.2.4 Browser options: add PBR shading? X3D3 Inline use cases for X3D4

Andreas Plesch andreasplesch at gmail.com
Thu Aug 13 13:10:37 PDT 2020


Let me just note that Michalis summary at

https://github.com/michaliskambi/x3d-tests/wiki/Do-not-confuse-Phong-shading-with-Phong-lighting-model

is short, to the point and worth spending a minute reading.

Also, I think the use cases Don mentioned are not necessarily
referring only to the BrowserProperties SAI object but are just
intended to list a few general scenarios.

I agree with everything Michalis explained and will add a few comments:

> > d. Use case: author wants to upgrade an X3D3 model to PBR, so he changes
> > it to X3Dv4 and perhaps updates Material nodes as well.

To be clear, upgrading to PBR will require replacing Material nodes
with PhysicalMaterial nodes, explicitly.

> > e. Use case: X3D4 model wants to load X3D3 Inline and force it to use PBR
> > rendering.  Does this make sense?  Seems like X3D3 Material nodes simply
> > default to classic rendering, and so can be "upgraded" without deliberate
> > modeling changes that make the Inline model into an X3D4 model.  So such a
> > use case might not make sense....

Instead of referring to "classic" rendering, it may be more precise to
say "Blinn-Phong" lighting.
While there are approximate conversions from Blinn-Phong materials
(diffuse, specular, emissive) to PBR materials (metallic, roughness),
they can never be lossless due to the different mathematical models
which are used to calculate the influence of a light source. But the
method of how to convert if so desired is really unrelated to how X3D
browsers render. In X3DV4, PhysicalMaterial will always render using
PBR, and Material will always render using Blinn-Phong (the lighting
equations in X3D <= v.3.3).

It is possible to mix use of both lighting models in a single scene.
For example, inlining a gltf or PhysicalMaterial shape, into a
(perhaps very old) scene with Material shapes will work. But I think
the recommendation is to avoid such mixing as much as possible, to
minimize cognitive dissonance, and breaking the 3d lighting illusion.

Ah, x3dom only offers Phong (per pixel) shading.

-Andreas

> Date: Wed, 12 Aug 2020 21:29:03 +0200
> From: Michalis Kamburelis <michalis.kambi at gmail.com>
> To: Don Brutzman <brutzman at nps.edu>
>
> Hello Don,
>
> Answers below :)
>
> A big warning for your points b,c,d,e: do not confuse "Phong shading" with
> "Phong lighting model". I predicted someone may get confused by it :), I
> even placed in X3Dv4 draft specification a warning about it:
> https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-WD2/Part01/components/lighting.html#GouraudShading
> """The lighting equations in previous sections assume that you use *Phong
> shading* (not to be confused with *Phong lighting model*).""". I have now
> created a wiki page to address this explicitly:
> https://github.com/michaliskambi/x3d-tests/wiki/Do-not-confuse-Phong-shading-with-Phong-lighting-model
> .
>
> More answers inline below.
>
> Don Brutzman <brutzman at nps.edu> wrote:
>
> > 9.2.4 Browser options
> >
> > https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-WD2/Part01/components/networking.html#BrowserProperties
> >
> > lists default and allowed values for X3D Browser options.  Notably
> > "Support for browser options is not required but is strongly recommended."
> >
> > Of interest:
> >
> > =======================================================
> > Name,   Description,    Type/valid range,       Default
> >
> > Shading;        Specify shading mode for all objects;   Wireframe, Flat,
> > Gouraud, Phong;        Gouraud
> > =======================================================
> >
> > a. Default for X3D 3.0-3.3 appears incorrect, typical is Phong vice
> > Gouraud.  Is that correct?  If so, it is an erratum.
> >
>
> I think we can change the default to "Phong" indeed. It's 2020 and we can
> recommend "Phong shading" indeed :) Perfect implementation of X3D 3
> lighting equations already required Phong shading anyway. Even though many
> browsers approximate it with Gouraud shading.
>
> Browsers are free to ignore it anyway. I don't know which browsers support
> it.
>
> ***I highly advise testing various X3D browsers, to actually estimate the
> potential impact of this change.*** Then make the specification change,
> after consulting with affected browsers.
>
> ( Castle Game Engine / view3dscene doesn't support these options, we have
> other ways (using engine Pascal API) to set default shading. So my
> implementation practically doesn't care about this change. )
>
> Although I don't think that "typical is Phong", as you write. Actually most
> X3D browsers still by default make "Gouraud shading", as far as I know
> (hypothesis; testing to confirm/reject this hypothesis is most welcome).
> But I agree that we can start recommending "Phong shading" here, in X3D v4.
>
> In the case of PBR, I don't expect X3D browsers to actually support Gouraud
> shading. Although it is theoretically possible.
>
> ( Castle Game Engine / view3dscene by default use Gouraud shading, but we
> switch to Phong shading when we see that shape uses some feature that
> requires Phong shading to be sensible -- like normal maps, shadow maps, and
> even PBR. )
>
>
> >
> > b. Should we add PBR?
> >
>
> No no no :) There is no such thing as "PBR shading".
>
> You are making a (very common) mistake here: you confuse "Phong shading"
> with "Phong lighting model". It is unfortunate that these 2 independent
> things share the same name.
>
> I wrote an explanation on
> https://github.com/michaliskambi/x3d-tests/wiki/Do-not-confuse-Phong-shading-with-Phong-lighting-model
> -- please read that page now, before reading this mail further :)
>
> There is no such thing "PBR shading". You use "Phong shading" with
> "Physical lighting model (PBR)" when implementing PBR in normal cases. (I
> fully expect X3D browsers to not even offer "Gouraud shading" with
> "Physical lighting model (PBR)", although theoretically it should be
> possible.)
>
>
> >
> > c. Use case: X3D4 scene with shapes using PBR then Inlines an X3D3 scene.
> > Presumably that is rendered in classic manner.
> >
>
> See my answer to b. This use-case is not related to the "shading" option.
>
> - If you use "Material" -> you have "Phong lighting model" (actually,
> "Blinn-Phong lighting model", but I often shorten it to just "Phong
> lighting model" in the context of X3D, because there is only "Blinn-Phong"
> version)
>
> - If you use "PhysicalMaterial" -> you have PBR, or "Physical lighting
> model".
>
> It doesn't matter if you "Inline" a model or load it in any other way. It
> doesn't matter if it's X3D 3 or X3D 4.
>
>
> >
> > d. Use case: author wants to upgrade an X3D3 model to PBR, so he changes
> > it to X3Dv4 and perhaps updates Material nodes as well.
> >
>
> See my answer to b. This use-case is not related to the "shading" option.
>
>
> >
> > e. Use case: X3D4 model wants to load X3D3 Inline and force it to use PBR
> > rendering.  Does this make sense?  Seems like X3D3 Material nodes simply
> > default to classic rendering, and so can be "upgraded" without deliberate
> > modeling changes that make the Inline model into an X3D4 model.  So such a
> > use case might not make sense....
> >
>
> It doesn't make sense, I'm afraid. If a shape uses "Material", then it uses
> "Phong lighting model", because "Material" specifies parameters like
> ambient / diffuse / specular that correspond to "Phong lighting model".
>
> We talked about this, I believe you asked this question a few times :)
> There is *no* automatic (correct, not only approximate) conversion from
> "Phong lighting model" (Material) -> "Physical lighting model, PBR"
> (PhysicalMaterial). These lighting models have incompatible equations with
> incompatible inputs. Authors that will want to "upgrade" their models to
> PBR will have to manually replace Material -> PhysicalMaterial nodes, and
> adjust PhysicalMaterial parameters, which have incompatible names and
> incompatible meaning from Material parameters.
>
> Regards,
> Michalis
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20200812/430b7404/attachment-0001.html>
>
> ------------------------------
>
> Message: 2
> Date: Thu, 13 Aug 2020 08:31:58 -0700
> From: Don Brutzman <brutzman at nps.edu>
> To: X3D Graphics public mailing list <x3d-public at web3d.org>
> Cc: Web3D Consortium Members <consortium at web3d.org>
> Subject: [x3d-public] News: CADEXchanger SDK adds X3D Import
> Message-ID: <f8a36765-c6af-6186-d981-a975cb2575d5 at nps.edu>
> Content-Type: text/plain; charset="utf-8"; format=flowed
>
> News: CADEXchanger SDK adds X3D import to existing export:
>
> [1] #X3D support in @CADExchanger SDK 3.8.1: new version supports not only export but also import of #X3D.
>         Now possible to view and explore the files and convert them to #VRML, OBJ, STL, and many other formats.
>         https://cadexchanger.com/blog/322-direct-unity-integration-enhanced-parasolid-procedural-geometry-support-and-x3d-import-in-cad-exchanger-sdk-3-8-1
>
>         https://twitter.com/Web3DConsortium/status/1293929673416511488
>
> More information:
>
> [2] CAD Exchanger 3.8.1 update 3D CAD viewer and converter
>      DEVELOP3D, 16 July 2020 by Al Dean
>      https://develop3d.com/cad/3d-cad-viewer-and-converter/?utm_campaign=meetedgar&utm_medium=social&utm_source=meetedgar.com
>
> Reference link:
>
> [3] X3D Resources, Conversions and Translation Tools, CADExchanger
>      CAD Exchanger is commercial C++ software to view and convert 3D models that supports multiple formats including VRML and X3D.
>      https://www.web3d.org/x3d/content/examples/X3dResources.html#CADExchanger
>
> all the best, Don
> --
> Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.edu
> Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
> X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman
>
>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> x3d-public mailing list
> x3d-public at web3d.org
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>
>
> ------------------------------
>
> End of x3d-public Digest, Vol 137, Issue 15
> *******************************************



-- 
Andreas Plesch
Waltham, MA 02453



More information about the x3d-public mailing list