Archived

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

shalrath

GL_LIGHT1

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