PDA

View Full Version : Texture Overlay



Lehm
05-28-2005, 03:53 PM
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;

Lehm
05-28-2005, 04:03 PM
Nevermind

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.