Do all alpha testing early and only once

pull/3053/head
AnyOldName3 4 years ago
parent 5e004356a2
commit 54d465e3dc

@ -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

Loading…
Cancel
Save