The intent of the following fragment shader is to attach a translucent texture to each of 4 rectangles arranged in a square (see included image). Only one square properly obeys the alpha. Can some one please explain what I have missed?
I have set the following:
glEnable (GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
precision highp float;
varying lowp vec4 v_rgba;
varying mediump vec2 v_st;
uniform sampler2D myTexture_0;
void main() {
vec3 texas = texture2D(myTexture_0, v_st).rgb;
gl_FragColor = vec4(texas, 0.5);
}
Here is a picture of the bug:
Thanks,
Doug