I have an old vertex shader that used the 150 compatibility GLSL version:
#version 150 compatibility
out vertexData
{
vec3 v;
vec3 n;
} vertex;
void main()
{
vertex.v = gl_Vertex.xyz;
vertex.n = normalize(gl_NormalMatrix * gl_Normal);
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
}
However I want to use this on OSX. How can I have access to both the built in variables like gl_ModelViewProjectionMatrix
as well as syntax like out
uniforms?
If I don't use glutInitDisplayMode(GLUT_3_2_CORE_PROFILE)
then I get an old version of OpenGL that uses GLSL version 120 which uses all the old varying
syntax, and can't support Geometry shaders apparently, if I do use the 3.2 core profile, then I have to manage all the matrices all myself and frankly I can't be bothered to do a bunch of boilerplate code that didn't need to be done previously.