Jump to content
  • Advertisement

Archived

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

Halo Vortex

Really simple lighting question

This topic is 5525 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!