[x3d-public] Should Material.diffuseColor be updated to 1.0 1.0 1.0? & Should normalTexture be removed from UnlitMaterial?
microaaron at pku.edu.cn
microaaron at pku.edu.cn
Wed Sep 24 10:00:58 PDT 2025
Thanks for your reply.
Material.diffuseColor is specific to the Phone lighting model. The default value of 0.8 0.8 0.8 may darken diffuseTexture.
For Unlit lighting model, the default value of UnlitMaterial.emissiveColor is 1.0 1.0 1.0, and multiplying it by emissiveTexture does not darken emissiveTexture.
Similarly, for Physical lighting model, the default value of PhysicalMaterial.baseColor is 1.0 1.0 1.0, and does not darken baseTexture.
In the older X3D V3.3, diffuseTexture is not multiplied by diffuseColor. Once diffuseTexture is enabled, diffuseColor or vertexColor is useless. This is effectively equivalent to multiplying diffuseTexture by 1.0 1.0 1.0. DiffuseTexture does not darken.
(I haven't found a test case yet.)
> -----Original Messages-----
> From: "Michalis Kamburelis" <michalis.kambi at gmail.com>
> Send time:Wednesday, 24/09/2025 16:27:02
> To: "Extensible 3D (X3D) Graphics public discussion" <x3d-public at web3d.org>
> Cc: microaaron at pku.edu.cn
> Subject: Re: [x3d-public] Should Material.diffuseColor be updated to 1.0 1.0 1.0? & Should normalTexture be removed from UnlitMaterial?
>
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20250925/7d3c89d8/attachment.html>
More information about the x3d-public
mailing list