Original Post
Primer: My current algorithm for rendering uses glMultMatrix and pulls the matrix from the physics system and calls that with the matrix from bullet. This works when I'm using the standard pipeline and as far as I understand, I'm in model_view mode in opengl so I'm affecting the opengl modelview matrix for this level in my matrix stack (achieved via push and pop matrix). Question: I'm trying to write my shader library but before I do I was to solidify some things. If I pass in the light position in world space, then the vertex has to be in world space. So my question is, is gl_Vertex in local non transformed object space, and if so will saying gl_ModelViewMatrix * gl_Vertex tranform my vertex to world space? Which I think would mean after I do this vec4 world_vert = gl_ModelViewMatrix * gl_Vertex; vec4 light_dir = world_vert - light_pos_world_space;