From 7652fd7ee08e1933af67a0fb798d26d921b3f50e Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Sun, 8 May 2022 07:07:30 -0400 Subject: [PATCH] Revert "- model normals fix" This worked in some instances but it also broke attenuated lights in other instances, and also caused the shaders to fail to compile on Mac. This reverts commit 679518f8e57e436c01972cba927b2e8edb8a003f. --- wadsrc/static/shaders/glsl/main.fp | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/wadsrc/static/shaders/glsl/main.fp b/wadsrc/static/shaders/glsl/main.fp index a46a09beac..15af579a90 100644 --- a/wadsrc/static/shaders/glsl/main.fp +++ b/wadsrc/static/shaders/glsl/main.fp @@ -5,8 +5,8 @@ layout(location = 1) in vec4 vColor; layout(location = 2) in vec4 pixelpos; layout(location = 3) in vec3 glowdist; layout(location = 4) in vec3 gradientdist; -layout(location = 5) in vec4 vWorldNormalOrig; -layout(location = 6) in vec4 vEyeNormalOrig; +layout(location = 5) in vec4 vWorldNormal; +layout(location = 6) in vec4 vEyeNormal; layout(location = 9) in vec3 vLightmap; #ifdef NO_CLIPDISTANCE_SUPPORT @@ -20,9 +20,6 @@ layout(location=1) out vec4 FragFog; layout(location=2) out vec4 FragNormal; #endif -vec4 vWorldNormal; -vec4 vEyeNormal; - struct Material { vec4 Base; @@ -723,15 +720,6 @@ void main() if (ClipDistanceA.x < 0 || ClipDistanceA.y < 0 || ClipDistanceA.z < 0 || ClipDistanceA.w < 0 || ClipDistanceB.x < 0) discard; #endif - // Flip normal if it is facing away from the camera - vWorldNormal = vWorldNormalOrig; - vEyeNormal = vEyeNormalOrig; - if (dot(uCameraPos.xyz - pixelpos.xyz, vWorldNormal.xyz) < 0) - { - vWorldNormal.xyz = -vWorldNormal.xyz; - vEyeNormal.xyz = -vEyeNormal.xyz; - } - #ifndef LEGACY_USER_SHADER Material material;