Jump to content
  • Advertisement

Archived

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

shalrath

GL_LIGHT1

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

Just wondering if it''s possible to set up more than just GL_LIGHT0-7 in OpenGL, or whether you have to make your own lighting system after that... I know it''s probably a really simple answer... but hey, I''m a simple person. Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
render your scene with these 8 lights, then make a new pass with the next 8 lights and additive blend it

however normally you don''t need 8 lights, or there are better solutions then using opengl lights

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Per-Pixel Lighting with GL_ARB_fragment_program for example

Share this post


Link to post
Share on other sites
Or lightmaps, for static lighting.

There really aren''t many cases when you need more than a few dynamic lights. 8 should be more than enough for any practical application. If not, you can do what guts suggested, and make multiple passes. Keep in mind, though, that every additional light is going to cut performance.

Share this post


Link to post
Share on other sites
Oh ok, I wasn''t aware that they were for dynamic lighting, can anyone suggest any resources for learning how to do lighting and the likes?

Share this post


Link to post
Share on other sites
How much of a performance hit is having a second light enabled? I know this depends on the hardware, but let's say for an old card (like TNT2). Anyone know? I'm thinking about doing something with 2 lights and I'm just curious. If no one knows, I'll just try it out sometime and see. Thanks.

[edited by - Mr Grinch on November 18, 2003 8:27:16 PM]

Share this post


Link to post
Share on other sites
quote:
Original post by Mr Grinch
How much of a performance hit is having a second light enabled? I know this depends on the hardware, but let''s say for an old card (like TNT2). Anyone know? I''m thinking about doing something with 2 lights and I''m just curious. If no one knows, I''ll just try it out sometime and see. Thanks.

[edited by - Mr Grinch on November 18, 2003 8:27:16 PM]


I think you''re going to have to try it and find out for yourself.

Yes, there is a hardware limitation of 8 lights in opengl as well as directx (like I said, it''s a hardware, not software limitation). The lights are mostly for dynamic lighting, most people calculate the static lights into a light map (and/or color map) on the static objects while loading the scene (or while making the scene).

Share this post


Link to post
Share on other sites
a small correction, opengl does NOT have a limit of 8 lights.. or well i have, but thats the lower limit. You are welcome to make drivers/cards that have more lights, and just report that via the glGetInteger(GL_MAX_LIGHTS); 3dlabs have 16 lights in most of their cards.

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!