View Full Version : Matrices in arb program vs. glsl

10-08-2006, 09:33 PM
Although ogl says that it uses column major matrices in both, How come the instructions generated/required for ftransform() are different in glsl and arb assembly language?

specifically, gl_ModelViewMatrix*gl_Vertex would be a mul followed by 3 mads, where as in arb it would be 4 dp4s (as shown below)

ATTRIB iPos = vertex.position;
PARAM mvp[4] = { state.matrix.mvp };
OUTPUT oPos = result.position;

DP4 oPos.x, mvp[0], iPos;
DP4 oPos.y, mvp[1], iPos;
DP4 oPos.z, mvp[2], iPos;
DP4 oPos.w, mvp[3], iPos;

What's going on? I'm totally confused!

10-08-2006, 10:34 PM
The ftransform probably for some reason uses matrix stored in transposed form.