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

Support KHR_texture_transform per texture #15310

Open
jf908 opened this issue Sep 19, 2024 · 0 comments
Open

Support KHR_texture_transform per texture #15310

jf908 opened this issue Sep 19, 2024 · 0 comments
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

Comments

@jf908
Copy link

jf908 commented Sep 19, 2024

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.

  • This issue is blocked on gltf adding support for reading KHR_texture_transform for all textures.

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.

@jf908 jf908 added C-Feature A new feature, making something new possible S-Needs-Triage This issue needs to be labelled labels Sep 19, 2024
@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen A-Assets Load files from disk to use for things like images, models, and sounds and removed S-Needs-Triage This issue needs to be labelled labels Sep 19, 2024
@janhohenheim janhohenheim added the S-Blocked This cannot move forward until something else changes label Sep 23, 2024
@alice-i-cecile alice-i-cecile added A-glTF Related to the glTF 3D scene/model format and removed A-Assets Load files from disk to use for things like images, models, and sounds labels Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

3 participants