bevy/crates/bevy_render
Lynn 2857eb6b9d
Fix normals during mesh scaling (#13380)
# Objective

- Fixes scaling normals and tangents of meshes

## Solution

- When scaling a mesh by `Vec3::new(1., 1., -1.)`, the normals should be
flipped along the Z-axis. For example a normal of `Vec3::new(0., 0.,
1.)` should become `Vec3::new(0., 0., -1.)` after scaling. This is
achieved by multiplying the normal by the reciprocal of the scale,
cheking for infinity and normalizing. Before, the normal was multiplied
by a covector of the scale, which is incorrect for normals.
- Tangents need to be multiplied by the `scale`, not its reciprocal as
before

---------

Co-authored-by: vero <11307157+atlv24@users.noreply.github.com>
2024-05-21 18:28:03 +00:00
..
macros Consolidate Render(Ui)Materials(2d) into RenderAssets (#12827) 2024-04-09 13:26:34 +00:00
src Fix normals during mesh scaling (#13380) 2024-05-21 18:28:03 +00:00
Cargo.toml #12502 Remove limit on RenderLayers. (#13317) 2024-05-16 16:15:47 +00:00
README.md Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00

Bevy Render

License Crates.io Downloads Docs Discord