[x3d-public] Should Material.diffuseColor be updated to 1.0 1.0 1.0? & Should normalTexture be removed from UnlitMaterial?

Michalis Kamburelis michalis.kambi at gmail.com
Wed Sep 24 01:27:02 PDT 2025


Hello,

Let me answer these two points (as I was designing them in X3D 4.x:) ):

> 1.The Unlit lighting model formula has changed in v4.0/4.1: fragmentColor = applyFog(mixTexture(applyColorPerVertex(emissiveParameter), emissiveTextureParameter)). This differs from the definition in v3.3. However, the default value of Material.diffuseColor remains 0.8 0.8 0.8, which may results in a darkened diffuseTexture.

The unlit lighting formula should be equivalent to how things worked before.

In X3D 3.x there was no UnlitMaterial, but we had capability to make
unlit stuff e.g. when apperance=NULL or apperance.material=NULL or
when Material has all things except emissiveColor set to zero. All
these things should still work in equivalent way to X3D 4.x . The new
equations account for new things introduced (like emissiveTexture that
can multiply component-wise with emissiveColor).

That's also why we left Material.diffuseColor = (0.8,0.8,0.8). So
things here behave like before. Things should not be darker / lighter
compared to X3D 3.x.

It's of course possible I miss something or made a bug in some
thinking :) If you have a testcase where things are different
(darkened) but they should not, let me know.

>
> 2.normalTexture should be useless for UnlitMaterial. Should it be removed from UnlitMaterial?

It's a bit surprising, but UnlitMaterial also has use for normalTexture.

See https://github.com/michaliskambi/x3d-tests/wiki/How-to-add-PBR-to-X3D%3F#does-it-make-sense-that-unlitmaterial-also-has-normaltexture
, section "Does it make sense that UnlitMaterial also has
normalTexture?" . In short: TextureCoordinateGenerator with some modes
(CAMERASPACENORMAL, CAMERASPACEREFLECTIONVECTOR) can use normals, from
geometry and them modified by normalTexture, and this makes sense
regardless of the material type and being lit.

IOW, normals (and thus, also normalTexture) are *not* only for
lighting interaction (even though that's their only purpose in most
cases).

Regards,
Michalis



More information about the x3d-public mailing list