mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 18:29:55 +00:00
Don't handle per-vertex normals as tangent space normals
This commit is contained in:
parent
01eb333fad
commit
f83a7b711a
8 changed files with 8 additions and 8 deletions
|
@ -80,7 +80,7 @@ void main()
|
|||
vec3 viewNormal = normalToView(normalTex.xyz * 2.0 - 1.0);
|
||||
specularColor *= normalTex.a;
|
||||
#else
|
||||
vec3 viewNormal = normalToView(normalize(passNormal));
|
||||
vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);
|
||||
#endif
|
||||
|
||||
float shadowing = unshadowedLightRatio(linearDepth);
|
||||
|
|
|
@ -69,7 +69,7 @@ void main(void)
|
|||
|
||||
|
||||
#if @shadows_enabled
|
||||
vec3 viewNormal = normalToView(passNormal);
|
||||
vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);
|
||||
setupShadowCoords(viewPos, viewNormal);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ void main(void)
|
|||
}
|
||||
|
||||
#if @shadows_enabled
|
||||
vec3 viewNormal = normalize((gl_NormalMatrix * gl_Normal).xyz);
|
||||
vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);
|
||||
setupShadowCoords(viewPos, viewNormal);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -156,7 +156,7 @@ void main(void)
|
|||
#endif
|
||||
|
||||
#if (!PER_PIXEL_LIGHTING || @shadows_enabled)
|
||||
vec3 viewNormal = normalToView(passNormal);
|
||||
vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);
|
||||
#endif
|
||||
|
||||
#if @diffuseMap
|
||||
|
|
|
@ -169,7 +169,7 @@ vec2 screenCoords = gl_FragCoord.xy / screenRes;
|
|||
#if @normalMap
|
||||
vec3 viewNormal = normalToView(texture2D(normalMap, normalMapUV + offset).xyz * 2.0 - 1.0);
|
||||
#else
|
||||
vec3 viewNormal = normalToView(normalize(passNormal));
|
||||
vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);
|
||||
#endif
|
||||
|
||||
vec3 viewVec = normalize(passViewPos);
|
||||
|
|
|
@ -101,7 +101,7 @@ void main(void)
|
|||
#endif
|
||||
|
||||
#if @envMap || !PER_PIXEL_LIGHTING || @shadows_enabled
|
||||
vec3 viewNormal = normalToView(passNormal);
|
||||
vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);
|
||||
#endif
|
||||
|
||||
#if @envMap
|
||||
|
|
|
@ -65,7 +65,7 @@ void main()
|
|||
#if @normalMap
|
||||
vec3 viewNormal = normalToView(texture2D(normalMap, adjustedUV).xyz * 2.0 - 1.0);
|
||||
#else
|
||||
vec3 viewNormal = normalToView(normalize(passNormal));
|
||||
vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);
|
||||
#endif
|
||||
|
||||
float shadowing = unshadowedLightRatio(linearDepth);
|
||||
|
|
|
@ -52,7 +52,7 @@ void main(void)
|
|||
#endif
|
||||
|
||||
#if !PER_PIXEL_LIGHTING || @shadows_enabled
|
||||
vec3 viewNormal = normalToView(passNormal);
|
||||
vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);
|
||||
#endif
|
||||
|
||||
#if !PER_PIXEL_LIGHTING
|
||||
|
|
Loading…
Reference in a new issue