[drape] render loop builded that way to avoid discard of pixels

This commit is contained in:
ExMix 2015-06-19 15:49:55 +03:00 committed by r.kuznetsov
parent 90094244ed
commit 06ba3c8c3e
2 changed files with 1 additions and 8 deletions

View file

@ -7,11 +7,7 @@ uniform float u_opacity;
void main(void)
{
float mask = texture2D(u_maskTex, v_maskTexCoord).a;
if (mask < 0.1)
discard;
vec4 color = texture2D(u_colorTex, v_colorTexCoord);
color.a *= u_opacity;
color.a *= (u_opacity * texture2D(u_maskTex, v_maskTexCoord).a);
gl_FragColor = color;
}

View file

@ -6,9 +6,6 @@ varying vec2 v_colorTexCoords;
void main(void)
{
vec4 finalColor = texture2D(u_colorTex, v_colorTexCoords);
if (finalColor.a < 0.1)
discard;
finalColor.a *= u_opacity;
gl_FragColor = finalColor;
}