GL_LIGHT1

Started by
7 comments, last by shalrath 20 years, 5 months ago
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.
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
Such as?
Per-Pixel Lighting with GL_ARB_fragment_program for example
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.
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?
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]
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).
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.

This topic is closed to new replies.

Advertisement