Closed jf908 closed 6 months ago
This also has problems with UV-map, but may be different kind
It is a similar issue. The material in the file is using a specific texCoord for its occlusionTexture but this is ignored by the gltf loader: https://github.com/bevyengine/bevy/blob/ade70b3925b27f76b669ac5fd9e2c31f824d7667/crates/bevy_gltf/src/loader.rs#L856
But the main issue is that bevy_pbr uses only one texcoord attribute for all textures. So it does not support multiple UV maps at the moment.
I thought with the lightmap update in 0.13, bevy pbr supported 2 UV maps? three.js is hardcoded to use the 2nd UV map for ambient occlusion and lightmap textures and the 1st UV map for everything else. Perhaps bevy could follow the same convention until multiple UV maps become more flexible?
It is a similar issue. The material in the file is using a specific texCoord for its occlusionTexture but this is ignored by the gltf loader
Problem is that baseColorTexture uses TEXCOORD_0, but (!!!) occlusionTexture uses TEXCOORD_1, bevy_pbr does use same ATTRIBUTE_UV_0 for both of them, that's why loader can't load this glb in mesh+StandardMaterial with correct bevy_pbr interpretation
Bevy version
0.13.2 and latest main (9592a40e1eb387f926b787cbb3a65d9db1dfb1a3)
Relevant system information
What you did
Load a gltf model with a ambient occlusion lightmap
What went wrong
In the example there is a cube mesh and a plane mesh, each with 2 UV maps. One UV map is used for the base colour and one is used for ambient occlusion. The gltf-viewer and three.js read and render the model correctly but not in bevy. The base texture can be seen properly rendered through the broken ambient occlusion texture so I suspect that the ambient occlusion is working but the 2nd UV map is not being used or being read incorrectly.
Additional information
Model used to test: gltf_model.zip