Skip to main content
gamedev.net
🔒 Locked

Really simple lighting question

Started by Halo Vortex 1 reply 250+ views
Original Post
Halo Vortex
Halo Vortex
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.
_walrus
_walrus
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.
Halo Vortex
Halo Vortex
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?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.