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 679518f8e5.
This commit is contained in:
Rachael Alexanderson 2022-05-08 07:07:30 -04:00
parent 9dea7cbaf9
commit 7652fd7ee0

View file

@ -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;