I have pass-through vertex and fragment shaders.
vertex shader
void main(void)
{
gl_TexCoord[0] = gl_MultiTexCoord0;
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
}
fragment shader
void main(void)
{
gl_FragColor = gl_Color;
}
Those produce empty rendering (black not background color like glClearBuffer does).
If I modify the vertex shader to set the gl_FrontColor to gl_Color it does render untouched OpenGl buffer ... with is the expected behavior of pass-through shaders.
void main(void)
{
gl_FrontColor = gl_Color; //Added line
gl_TexCoord[0] = gl_MultiTexCoord0;
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
}
I am confused, how settings the gl_FrontColor in the vertex shader can change the value of the gl_Color in the fragment one ? What I am missing ?