[x3d-public] Calculation of normal from normalTexture.
Holger Seelig
holger.seelig at yahoo.de
Sat Apr 2 01:05:51 PDT 2022
Looking at X3DOneSidedMaterialNode https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-CD1/Part01/components/shape.html#X3DOneSidedMaterialNode <https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-CD1/Part01/components/shape.html#X3DOneSidedMaterialNode> I can find there the calculation of the normal as following:
normal.xyz = normalize((textureSample(normalTexture).rgb * vec3(2,2,2) - vec3(1,1,1)) * vec3(normalScale, normalScale, 1))
Think the handling of normalScale is wrong, the vector must include 3 times normalScale, not z equal 1, like so:
vec3(normalScale, normalScale, normalScale)
The second issue I notices is that the normalScale is applied before normalization, but that means that it has not effect. Normalization means multiplying the vector with a factor, so that the length of the vector is one (1), this makes the multiplication with the normalScale factor undone.
Best regards,
Holger.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20220402/3bcaa6ef/attachment.html>
More information about the x3d-public
mailing list