Reputation: 21
Because ETC textures not supporting alpha channel, I tried to blend two ETC texture. Anybody of you know how to translate this into open gl es 1.x
varying mediump vec2 uv0;
uniform sampler2D texture;
uniform sampler2D texture_alpha;
void main()
{
vec4 color = texture2D(texture, uv0);
vec4 color_a = texture2D(texture_alpha, uv0);
vec4 final_color = vec4(color.rgb, color_a.r);
gl_FragColor = final_color;
}
this is fragment shader in opengles 2.0. since Open GL ES 1.x not support shader. i realy need your support here.
Upvotes: 0
Views: 1223
Reputation: 2832
You can do this by rendering the first texture without blending, then enable blending and render the second texture over the first one. This will require two calls to glDrawArrays() with this between them to enable blending:
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnableClientState(GL_COLOR_ARRAY);
glColorPointer()
Upvotes: 0