[font=arial, verdana, tahoma, sans-serif][size=2]The issue is that my objects are getting transformed correctly however the lighting is not. EG... I have a sphere rolling on some terrain, as it rolls the triangles/textures transform correctly, however the lighting does not, and the lit side of the sphere rolls with the sphere. I am posting my vert shader which is pretty straight forward...
As you can see, the modelview_matrix is used for the gl_Position variable and is working quite nicely...
The normal_matrix uniform is just
- Take the top left 3x3 of the modelview matrix
- Then calculate the Inverse Transpose of that.
That's it.
I've also tried sending just the modelview_matrix in for lighting as well, even though the normal scaling problem would exist, at least it might rotate properly?
Anyway, this is the last little issue with this new lighting model in which I've replaced opengls matrices.
I'm hoping it's quickly solvable, thanks in advance!
CODE BAM!
[font=arial, verdana, tahoma, sans-serif][size=2]sorry for posting so much, I should have just kept hammering on the code... once I really broke down and did a bunch of math I figured out what I needed to do...
here's the code for reference if anyone's interested:[/font]