GLSL - Using custom output attribute instead of gl_Position
I am currently learning OpenGL with shaders (3.3). There is one thing i can't seem to work out though. I have read that using built-in variables like gl_Position and gl_FragCoords is deprecated in OpenGL 3+, therefore I wanted to use my own output variable. So instead of this: #version 330\n layout(location=0) in vec2 i_position; out vec4 o_position; void main() { gl_Position = vec4(i_position, 0.0, 1.0); }; I wrote this: #version 330\n layout(location=0) in vec2 i_position; out vec4 o_position; void main() { o_position = vec4(i_position, 0.0, 1.0); }; The shaders compile without problems in