1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-06-06 10:11:32 +00:00

Do all alpha testing early and only once

This commit is contained in:
AnyOldName3 2020-12-27 03:07:04 +00:00
parent 5e004356a2
commit 54d465e3dc

View file

@ -109,11 +109,14 @@ void main()
#if @diffuseMap #if @diffuseMap
gl_FragData[0] = texture2D(diffuseMap, adjustedDiffuseUV); gl_FragData[0] = texture2D(diffuseMap, adjustedDiffuseUV);
alphaTest();
#else #else
gl_FragData[0] = vec4(1.0); gl_FragData[0] = vec4(1.0);
#endif #endif
vec4 diffuseColor = getDiffuseColor();
gl_FragData[0].a *= diffuseColor.a;
alphaTest();
#if @detailMap #if @detailMap
gl_FragData[0].xyz *= texture2D(detailMap, detailMapUV).xyz * 2.0; gl_FragData[0].xyz *= texture2D(detailMap, detailMapUV).xyz * 2.0;
#endif #endif
@ -152,10 +155,6 @@ void main()
#endif #endif
vec4 diffuseColor = getDiffuseColor();
gl_FragData[0].a *= diffuseColor.a;
alphaTest();
float shadowing = unshadowedLightRatio(linearDepth); float shadowing = unshadowedLightRatio(linearDepth);
vec3 lighting; vec3 lighting;
#if !PER_PIXEL_LIGHTING #if !PER_PIXEL_LIGHTING