Jump to content
  • Advertisement


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


OpenGL Light moving in OpenGL

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

Ive been working on a primitive openGL 3d engine. The I implemented it, the light position is set in the initGL() function. Every loop in the DrawScene() function, the modeling matrix is obviously translated/rotated and then drawn again on the screen. My performance DIES when i redeclare the light position in the DrawScene() function every time it is invoked. If i comment out my reasertion of the light position, the engine FLIES but the lighting is obviously screwed up because the light stays constant relative to the players position, not the level. (i.e. the light is always the the front left of the player instead of in a constant position in the level). Is there any way to avoid the performance reduction? Thanks -Drew

Share this post

Link to post
Share on other sites
I can''t see a reason why performance would die when you moved a light around... Does it go down to 1 frame every few seconds or so, because if that''s the case your driver is switching the renderer to software mode because it can''t support an operation that you are doing. But if it just slows down a couple fps then perhaps you are using the light functions incorrectly and/or have a state set incorrectly.

I can''t get too much more specific without further info on your problem (code, description) though..


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!