I'm trying to layer one texture over another, but I'm having alpha blending issues around the edges. I've tried many blending combinations with no luck. Where am I going wrong?
Current state of framebuffer (opaque):
Transparent texture rendered in off-screen framebuffer:
Result when I try to blend the two. Notice the edges on the circle:
Here's the blendFunc:
_gl.blendFuncSeparate( _gl.SRC_ALPHA, _gl.ONE_MINUS_SRC_ALPHA, _gl.ONE, _gl.ONE_MINUS_SRC_ALPHA );
Here's the shader. Just basic rendering of a texture:
uniform sampler2D texture;
varying vec2 vUv;
void main() {
vec4 tColor = texture2D(texture, vUv);
gl_FragColor = tColor;
}