Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anisotropy fix #154

Merged
merged 3 commits into from
Dec 19, 2024
Merged

Anisotropy fix #154

merged 3 commits into from
Dec 19, 2024

Conversation

echadwick-artist
Copy link
Contributor

Removed KHR_texture_transform rotation for the normal map, rotated the pixels of the normal map, and reset the anisotropyRotation to zero. Adjusted anisotropyStrength so the normal map will be visible when the camera is perpendicular to the surface.

Per the reported issue here: #153

Screenshots from various glTF renderers:
2024-11-18 10_32_45-

2024-11-18 10_36_24-three js editor

Note that Dassault Enterprise PBR does not seem to support anisotropyTexture, so the spiral grooves are not rendering the same as the webGL rasterizers.

Removed KHR_texture_transform rotation for the normal map, rotated the pixels of the normal map, and reset the anisotropyRotation to zero.
Adjusted anisotropyStrength so the normal map will be visible when the camera is perpendicular to the surface.
@emackey
Copy link
Member

emackey commented Nov 18, 2024

@echadwick-artist Can you pull the latest copy of main and merge it down into this branch? Thanks!

@emackey
Copy link
Member

emackey commented Nov 18, 2024

The rotated normal map here doesn't look right to me. The grooves are most pronounced in the green (vertical) channel, not in the red (horizontal) channel. The map was presumably correct when these were horizontal grooves with long faces pointing +Y and -Y, but now that the image rotated, the long faces need to point +X and -X instead.

I think the correct answer is to swap the red and green channels of the image, and then invert one of them (maybe the green one after the swap).

Also the normal map apparently is itself not normalized (just guessing from the blue channel), and may need the same type of fix as #114.

@echadwick-artist
Copy link
Contributor Author

Oh gosh, you got me haha. I rotated the bitmap, not the normals! How could I forget this is a bunch of vectors, not a just pixels?

1. Recreated and normalized the normal maps.
2. Increased resolution for the spiral normal map because it was a bit pixely.
3. Set anisotropyStrength 0.5 so the normalTexture is visible when camera is perpendicular to surface.
4. Set all normalTexture Scales to 0.5 so they all match each other.
@echadwick-artist echadwick-artist merged commit 679a9d6 into main Dec 19, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants