Try these questions to test your knowledge from this chapter:
- Which steps of the OpenGL render pipeline are user-definable? Which steps must be defined in order to render anything? You may need to reference the documentation at https://www.khronos.org/opengl/wiki/Rendering_Pipeline_Overview.
- You're writing a shader for an OpenGL 2.1 program. Does the following look correct?
#version 2.1
attribute highp vec4 vertex;
void main (void)
{
gl_Position = vertex;
}
- Is the following a vertex or fragment shader? How can you tell?
attribute highp vec4 value1;
varying highp vec3 x[4];
void main(void)
{
x[0] = vec3(sin(value1[0] * .4));
x[1] = vec3(cos(value1[1]));
gl_Position = value1;
x[2] = vec3(10 * x[0])
}
- Given the following vertex shader, what code do you need to write to assign simple values to the two variables?
attribute...