Original Post
Ok, I''m in need of some desperate shader help, using Cg, OpenGL and Visual Studio 2002, my Rendering Path looks something like this:
..............................................................
gluLookAt(...);
Cg(Set_CameraView_Matrix);
Cg(Set_CameraView_Inverse);
Cg(Set_CameraView_Inverse_Transpose);
glLightfv(light_pos);
Cg(Set_Light_Pos);
glPushMatrix();
Rotate_Translate_Model();
Cg(Set_ModelView_Projection_Matrix);
Cg(Set_ModelView_Matrix);
Cg(Set_ModelView_Inverse);
Cg(Set_ModelView_Inverse_Tranpose);
DrawGeometry();
glPopMatrix();
..............................................................
1) What would a Cg (or not Cg) vertex shader look like, that would correctly render the above render path?
2) What does the Inverse_Transpose do? In Cg I obtain some acurate results using Inverse, but Inverse_Transpose allways messes up the results. I know that the Inverse grabs the matrix and produces an inverse of it, and that the Transpose is suposed to be the inverse of a rotation matrix, right? When would we want to use both in the same context?
3) In the above render path, when i rotate/translate my model, im actually adding another matrix to the matrix stack, right? and in that matrix stack already lies the camera transformation, created by gluLookAt, right? So gluLooAt just grabs the parameters I pass it and constructs another matrix, which gets "pushed" onto the matrix stack, right?
4) Does Vertex data arrive at the vertex shader already transformed by the active matrix stack? In other words, when DrawGeometry() gets called, and the vertex arrives at the shader, does it arrive as (Vertex * MatrixStack) or does it arrive exactly as was defined in the DrawGeometry call?
I''ve been stuck on this for quite some time now... i know i''ve got something "on backwards", but i cant put my finger on it...
Any and all help would be greatly apreciated

[Hugo Ferreira][Positronic Dreams][Colibri 3D Engine][Entropy HL2 MOD][My DevDiary]
[Yann L.][Enginuity] [Penny Arcade] [MSDN][VS RoadMap][Humus][BSPs][UGP][NeHe]
"our stupidity allways comes back to bite us in the ass... in a white-shark sort of way..." - Prozak

[Hugo Ferreira][Positronic Dreams][Colibri 3D Engine][Entropy HL2 MOD][My DevDiary]
[Yann L.][Enginuity] [Penny Arcade] [MSDN][VS RoadMap][Humus][BSPs][UGP][NeHe]
"our stupidity allways comes back to bite us in the ass... in a white-shark sort of way..." - Prozak