1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 06:23:53 +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
gl_FragData[0] = texture2D(diffuseMap, adjustedDiffuseUV);
alphaTest();
#else
gl_FragData[0] = vec4(1.0);
#endif
vec4 diffuseColor = getDiffuseColor();
gl_FragData[0].a *= diffuseColor.a;
alphaTest();
#if @detailMap
gl_FragData[0].xyz *= texture2D(detailMap, detailMapUV).xyz * 2.0;
#endif
@ -152,10 +155,6 @@ void main()
#endif
vec4 diffuseColor = getDiffuseColor();
gl_FragData[0].a *= diffuseColor.a;
alphaTest();
float shadowing = unshadowedLightRatio(linearDepth);
vec3 lighting;
#if !PER_PIXEL_LIGHTING