Really simple lighting question

Started by
1 comment, last by Halo Vortex 20 years, 11 months ago
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.
Advertisement
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.
Nope, it multiplies pos by current matrix, so if I render vertex 1 with 1 matrix and vertex(poly) 2 with another matrix, light positions will be different as well. So how do I battle this?

This topic is closed to new replies.

Advertisement