Advertisement

More than 7 lights in OpenGL ?

Started by April 01, 2002 02:14 PM
10 comments, last by stryx 22 years, 10 months ago
Somewhere I read that OpenGL has only 7 LightSources (GL_LIGHT0 - GL_LIGHT7) Is that true ? If yes, how can I ''hack'' that to use more lights and how does JohnCarmack (id software) Do this ? The Doom3 Engine uses tons of lights. How do they ''fake'' lighting ? I''m writing an gameengine (have Console/Menuscripting/BasicGL Code/DirectSound already) and I''m thinking, how to override the few lights of OpenGL. Hope anybody can help.
Anything that requires finding convex hulls in realtime isstarting to sound like a bad idea. -- John Carmack
More than 7 lights? WTF are you trying to do?
Advertisement
well q3a and other games do their own lighting with for example lightmaps or vertex lighting. if you want to use a lot of lights i suggest that you look into multitexturing and lightmaps tutorials on this can be found at this site and others so simply search for it :p the other thing that you coudl do is multipass rendering adding new lights every pass, im not sure on how to do this but I''ve seen a demo that uses this to get hardware accelerated lights since only GLLIGHT0 is hardware accelerated with cards that support tnl.

/Goozer

note: im not 100% sure about the multipass thigie so please correct me if im wrong, and the new cards might support more than one hardware accelerated light but last time i read baout it it was only GLLIGHT0.
quote:
Somewhere I read that OpenGL has only 7 LightSources (GL_LIGHT0 - GL_LIGHT7)


I count 8 there chief.
Do you need more than 8 lights per object? Just ude 8 lights that most affect object and use them.

There are more worlds than the one that you hold in your hand...
You should never let your fears become the boundaries of your dreams.
doom3 will not at all use the opengl-lights, but will do its fully own lighting with the power of todays hardware, wich can calculate quite much stuff on a per pixel basis, to realize sort of perpixellighing more or less accurate (on the radeon8500 mathematically fully correct, on nvidia near-to..)

but its hard work to get nice lighting like carmack does.. lots of math, lots of knowledge about the gpu''s, lots of help from nvidia and ati
If that's not the help you're after then you're going to have to explain the problem better than what you have. - joanusdmentia

My Page davepermen.net | My Music on Bandcamp and on Soundcloud

Advertisement
thats why Carmack is god
(along with his programming team, hehe)
Ok I browsed trough some pages and learned something about lightmapping and dynamic lightmapping.

I''ll do it that way.

Thanks anyway.

StryX
Anything that requires finding convex hulls in realtime isstarting to sound like a bad idea. -- John Carmack
This *exact* question has been asked at least 5 times in the past month. Please do a search next time.
quote:
Original post by davepermen
doom3 will not at all use the opengl-lights, but will do its fully own lighting with the power of todays hardware, wich can calculate quite much stuff on a per pixel basis, to realize sort of perpixellighing more or less accurate (on the radeon8500 mathematically fully correct, on nvidia near-to..)



Please define "mathematically fully correct"...


(no, this is definitely not a ''this hardware is better than that hardware'' post)

This topic is closed to new replies.

Advertisement