bevyengine / bevyengine/bevy

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

Open
#13,484 3 comments 1 reaction 0 assignees View on GitHub
A-Rendering C-Bug S-Blocked
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## 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](https://github.com/bevyengine/bevy/assets/23659539/dfe6d8fc-cdee-4e74-a743-104150beca27)
However, in Bevy things look severely distorted:
![image](https://github.com/bevyengine/bevy/assets/23659539/b8f84dad-16d5-4416-a7ad-5ac44d7a8bac)

## 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](https://github.com/bevyengine/bevy/assets/23659539/9d144413-ff5c-4068-a716-54c99151c1c2)
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 https://github.com/bevyengine/bevy/pull/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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.