bevy/crates/bevy_pbr/src
Jan Hohenheim 8531033b31
Add support for KHR_texture_transform (#11904)
Adopted #8266, so copy-pasting the description from there:

# Objective

Support the KHR_texture_transform extension for the glTF loader.

- Fixes #6335
- Fixes #11869 
- Implements part of #11350
- Implements the GLTF part of #399 

## Solution

As is, this only supports a single transform. Looking at Godot's source,
they support one transform with an optional second one for detail, AO,
and emission. glTF specifies one per texture. The public domain
materials I looked at seem to share the same transform. So maybe having
just one is acceptable for now. I tried to include a warning if multiple
different transforms exist for the same material.

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. (note by @janhohenheim: this is still the case)

Via `cargo run --release --example scene_viewer
~/src/clone/glTF-Sample-Models/2.0/TextureTransformTest/glTF/TextureTransformTest.gltf`:


![texture_transform](https://user-images.githubusercontent.com/283864/228938298-aa2ef524-555b-411d-9637-fd0dac226fb0.png)

## Changelog

Support for the
[KHR_texture_transform](https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_texture_transform)
extension added. Texture UVs that were scaled, rotated, or offset in a
GLTF are now properly handled.

---------

Co-authored-by: Al McElrath <hello@yrns.org>
Co-authored-by: Kanabenki <lucien.menassol@gmail.com>
2024-02-21 01:11:28 +00:00
..
deferred Rename Core Render Graph Labels (#11882) 2024-02-15 23:15:16 +00:00
light_probe Disable irradiance volumes on WebGL and WebGPU. (#11909) 2024-02-17 01:49:46 +00:00
lightmap Move EntityHash related types into bevy_ecs (#11498) 2024-02-12 15:02:24 +00:00
prepass Stop extracting mesh entities to the render world. (#11803) 2024-02-10 10:46:10 +00:00
render Add support for KHR_texture_transform (#11904) 2024-02-21 01:11:28 +00:00
ssao Rename Core Render Graph Labels (#11882) 2024-02-15 23:15:16 +00:00
alpha.rs bevy_reflect: FromReflect Ergonomics Implementation (#6056) 2023-06-29 01:31:34 +00:00
bundle.rs Move EntityHash related types into bevy_ecs (#11498) 2024-02-12 15:02:24 +00:00
extended_material.rs Reorder impl to be the same as the trait (#11076) 2023-12-24 17:43:55 +00:00
fog.rs Missing registrations (#11736) 2024-02-06 16:33:17 +00:00
lib.rs Rename Core Render Graph Labels (#11882) 2024-02-15 23:15:16 +00:00
light.rs New Exposure and Lighting Defaults (and calibrate examples) (#11868) 2024-02-15 20:42:48 +00:00
material.rs Allow Mesh-related queue phase systems to parallelize (#11804) 2024-02-20 00:12:41 +00:00
parallax.rs bevy_reflect: FromReflect Ergonomics Implementation (#6056) 2023-06-29 01:31:34 +00:00
pbr_material.rs Add support for KHR_texture_transform (#11904) 2024-02-21 01:11:28 +00:00
wireframe.rs Fix global wireframe behavior not being applied on new meshes (#11792) 2024-02-12 19:48:45 +00:00