[x3d-public] TwoSidedMaterial

Michalis Kamburelis michalis.kambi at gmail.com
Tue Jan 21 08:17:47 PST 2020

Andreas Plesch <andreasplesch at gmail.com> wrote:
> I think solid=false already changes the lighting on the back face
> since normals need to be inverted there in order to perform two sided
> lighting:
> https://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/rendering.html#CommonGeometryFields
> "If solid is FALSE, each polygon shall be visible regardless of the
> viewing direction (i.e., no backface culling shall be done, and two
> sided lighting shall be performed to illuminate both sides of lit
> surfaces)"
> So solid is not just about culling back faces but also about lighting,
> currently, if I read the sentence correctly.

Mea culpa. You're right of course. Somehow I never registered the
phrase """two sided lighting shall be performed to illuminate both
sides of lit surfaces""" in the above text.

All right, then indeed we can simplify stuff. It seems "Material"
should already have two-sided lighting calculation, if solid=false.

And so, TwoSidedMaterial with separateBackColor=false has completely no purpose.

> I also agree that from an implementation point of view it may be
> preferable to deprecate TwoSidedMaterial completely. Does glTF have a
> similar feature ?

glTF 2.0 has "material.doubleSided", that determines both backface
culling and two-sided lighting. So it matches X3D "solid" field
(although it's at material, not at mesh). The exact glTF prose (

The doubleSided property specifies whether the material is double
sided. When this value is false, back-face culling is enabled. When
this value is true, back-face culling is disabled and double sided
lighting is enabled. The back-face must have its normals reversed
before the lighting equation is evaluated.

glTF doesn't have anything resembling TwoSidedMaterial with
separateBackColor=true, as far as I can see.


More information about the x3d-public mailing list