Lehm
1
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
2
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.
system
Closed
3
This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.