Jump to content
  • Advertisement


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


How to find the closest light?

This topic is 5390 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

if I''m going to render an object with lights on.. how do I find the closest lights? should I have them inside my SceneGraph nodes along with the objects? my SceneGraph tree isn''t finished yet.. only on some kind of planning stage at the moment. I just want to know if it is a good idea to store the lights inside the nodes of the tree where they fit and then when I need some lights for a mesh then I call some GetNearestLights(...) with a parameter of a center point of my mesh or something else that could define what the light should be close to. or should I just have all my lights in a std::list or some other linked list and then just loop through that list and get a pointer to all lights that are close to my mesh. and then how do I define close/near? should I have some kind of sphere around the light that defines how far from it it should infect an object?

Share this post

Link to post
Share on other sites
Compute Light contribution (see OpenGL Red or Blue book, or the net to find the equations) at the ''central'' point of your Mesh/Object (most probably the center of your bounding volume, should it have a center, or put light into object space and use 0,0,0).

Sort by decreasing contribution.

-* So many things to do, so little time to spend. *-

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!