Inside the companion
The Shader Workshop
Open a native OpenGL window, draw a triangle, then move a camera around three exhibits.
Project files 8
Rotate the first triangle
The starter vertex stage transforms positions and passes vertex colors.
#version 330 core
layout(location = 0) in vec3 a_position;
layout(location = 1) in vec3 a_color;
uniform mat4 u_model;
out vec3 v_color;
void main() {
gl_Position = u_model * vec4(a_position, 1.0);
v_color = a_color;
}
This is the file included with the course. Copy and download give you its complete source.
Taking your work offline? Download all course companions
