bevy/crates/bevy_render/src
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
..
batching Make render phases render world resources instead of components. (#13277) 2024-05-21 18:23:04 +00:00
camera #12502 Remove limit on RenderLayers. (#13317) 2024-05-16 16:15:47 +00:00
diagnostic Refactor App and SubApp internals for better separation (#9202) 2024-03-31 03:16:10 +00:00
mesh Fix normals during mesh scaling (#13380) 2024-05-21 18:28:03 +00:00
primitives Implement clone for most bundles. (#12993) 2024-04-16 16:37:09 +00:00
render_graph Fix beta lints (#12980) 2024-04-16 02:46:46 +00:00
render_phase Make render phases render world resources instead of components. (#13277) 2024-05-21 18:23:04 +00:00
render_resource multi_threaded feature rename (#12997) 2024-05-06 20:49:32 +00:00
renderer Disable RAY_QUERY and RAY_TRACING_ACCELERATION_STRUCTURE by default (#12862) 2024-04-04 19:20:19 +00:00
texture Throttle render assets (#12622) 2024-04-26 23:43:33 +00:00
view #12502 Remove limit on RenderLayers. (#13317) 2024-05-16 16:15:47 +00:00
alpha.rs Implement alpha to coverage (A2C) support. (#12970) 2024-04-15 20:37:52 +00:00
color_operations.wgsl move wgsl color operations from bevy_pbr to bevy_render (#13209) 2024-05-04 10:30:23 +00:00
extract_component.rs Fix some nightly Clippy lints (#12927) 2024-04-13 02:05:38 +00:00
extract_instances.rs Refactor App and SubApp internals for better separation (#9202) 2024-03-31 03:16:10 +00:00
extract_param.rs Enable the unsafe_op_in_unsafe_fn lint (#11591) 2024-01-28 23:18:11 +00:00
extract_resource.rs Add error when extract resource build fails (#4964) 2024-04-28 05:20:59 +00:00
globals.rs Refactor App and SubApp internals for better separation (#9202) 2024-03-31 03:16:10 +00:00
globals.wgsl Refactor Globals and View structs into separate shaders (#7512) 2023-02-11 17:55:18 +00:00
gpu_component_array_buffer.rs Refactor App and SubApp internals for better separation (#9202) 2024-03-31 03:16:10 +00:00
lib.rs Common MeshBuilder trait (#13411) 2024-05-18 11:58:11 +00:00
maths.wgsl move wgsl color operations from bevy_pbr to bevy_render (#13209) 2024-05-04 10:30:23 +00:00
pipelined_rendering.rs Make AppExit more specific about exit reason. (#13022) 2024-04-22 16:48:18 +00:00
render_asset.rs asset throttling: don't be exhausted if there is no limit (#13112) 2024-04-27 09:00:10 +00:00
settings.rs Update to wgpu 0.19 and raw-window-handle 0.6 (#11280) 2024-01-26 18:14:21 +00:00
spatial_bundle.rs Implement Clone for VisibilityBundle and SpatialBundle (#10394) 2023-11-07 21:25:00 +00:00