From aea59428eba1322bbc413da7fc70d1a709162fa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Mon, 23 May 2022 16:22:36 +0200 Subject: 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. --- source/blender/draw/engines/eevee/shaders/surface_lib.glsl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'source/blender/draw/engines/eevee') 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. */ -- cgit v1.2.3