Add test for mesh transformations#18194
Conversation
|
CI failure appears unrelated to the PR. https://github.com/bevyengine/bevy/actions/runs/13727867039/job/38398331235?pr=18194#logs |
|
rather than using anisotropy, didn't we use to have a debug view to show tangents/normals? |
|
The (EDIT: Noticed this abandoned PR that added debug materials: #7390) I also considered drawing a per-vertex gizmo. But that doesn't cover the third test case which validates transforms in the shader. So my guess is that anisotropy is the least worst choice right now for showing that both tangents and normals are correct. |
| name = "transform_mesh" | ||
| path = "tests/3d/transform_mesh.rs" | ||
| doc-scrape-examples = true | ||
| required-features = ["pbr_anisotropy_texture"] |
There was a problem hiding this comment.
Requiring feature pbr_anisotropy_texture is a bug in the shader. The example doesn't actually use anisotropy textures. I'll file an issue if this PR goes through.
|
We have the RenderDebugOverlay now that could be used here. Conflicts also need to be resolved. |
|
Added render debug overlay. Although this can only show normals - not tangents - so I think using anisotropy is still the least worst solution for catching bugs. Also added supported for CI testing, but didn't actually hook it up to CI - I'm not sure about the criteria for adding new CI tests. |
Objective
Add a test that will repro issues with mesh transformations, like #17992.
Solution
The PR adds a
test_transform_meshexample that transforms a mesh in three different ways - each transformation should have the same visual result.The screenshot shows the test reproducing #17992 - the second mesh from the left should have matched the two meshes on the right.
Concerns
Testing
Tested on Win10/Vulkan/Nvidia.
cargo run --example test_transform_mesh --features "pbr_anisotropy_texture bevy_dev_tools"