Archived

This topic is now archived and is closed to further replies.

Halo Vortex

Really simple lighting question

Recommended Posts

I''ve been usually dealing with per-pixel lights, but you can''t afford putting them on everything with GeForce2, so here''s a simple question: How do I make OpenGL do lighting before modelview matrix multiplication, e.g. take original world space coords I provide when calculating direction vector? It really annoys me how lighting changes when camera is moved and that I can never predict where it''s going to be next second.

Share this post


Link to post
Share on other sites
I''m not sure if this is ur problem, but (from what i understand from ur post) when u use

glLightfv(id, GL_POSITION, aPosition)

to specify the position of a light, it takes that position and mutiplies it by the top of the modelview stack. So make sure that you push your camera on to the stack before you set the positions of your lights.

Share this post


Link to post
Share on other sites