Texture Overlay

I’m trying to overlay a texture ontop of another in a fragment shader. Problem is that it becomes transparent around the “edges” of the top texture.

tColor1 = texture2D(bTexture, vec2(gl_TexCoord[0]));
tColor2 = texture2D(tTexture, vec2(gl_TexCoord[1]));
gl_FragColor = tColor1 * ( 1.0 - tColor2.a )+ tColor2 * tColor2.a;  


gl_FragColor = vec4((vec3(tColor1) * ( 1.0 - tColor2.a )+ vec3(tColor2) * tColor2.a)*gl_Color,tColor1.a);

Why do you always figure things out as soon as you post them.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.