bevy/crates
Robert Swain 681c9c6dc8 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 21:54:40 +00:00
..
bevy_animation Bump Version after Release (#5576) 2022-08-05 02:03:05 +00:00
bevy_app Make Resource trait opt-in, requiring #[derive(Resource)] V2 (#5577) 2022-08-08 21:36:35 +00:00
bevy_asset Correctly parse labels with '#' (#5729) 2022-08-18 18:53:09 +00:00
bevy_audio Make Resource trait opt-in, requiring #[derive(Resource)] V2 (#5577) 2022-08-08 21:36:35 +00:00
bevy_core register Cow<'static, str> for reflection (#5664) 2022-08-16 20:46:44 +00:00
bevy_core_pipeline Remove unused DepthCalculation enum (#5684) 2022-08-14 07:08:58 +00:00
bevy_derive Bump Version after Release (#5576) 2022-08-05 02:03:05 +00:00
bevy_diagnostic Make Resource trait opt-in, requiring #[derive(Resource)] V2 (#5577) 2022-08-08 21:36:35 +00:00
bevy_dylib Bump Version after Release (#5576) 2022-08-05 02:03:05 +00:00
bevy_dynamic_plugin Bump Version after Release (#5576) 2022-08-05 02:03:05 +00:00
bevy_ecs Better error message for World::resource_scope (#5727) 2022-08-18 18:53:08 +00:00
bevy_ecs_compile_fail_tests Make Resource trait opt-in, requiring #[derive(Resource)] V2 (#5577) 2022-08-08 21:36:35 +00:00
bevy_encase_derive Bump Version after Release (#5576) 2022-08-05 02:03:05 +00:00
bevy_gilrs Bump Version after Release (#5576) 2022-08-05 02:03:05 +00:00
bevy_gltf Bump Version after Release (#5576) 2022-08-05 02:03:05 +00:00
bevy_hierarchy Remove duplicate asserts in test (#5648) 2022-08-15 23:03:42 +00:00
bevy_input Make Resource trait opt-in, requiring #[derive(Resource)] V2 (#5577) 2022-08-08 21:36:35 +00:00
bevy_internal Bump Version after Release (#5576) 2022-08-05 02:03:05 +00:00
bevy_log Make Resource trait opt-in, requiring #[derive(Resource)] V2 (#5577) 2022-08-08 21:36:35 +00:00
bevy_macro_utils Bump Version after Release (#5576) 2022-08-05 02:03:05 +00:00
bevy_math Bump Version after Release (#5576) 2022-08-05 02:03:05 +00:00
bevy_mikktspace Bump Version after Release (#5576) 2022-08-05 02:03:05 +00:00
bevy_pbr bevy_pbr: Fix tangent and normal normalization (#5666) 2022-08-18 21:54:40 +00:00
bevy_ptr Bump Version after Release (#5576) 2022-08-05 02:03:05 +00:00
bevy_reflect bevy_reflect: Add FromReflect to the prelude (#5720) 2022-08-18 18:53:07 +00:00
bevy_render Correctly use as_hsla_f32 in Add<Color> and AddAssign<Color>, fixes #5543 (#5546) 2022-08-17 14:00:10 +00:00
bevy_scene Make Resource trait opt-in, requiring #[derive(Resource)] V2 (#5577) 2022-08-08 21:36:35 +00:00
bevy_sprite Make vertex colors work without textures in bevy_sprite (#5685) 2022-08-16 20:46:45 +00:00
bevy_tasks Bump Version after Release (#5576) 2022-08-05 02:03:05 +00:00
bevy_text Make Resource trait opt-in, requiring #[derive(Resource)] V2 (#5577) 2022-08-08 21:36:35 +00:00
bevy_time bevy_reflect: Relax bounds on Option<T> (#5658) 2022-08-17 00:21:15 +00:00
bevy_transform Bump Version after Release (#5576) 2022-08-05 02:03:05 +00:00
bevy_ui Remove unused DepthCalculation enum (#5684) 2022-08-14 07:08:58 +00:00
bevy_utils Bump Version after Release (#5576) 2022-08-05 02:03:05 +00:00
bevy_window Make Resource trait opt-in, requiring #[derive(Resource)] V2 (#5577) 2022-08-08 21:36:35 +00:00
bevy_winit Make Resource trait opt-in, requiring #[derive(Resource)] V2 (#5577) 2022-08-08 21:36:35 +00:00