I would like to know how to change only one color channel and keep the 2 others color channels to their initial values.
#version 410
layout(location = 0) out vec3 color_out;
precision highp float;
void main()
{
float z = 0.3f;
color_out = vec3(z, my actual value , my actual value)
}
How can I retrieve the actual value or change only one channel (the red one)?
I tried this code for drawing
glColorMask(true,true ,true, true);
glDrawArrays(GL_TRIANGLES, 0, totalconnectedtriangles_);
glColorMask(true,false,false,false);
This solution works but create really strange artifacts when I move the window. Does the fragment shader take place right after glDrawArrays (after my second color mask) or during glDrawArrays ?