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

Michalis Kamburelis michalis.kambi at gmail.com
Wed Aug 12 12:29:03 PDT 2020


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.html>


More information about the x3d-public mailing list