bevy/crates/bevy_pbr/src/render
Robert Swain a7ece4ce85 bevy_pbr: Fix tangent and normal normalization (#5666)
# Objective

- Morten Mikkelsen clarified that the world normal and tangent must be normalized in the vertex stage and the interpolated values must not be normalized in the fragment stage. This is in order to match the mikktspace approach exactly.
- Fixes #5514 by ensuring the tangent basis matrix (TBN) is orthonormal

## Solution

- Normalize the world normal in the vertex stage and not the fragment stage
- Normalize the world tangent xyz in the vertex stage
- Take into account the sign of the determinant of the local to world matrix when calculating the bitangent

---

## Changelog

- Fixed - scaling a model that uses normal mapping now has correct lighting again
2022-08-18 16:54:01 -07:00
..
clustered_forward.wgsl Spotlights (#4715) 2022-07-08 19:57:43 +00:00
depth.wgsl update wgpu to 0.13 (#5168) 2022-07-14 21:17:16 +00:00
light.rs Spotlight shadow bugfix (#5451) 2022-07-25 16:24:54 +00:00
mesh_bindings.wgsl update wgpu to 0.13 (#5168) 2022-07-14 21:17:16 +00:00
mesh_functions.wgsl bevy_pbr: Fix tangent and normal normalization (#5666) 2022-08-18 16:54:01 -07:00
mesh_types.wgsl bevy_pbr: Fix tangent and normal normalization (#5666) 2022-08-18 16:54:01 -07:00
mesh_vertex_output.wgsl update wgpu to 0.13 (#5168) 2022-07-14 21:17:16 +00:00
mesh_view_bindings.wgsl update wgpu to 0.13 (#5168) 2022-07-14 21:17:16 +00:00
mesh_view_types.wgsl update wgpu to 0.13 (#5168) 2022-07-14 21:17:16 +00:00
mesh.rs bevy_pbr: Fix tangent and normal normalization (#5666) 2022-08-18 16:54:01 -07:00
mesh.wgsl update wgpu to 0.13 (#5168) 2022-07-14 21:17:16 +00:00
mod.rs Materials and MaterialPlugin (#3428) 2021-12-25 21:45:43 +00:00
pbr_bindings.wgsl update wgpu to 0.13 (#5168) 2022-07-14 21:17:16 +00:00
pbr_functions.wgsl bevy_pbr: Fix tangent and normal normalization (#5666) 2022-08-18 16:54:01 -07:00
pbr_lighting.wgsl update wgpu to 0.13 (#5168) 2022-07-14 21:17:16 +00:00
pbr_types.wgsl update wgpu to 0.13 (#5168) 2022-07-14 21:17:16 +00:00
pbr.wgsl update wgpu to 0.13 (#5168) 2022-07-14 21:17:16 +00:00
shadows.wgsl Spotlights (#4715) 2022-07-08 19:57:43 +00:00
skinning.wgsl update wgpu to 0.13 (#5168) 2022-07-14 21:17:16 +00:00
utils.wgsl Separate out PBR lighting, shadows, clustered forward, and utils from pbr.wgsl (#4938) 2022-06-14 00:58:30 +00:00
wireframe.wgsl update wgpu to 0.13 (#5168) 2022-07-14 21:17:16 +00:00