World coordinates in a vertex program

hi, i am currently using GL_VERTEX_PROGRAM_ARB and GL_FRAGMENT_PROGRAM_ARB to implement shadow mapping, is there any way to obtain the world coordinates of a vertex without explicitly passing the model matrix into the vertex program? coz i don’t want to build a texture transformation matrix for every object in the scene. thx!!

No, that isn’t possible. OpenGL only has a Modelview matrix and you are not able to get the “model-part” out of this matrix.
So you have to pass your own matrix to you Vertex Program.

Thank you:)

You can always store the inverse of your camera transformations once, and apply that to the modelview-transformed vertices to get world-space vertices.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.