The orange book says you can create a vertex shader, w/o a fragment shader, and that OpenGL will provide a default shader for the unimplemented part. That seems to work, however, what they don’t say is how do you handle variable passing between shaders in this case?
For example, if I use the trivial vertex shader code shown below, I see my geometry as I expect, but it’s all black. I’ve got colors and texture coordinates assigned to the vertices and the state is configured correctly to apply a texture. I assumed the default fragment shader would provide my texture and just give me flat shading, but that appears not to be the case. Is there “gl_Position” like built-in variables that I need to set to pass the colors and texture coordinates to the fragment shader or is it supposed to just pick up the input parameters automatically? Is there anything I can do to get the flat shading and texturing I desire short of implementing the fragment shader?
in vec4 position;
gl_Position = gl_ModelViewProjectionMatrix * position;