bevy/crates
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
..
bevy_animation Release 0.8.0 (#5490) 2022-07-30 14:07:30 +00:00
bevy_app Release 0.8.0 (#5490) 2022-07-30 14:07:30 +00:00
bevy_asset Release 0.8.0 (#5490) 2022-07-30 14:07:30 +00:00
bevy_audio Release 0.8.0 (#5490) 2022-07-30 14:07:30 +00:00
bevy_core Release 0.8.0 (#5490) 2022-07-30 14:07:30 +00:00
bevy_core_pipeline Release 0.8.0 (#5490) 2022-07-30 14:07:30 +00:00
bevy_derive Release 0.8.0 (#5490) 2022-07-30 14:07:30 +00:00
bevy_diagnostic Release 0.8.0 (#5490) 2022-07-30 14:07:30 +00:00
bevy_dylib Release 0.8.0 (#5490) 2022-07-30 14:07:30 +00:00
bevy_dynamic_plugin Release 0.8.0 (#5490) 2022-07-30 14:07:30 +00:00
bevy_ecs Release 0.8.0 (#5490) 2022-07-30 14:07:30 +00:00
bevy_ecs_compile_fail_tests Replace many_for_each_mut with iter_many_mut. (#5402) 2022-07-30 01:38:13 +00:00
bevy_encase_derive Release 0.8.0 (#5490) 2022-07-30 14:07:30 +00:00
bevy_gilrs Release 0.8.0 (#5490) 2022-07-30 14:07:30 +00:00
bevy_gltf Release 0.8.0 (#5490) 2022-07-30 14:07:30 +00:00
bevy_hierarchy Release 0.8.0 (#5490) 2022-07-30 14:07:30 +00:00
bevy_input Release 0.8.0 (#5490) 2022-07-30 14:07:30 +00:00
bevy_internal Release 0.8.0 (#5490) 2022-07-30 14:07:30 +00:00
bevy_log Release 0.8.0 (#5490) 2022-07-30 14:07:30 +00:00
bevy_macro_utils Release 0.8.0 (#5490) 2022-07-30 14:07:30 +00:00
bevy_math Release 0.8.0 (#5490) 2022-07-30 14:07:30 +00:00
bevy_mikktspace Release 0.8.0 (#5490) 2022-07-30 14:07:30 +00:00
bevy_pbr bevy_pbr: Fix tangent and normal normalization (#5666) 2022-08-18 16:54:01 -07:00
bevy_ptr Release 0.8.0 (#5490) 2022-07-30 14:07:30 +00:00
bevy_reflect Release 0.8.0 (#5490) 2022-07-30 14:07:30 +00:00
bevy_render Release 0.8.0 (#5490) 2022-07-30 14:07:30 +00:00
bevy_scene Release 0.8.0 (#5490) 2022-07-30 14:07:30 +00:00
bevy_sprite Sync up bevy_sprite and bevy_ui shader View struct (#5531) 2022-08-18 16:53:46 -07:00
bevy_tasks Release 0.8.0 (#5490) 2022-07-30 14:07:30 +00:00
bevy_text Release 0.8.0 (#5490) 2022-07-30 14:07:30 +00:00
bevy_time Release 0.8.0 (#5490) 2022-07-30 14:07:30 +00:00
bevy_transform Release 0.8.0 (#5490) 2022-07-30 14:07:30 +00:00
bevy_ui Sync up bevy_sprite and bevy_ui shader View struct (#5531) 2022-08-18 16:53:46 -07:00
bevy_utils Release 0.8.0 (#5490) 2022-07-30 14:07:30 +00:00
bevy_window fix order of exit/close window systems (#5558) 2022-08-18 16:53:34 -07:00
bevy_winit Release 0.8.0 (#5490) 2022-07-30 14:07:30 +00:00