I wrote this simple fragment shader to test the "return" command:
void main (void)
{
gl_FragColor = vec4 (1.0,0,0,0);
return;
gl_FragColor = vec4 (0,0,1.0,0);
}
However it seems not to return, since the final color I get is blue (0,0,1) and not red (1,0,0). What is the problem ?
Second question: how to "link" multiple fragment shaders, so that when the first fragment shader return, a second fragment shader do his job, based on results from the first fragment shader ?



