I cannot figure out how to get similar results with OpenGL ES 2.0 in OpenGL ES 1.1. I want to use Sampler2D (to mix my texture with Alpha Channel with Framebuffer) and also set the color. The texture should be painted in color - for example, in OpenGL ES 1.1, my FragmentShader looks like this:
varying lowp vec4 colorVarying; varying mediump vec2 texcoordVarying; uniform sampler2D texture; void main(){ gl_FragColor = texture2D(texture, texcoordVarying) + colorVarying; }
But the "+ colorVarying" part destroys my alpha channel in black (because I also add colorVarying if AlphaValue is 0) and creates a weird gradient effect ... How is the texture and color channel combined in the pipeline of a fixed function? My replacement for glColor4f:
void gl2Color4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a){ const GLfloat pointer[] = {r, g, b, a}; glVertexAttribPointer(ATTRIB_COLOR, 2, GL_FLOAT, 0, 0, pointer); glEnableVertexAttribArray(ATTRIB_COLOR); }
And I use glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); if it is so important ...
For colors 1.0, 0.0, 1.0, 1.0 here I get the following: 
And I want to get:

Some ideas for this? Any help would be appreciated.
Constantin
source share