Support KHR_texture_transform per texture #15310
Labels
A-glTF
Related to the glTF 3D scene/model format
A-Rendering
Drawing game state to the screen
C-Feature
A new feature, making something new possible
S-Blocked
This cannot move forward until something else changes
What problem does this solve or what need does it fill?
In gltf files, KHR_texture_transform can be set per texture to offset/scale it but bevy currently uses the base color texture's transform and applies to every texture on the model.
Although bevy prints a warnings if the base color texture transform doesn't match other textures, the gltf crate doesn't support reading this value for normal maps or occlusion textures (and may not be until v2 gltf-rs/gltf#412) and will silently render incorrectly if different transforms are used per texture.
What solution would you like?
KHR_texture_transform to be supported per texture
What alternative(s) have you considered?
I ran into this issue because my occlusion texture was rendering incorrectly, even though it was using a completely separate UV map, because it was using the KHR_texture_transform value from the base color texture. Perhaps the texture transform should only apply to textures with matching UVs otherwise it's almost guaranteed to be wrong but I'm not sure that's as much of an improvement.
I ended up working around my issue but just "baking" KHR_texture_transform into my UV map instead.
Additional context
I made this issue mostly to document the fact that KHR_texture_transform is not fully supported as I didn't realize this fact until I looked at the source.
The text was updated successfully, but these errors were encountered: