1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#version 410 core layout(location = 0) in vec3 inPosition; uniform Camera { mat4 view; mat4 proj; vec4 viewPos; } cam; out vec4 Color; void main() { gl_Position = cam.proj * cam.view * vec4(inPosition, 1.0); Color = vec4(inPosition.y / 126.0); }