Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2022-05-23 17:22:36 +0300
committerClément Foucault <foucault.clem@gmail.com>2022-05-23 17:23:50 +0300
commitaea59428eba1322bbc413da7fc70d1a709162fa7 (patch)
tree7c400e0d7e340a27bc9d4baa5d32ecf673f85347 /source/blender/draw/engines/eevee
parent63cf0d089082fc3c40d3bd1471bbefd786488aea (diff)
Fix T98128: EEVEE: Regression: Inverted surface normal on MacOS Intel GPU
This seems to be caused by the `!` used in conjunction with a macro. Using the macro directly as condition does not exhibit this issue.
Diffstat (limited to 'source/blender/draw/engines/eevee')
-rw-r--r--source/blender/draw/engines/eevee/shaders/surface_lib.glsl4
1 files changed, 1 insertions, 3 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/surface_lib.glsl b/source/blender/draw/engines/eevee/shaders/surface_lib.glsl
index 696e5d4c97b..81f73979723 100644
--- a/source/blender/draw/engines/eevee/shaders/surface_lib.glsl
+++ b/source/blender/draw/engines/eevee/shaders/surface_lib.glsl
@@ -108,9 +108,7 @@ GlobalData init_globals(void)
# endif
surf.barycentric_coords = vec2(0.0);
surf.barycentric_dists = vec3(0.0);
- if (!FrontFacing) {
- surf.N = -surf.N;
- }
+ surf.N = (FrontFacing) ? surf.N : -surf.N;
# ifdef HAIR_SHADER
vec3 V = cameraVec(surf.P);
/* Shade as a cylinder. */