mirror of
https://github.com/bevyengine/bevy
synced 2024-12-19 17:43:07 +00:00
579928e8e0
# Objective - Normal maps authored for DirectX use a left-handed convention and have their tangent space normal in the texture inverted from what we need. Support this. - Details here: https://doc.babylonjs.com/divingDeeper/materials/advanced/normalMaps ## Solution - Add a `StandardMaterial` `flip_normal_map_y` boolean field - Add a `STANDARDMATERIAL_FLIP_NORMAL_MAP_Y` flag to `StandardMaterialFlags` and in the PBR shader - Flip the y-component of the tangent space normal just after sampling it from the normal map texture ## Screenshots ### Before <img width="1392" alt="Screenshot 2022-04-06 at 21 04 44" src="https://user-images.githubusercontent.com/302146/162050314-e7bfaaf6-9ee1-4756-9821-f6f5ff78f508.png"> ### After <img width="1392" alt="Screenshot 2022-04-06 at 21 03 39" src="https://user-images.githubusercontent.com/302146/162050255-36ee0745-1d79-4fd2-9a1c-18085376b643.png"> --- ## Changelog - Added: Support for flipping the normal map texture y component for normal maps authored for use with DirectX |
||
---|---|---|
.. | ||
render | ||
alpha.rs | ||
bundle.rs | ||
lib.rs | ||
light.rs | ||
material.rs | ||
pbr_material.rs | ||
wireframe.rs |