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

Textures not displaying properly if normal/base texture transforms don't align #13484

Open
GitGhillie opened this issue May 23, 2024 · 3 comments
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior S-Blocked This cannot move forward until something else changes

Comments

@GitGhillie
Copy link
Contributor

Bevy version

latest main (4dbfdcf)

Relevant system information

Windows 10

AdapterInfo { name: "AMD Radeon RX 7900 XT", vendor: 4098, device: 29772, device_type: DiscreteGpu, driver: "", driver_info: "", backend: Dx12 }

What you did

Export object from Unreal to gltf, with texture transforms enabled.
Load gltf with Bevy.

What went wrong

Using a gltf viewer it looks good:
image
However, in Bevy things look severely distorted:
image

Additional information

I've trimmed down the gltf and made a reproduction here: https://github.com/GitGhillie/bevy_repro/tree/broken-texture.
In Blender the shader for the material looks like this:
image
If you remove the Mapping node or copy it to the normal map such that both have equal transforms, everything looks as expected (except you destroy the art in the process).

There is a note in #11904 saying "Note the gltf crate doesn't expose the texture transform for the normal and occlusion textures, which it should, so I just ignored those for now". I'm 90% sure that's the issue but I don't have the experience to say for sure.

@GitGhillie GitGhillie added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels May 23, 2024
@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen S-Needs-Investigation This issue requires detective work to figure out what's going wrong and removed S-Needs-Triage This issue needs to be labelled labels May 23, 2024
@janhohenheim janhohenheim added S-Blocked This cannot move forward until something else changes and removed S-Needs-Investigation This issue requires detective work to figure out what's going wrong labels Jun 27, 2024
@janhohenheim
Copy link
Member

Yep, pretty sure the missing fields in the gltf crate are at fault here. Marking as blocked for now.

@GitGhillie
Copy link
Contributor Author

This one right? gltf-rs/gltf#412

@janhohenheim
Copy link
Member

Exactly. Thanks for linking :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior S-Blocked This cannot move forward until something else changes
Projects
None yet
Development

No branches or pull requests

3 participants