Closed echadwick-artist closed 3 days ago
Upon further analyzing this issue I came to the conclusion that tangents are calculated differently. The discrepancy in the renderings is subsequently the result of anisotropy-rotation being calculated in tangent space. The given file does not include tangents for the meshes. In this case Sample Viewer uses MikkTSpace to calculate tangents globally as suggested by the specification.
If you inspect carefully the Babylon rendering you see the individual triangles of the mesh as a result of tangents being calculated locally in the shader:
I have created a version of your file that includes tangents in the mesh: compare_anisotropy_tangents.zip
In this case, the renderings of Babylon and Sample Viewer show the same rotation for anisotropy:
Sample Viewer:
Babylon:
This appears to be fixed. Thanks!
Anisotropy seems to be rendering perpendicular to the angle shown in every other glTF renderer.
Left object is without anisotropy, right object is with anisotropy.
All screenshots are using the "Studio" hdr from Babylonjs: https://github.com/BabylonJS/Assets/blob/master/environments/studioSoftbox2Umbrellas_panorama_radiance.hdr
For the object with anisotropy there are two materials: "spiral-anisotropy" for the flat sides with the circular grooves, and "grooved-anisotropy" for the curved part with the linear grooves. The spiral material is using an anisotropyTexture, the grooved material is not (anisotropyRotation alone controls the angle).
Materials on the object with anisotropy:
compare_anisotropy.zip