September 2018
Intermediate to advanced
472 pages
15h 36m
English
You may have noticed that the Color variable is used to send data from the vertex shader to the fragment shader. There is an output variable (out vec3) in the vertex shader and an input variable (in vec3) in the fragment shader, both with the same name. The value that the fragment shader receives is a value that is interpolated from the values of the corresponding output variable for each of the vertices (hence the blended colors in the earlier image). This interpolation is automatically done by hardware rasterizer before the execution of the fragment stage.
When linking a shader program, OpenGL makes the connections between input and output variables in the vertex and fragment shaders (among other things). ...
Read now
Unlock full access