Merge branch 'normalizednormals' into 'master'

Don't handle per-vertex normals as tangent space normals (#7748)

See merge request OpenMW/openmw!3704
macos_ci_fix
jvoisin 5 months ago
commit db0d78ba24

@ -80,7 +80,7 @@ void main()
vec3 viewNormal = normalToView(normalTex.xyz * 2.0 - 1.0); vec3 viewNormal = normalToView(normalTex.xyz * 2.0 - 1.0);
specularColor *= normalTex.a; specularColor *= normalTex.a;
#else #else
vec3 viewNormal = normalToView(normalize(passNormal)); vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);
#endif #endif
float shadowing = unshadowedLightRatio(linearDepth); float shadowing = unshadowedLightRatio(linearDepth);

@ -69,7 +69,7 @@ void main(void)
#if @shadows_enabled #if @shadows_enabled
vec3 viewNormal = normalToView(passNormal); vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);
setupShadowCoords(viewPos, viewNormal); setupShadowCoords(viewPos, viewNormal);
#endif #endif
} }

@ -63,7 +63,7 @@ void main(void)
} }
#if @shadows_enabled #if @shadows_enabled
vec3 viewNormal = normalize((gl_NormalMatrix * gl_Normal).xyz); vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);
setupShadowCoords(viewPos, viewNormal); setupShadowCoords(viewPos, viewNormal);
#endif #endif
} }

@ -156,7 +156,7 @@ void main(void)
#endif #endif
#if (!PER_PIXEL_LIGHTING || @shadows_enabled) #if (!PER_PIXEL_LIGHTING || @shadows_enabled)
vec3 viewNormal = normalToView(passNormal); vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);
#endif #endif
#if @diffuseMap #if @diffuseMap

@ -169,7 +169,7 @@ vec2 screenCoords = gl_FragCoord.xy / screenRes;
#if @normalMap #if @normalMap
vec3 viewNormal = normalToView(texture2D(normalMap, normalMapUV + offset).xyz * 2.0 - 1.0); vec3 viewNormal = normalToView(texture2D(normalMap, normalMapUV + offset).xyz * 2.0 - 1.0);
#else #else
vec3 viewNormal = normalToView(normalize(passNormal)); vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);
#endif #endif
vec3 viewVec = normalize(passViewPos); vec3 viewVec = normalize(passViewPos);

@ -101,7 +101,7 @@ void main(void)
#endif #endif
#if @envMap || !PER_PIXEL_LIGHTING || @shadows_enabled #if @envMap || !PER_PIXEL_LIGHTING || @shadows_enabled
vec3 viewNormal = normalToView(passNormal); vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);
#endif #endif
#if @envMap #if @envMap

@ -65,7 +65,7 @@ void main()
#if @normalMap #if @normalMap
vec3 viewNormal = normalToView(texture2D(normalMap, adjustedUV).xyz * 2.0 - 1.0); vec3 viewNormal = normalToView(texture2D(normalMap, adjustedUV).xyz * 2.0 - 1.0);
#else #else
vec3 viewNormal = normalToView(normalize(passNormal)); vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);
#endif #endif
float shadowing = unshadowedLightRatio(linearDepth); float shadowing = unshadowedLightRatio(linearDepth);

@ -52,7 +52,7 @@ void main(void)
#endif #endif
#if !PER_PIXEL_LIGHTING || @shadows_enabled #if !PER_PIXEL_LIGHTING || @shadows_enabled
vec3 viewNormal = normalToView(passNormal); vec3 viewNormal = normalize(gl_NormalMatrix * passNormal);
#endif #endif
#if !PER_PIXEL_LIGHTING #if !PER_PIXEL_LIGHTING

Loading…
Cancel
Save