I’m trying to use non-square matrices in my GLSL shader but when I compile I get a syntax error.
My shader code using:
uniform mat4 my_mat;
compiles just fine.
But if I change it to:
uniform mat4x3 my_mat;
I get
ERROR: 0:5: 'mat4x3' : syntax error syntax error
I get a similar error for
uniform mat4x4 my_mat;
If I print my GL_VERSION and GL_SHADING_LANGUAGE_VERSION I get:
GL_VERSION: 2.1 NVIDIA-1.6.36
GL_SHADING_LANGUAGE_VERSION: 1.20
I’m compiling and running my OpenGL on a Mac OS X 10.6 MacBook Pro. According to this NVidia document and others, GLSL 1.20 and GL 2.1 should encompass support of non-square matrices and this syntax. Is there another catch? Or another way to troubleshoot why I get syntax errors?
If I place
At the top of my shader code, the problem goes away. According to the same document listed in the question shader source without the version compiler option will compile “as before” which I guess means that they won’t.