Hello. I'm developing a game using OpenGL, but my GLSL skinning vertex shader isn't compiling. I'm doing a mat4x3 * vec4 multiplication, but the GLSL compiler is insisting that this yields a vec4, while it actually should return a vec3. This was tested on an Intel® HD Graphics 3000 Sandy Bridge CPU-integrated GPU.The following vertex shader does not compile properly:
#version 120
uniform mat4x3 matrix;
void main(){
gl_Position = vec4(matrix * gl_Vertex, 1.0);
}
It generates this error:
ERROR: 0:4: 'constructor' : too many arguments
meaning that the multiplication results in a vec4. Forcing the result to a vec3 by writing
gl_Position = vec4(vec3(matrix * gl_Vertex).xyz, 1.0);
compiles but does not produce the correct results.
Edit: Forcing the result to a vec3 DOES produce the correct result. This proved to be a very non-intrusive workaround.
Note that the exact same shader compiles and works fine on an Intel® HD Graphics 2500 (Ivy Bridge) GPU.
Please fix this ASAP! This bug is keeping my engine from working on Sandy Bridge integrated GPUs! If it's possible to work around the issue, that'd help a lot too!