bevy/crates
Johannes Hackel 3f5a090b1b
Add UV channel selection to StandardMaterial (#13200)
# Objective

- The StandardMaterial always uses ATTRIBUTE_UV_0 for each texture
except lightmap. This is not flexible enough for a lot of gltf Files.
- Fixes #12496
- Fixes #13086
- Fixes #13122
- Closes #13153

## Solution

- The StandardMaterial gets extended for each texture by an UvChannel
enum. It defaults to Uv0 but can also be set to Uv1.
- The gltf loader now handles the texcoord information. If the texcoord
is not supported it creates a warning.
- It uses StandardMaterial shader defs to define which attribute to use.

## Testing

This fixes #12496 for example:

![wall_fixed](https://github.com/bevyengine/bevy/assets/688816/bc37c9e1-72ba-4e59-b092-5ee10dade603)

For testing of all kind of textures I used the TextureTransformMultiTest
from
https://github.com/KhronosGroup/glTF-Sample-Assets/tree/main/Models/TextureTransformMultiTest
Its purpose is to test multiple texture transfroms but it is also a good
test for different texcoords.
It also shows the issue with emission #13133.

Before:

![TextureTransformMultiTest_main](https://github.com/bevyengine/bevy/assets/688816/aa701d04-5a3f-4df1-a65f-fc770ab6f4ab)

After:

![TextureTransformMultiTest_texcoord](https://github.com/bevyengine/bevy/assets/688816/c3f91943-b830-4068-990f-e4f2c97771ee)
2024-05-13 18:23:09 +00:00
..
bevy_a11y Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_animation Remove ClampColor (#13307) 2024-05-10 13:15:56 +00:00
bevy_app Separate state crate (#13216) 2024-05-09 18:06:05 +00:00
bevy_asset bevy_asset: Add missing web-sys feature and cleanup unused ones (#13281) 2024-05-12 20:53:59 +00:00
bevy_audio Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_color Remove ClampColor (#13307) 2024-05-10 13:15:56 +00:00
bevy_core bevy_core: Derive useful traits on FrameCount (#13291) 2024-05-10 10:00:08 +00:00
bevy_core_pipeline Fix incorrect workgroupBarrier and OOB array access in auto_exposure (#13283) 2024-05-12 23:24:58 +00:00
bevy_derive Update compile test to use ui_test 0.23 (#13245) 2024-05-05 22:17:56 +00:00
bevy_dev_tools new format for ci config file (#13154) 2024-05-02 22:51:47 +00:00
bevy_diagnostic Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_dylib Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_dynamic_plugin Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_ecs Separate state crate (#13216) 2024-05-09 18:06:05 +00:00
bevy_encase_derive Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_gilrs Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_gizmos gizmos: take normal of normal on plane 3d before rotation (#13326) 2024-05-11 19:32:31 +00:00
bevy_gltf Add UV channel selection to StandardMaterial (#13200) 2024-05-13 18:23:09 +00:00
bevy_hierarchy Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_input Separate state crate (#13216) 2024-05-09 18:06:05 +00:00
bevy_internal Separate state crate (#13216) 2024-05-09 18:06:05 +00:00
bevy_log Improve tracing layer customization (#13159) 2024-05-12 21:16:56 +00:00
bevy_macro_utils Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_math Add meshing for Cone (#11820) 2024-05-13 18:00:59 +00:00
bevy_mikktspace Update glam version requirement from 0.25 to 0.27 (#12757) 2024-05-02 18:42:34 +00:00
bevy_pbr Add UV channel selection to StandardMaterial (#13200) 2024-05-13 18:23:09 +00:00
bevy_ptr Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_reflect Avoid bevy_reflect::List::iter wrapping in release mode (#13271) 2024-05-12 15:01:05 +00:00
bevy_render Add meshing for Cone (#11820) 2024-05-13 18:00:59 +00:00
bevy_scene Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_sprite Clean up 2d render phases (#12982) 2024-05-08 08:13:39 +00:00
bevy_state State example (#13322) 2024-05-13 13:03:42 +00:00
bevy_tasks multi_threaded feature rename (#12997) 2024-05-06 20:49:32 +00:00
bevy_text Add doc comments explaining the different behaviours of alignment and Anchor with text_2d (#8022) 2024-05-12 21:42:04 +00:00
bevy_time Make bevy_time optionally depend on bevy_reflect (#13263) 2024-05-12 23:19:07 +00:00
bevy_transform Use Dir3 for local axis methods in GlobalTransform (#13264) 2024-05-06 20:52:05 +00:00
bevy_ui Clean up 2d render phases (#12982) 2024-05-08 08:13:39 +00:00
bevy_utils Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00
bevy_window Ensure clean exit (#13236) 2024-05-12 15:56:01 +00:00
bevy_winit Ensure clean exit (#13236) 2024-05-12 15:56:01 +00:00