diff --git a/engine/src/core-data/Common/MatDefs/Light/Lighting.frag b/engine/src/core-data/Common/MatDefs/Light/Lighting.frag index ac2e2b87f..2c4731da5 100644 --- a/engine/src/core-data/Common/MatDefs/Light/Lighting.frag +++ b/engine/src/core-data/Common/MatDefs/Light/Lighting.frag @@ -14,7 +14,7 @@ varying vec3 SpecularSum; #ifndef VERTEX_LIGHTING uniform vec4 g_LightDirection; - varying vec3 vPosition; + //varying vec3 vPosition; varying vec3 vViewDir; varying vec4 vLightDir; varying vec3 lightVec; @@ -116,7 +116,7 @@ float lightComputeSpecular(in vec3 norm, in vec3 viewdir, in vec3 lightdir, in f #endif } -vec2 computeLighting(in vec3 wvPos, in vec3 wvNorm, in vec3 wvViewDir, in vec3 wvLightDir){ +vec2 computeLighting(in vec3 wvNorm, in vec3 wvViewDir, in vec3 wvLightDir){ float diffuseFactor = lightComputeDiffuse(wvNorm, wvLightDir, wvViewDir); float specularFactor = lightComputeSpecular(wvNorm, wvViewDir, wvLightDir, m_Shininess); @@ -250,7 +250,7 @@ void main(){ vec4 lightDir = vLightDir; lightDir.xyz = normalize(lightDir.xyz); - vec2 light = computeLighting(vPosition, normal, vViewDir.xyz, lightDir.xyz) * spotFallOff; + vec2 light = computeLighting(normal, vViewDir.xyz, lightDir.xyz) * spotFallOff; #ifdef COLORRAMP diffuseColor.rgb *= texture2D(m_ColorRamp, vec2(light.x, 0.0)).rgb; specularColor.rgb *= texture2D(m_ColorRamp, vec2(light.y, 0.0)).rgb; diff --git a/engine/src/core-data/Common/MatDefs/Light/Lighting.vert b/engine/src/core-data/Common/MatDefs/Light/Lighting.vert index 2c3285e12..ec9a8daac 100644 --- a/engine/src/core-data/Common/MatDefs/Light/Lighting.vert +++ b/engine/src/core-data/Common/MatDefs/Light/Lighting.vert @@ -42,7 +42,7 @@ varying vec3 lightVec; #ifndef NORMALMAP varying vec3 vNormal; #endif - varying vec3 vPosition; + //varying vec3 vPosition; varying vec3 vViewDir; varying vec4 vLightDir; #else @@ -157,14 +157,14 @@ void main(){ mat3 tbnMat = mat3(wvTangent, wvBinormal * -inTangent.w,wvNormal); - vPosition = wvPosition * tbnMat; + //vPosition = wvPosition * tbnMat; vViewDir = viewDir * tbnMat; lightComputeDir(wvPosition, lightColor, wvLightPos, vLightDir); vLightDir.xyz = (vLightDir.xyz * tbnMat).xyz; #elif !defined(VERTEX_LIGHTING) vNormal = wvNormal; - vPosition = wvPosition; + //vPosition = wvPosition; vViewDir = viewDir; lightComputeDir(wvPosition, lightColor, wvLightPos, vLightDir);