[x3d-public] TwoSidedMaterial deprecation by adding Appearance backMaterial field

Michalis Kamburelis michalis.kambi at gmail.com
Sun Feb 2 13:15:33 PST 2020


> Wondering what you think about compatibility with PBR upgrades: does allowing either legacy TwoSidedMaterial or equivalent Appearance/material/backMaterial approaches result in major difficulty implementing PBR?  If two-sided materials are a problematic drawback for PBR, that is important to know.

Let us carefully distinguish two cases here:

1. Two-sided materials *with the same colors on both sides* are easy
to implement. And most software / formats supports them, I think.

    This is called "two-sided lighting" commonly, and one just inverts
a normal vector before calculations to do it.

    These materials are also already possible in X3D thanks to the
"solid" field. As Andreas found, X3D specification of "solid" already
includes wording to perform two-sided lighting in this case. So, no
new X3D fields are necessary, and TwoSidedMaterial node is not
necessary.

2. Two-sided materials *with different color on front / back sides*
are a small burden to implement. It is the same burden for Phong as
well as for PBR materials. You need to pass two sets of colors, and
switch between them.

    It's not a *major* burden. They are still relatively easy. I'm
mostly arguing because I don't see this burden as "justified".

    (Note that in X3Dv4, materials can also refer to textures, but in
this case I would say that both front and back must refer to the same
texture nodes.)

    That is why I argue in favor of just deprecating this option.

    For example: CGE doesn't implement TwoSidedMaterial with
separateBackColor=TRUE. And I don't plan to implement it soon -- until
I get a report asking me to implement it. I just don't see it as
useful enough, when other software / formats doesn't support it
either. You will not be able to export such materials from Blender any
time soon, anyway. glTF doesn't have it either, so you don't need it
to convert glTF -> X3D.

    Two-sided materials *with different color on front / back sides*
also require some action on the spec side. Because the current
TwoSidedMaterial is only for Phong material. So the decision about
this affects what to do with PBR.

    My point  of view: We need to decide whether two-sided materials
with different front / back colors are useful.

    2.1. (my view) They are not useful (and are some burden to
implement). So let's just deprecate "TwoSidedMaterial", and be done
for X3D 4.0. If users report they are needed, then in X3D 4.1 we add
"backMaterial". The browsers can  of course keep supporting
"TwoSidedMaterial" forever, we just make it clear to users to not rely
on it.

    2.2. (your view, as I understand it) They are useful. So we
deprecate TwoSidedMaterial, and add "backMaterial" in X3D 4.0. This
way this feature remains available for both Phong and PBR materials.
IOW, if we decide that it is useful -> it has to available for both
Phong and PBR materials, to keep them both full-featured.

    I'm cool to be persuaded to 2.2 :) My opinion is definitely not in
the stone. But I would really like to see some real-world cases when
they are used by 3D artists. I'm arguing now just from my experience
-- I never saw this feature used, or requested, by 3D artists. Of
course my experience is limited to my use-cases :)

Regards,
Michalis



More information about the x3d-public mailing list