Archived

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

nitzan

Only EIGHT Lights ?!

Recommended Posts

I tried initializing a bunch of lights, but the compiler complains on: -> glLightfv(GL_LIGHT8, GL_AMBIENT, LightAmbientShell); scorch3d.cpp(943) : error C2065: ''GL_LIGHT8'' : undeclared identifier Any ideas ? Why is this happening ? Are there only 8 lights total (LIGHT0 to LIGHT7) in openGL ? How can I have more lights ? Nitzan ------------------------- www.geocities.com/nitzanw www.scorchedearth3d.net -------------------------

Share this post


Link to post
Share on other sites
You can only have 8 lights in OpenGL. Essentially, that''s all you need, what most games do is clip the lights that aren''t being displayed.

You could write your own lighting procedures, but that would be time consuming; I have never had any real need for more than 8 lights.

Good luck!

Share this post


Link to post
Share on other sites
8 is the minimum number of lights for an implementation, the GeForce3 has more iirc. Just add a number onto the end of GL_LIGHT0 to get to that light number, ie GL_LIGHT0+10 = light 10.

Also remember that the limit is number of lights per polygon. 8 lights per polygon is plenty.

Share this post


Link to post
Share on other sites
I''ve seen those PerPixel shader thingie for the GeForce 3. Using that will enable you to use unlimited number of lights. But that is with the cost of ::
It has to be run using GeForce3
You need to learn The Pixel Shader thingie (ASM)
It could get slow (well maybe 10 lights won''t slow up GF3 but you know the word infinity makes people tend to add more and more).

That''s all I know

Share this post


Link to post
Share on other sites
certain expensive cards are able to do 16 or even 24 lights per polygon, though as others have said this is pretty much overkill

Share this post


Link to post
Share on other sites
you shouldn''t need more or use more than 8 lights since you can use lightmapping.
you should also consider the performance hits caused by using all 8. they can really lower the performance on anything lower than a geForce3 - Radeon 8500.
I''m not guaranteeing that you can''t get good performance with lower cards and 8 lights but you have to have much more optimized code and faster routines.
i go from 4.1 to 1.5 million triangles per second when i go from 1 light to 8 ( results tested with 3DMark 2001 )
of course i only have a PII 450 and Radeon SDR but you can see the performance goes down signifigantly. a faster processor would help but you get the idea right? after all, the lighting calculations are done in the v-Card not the processor.

Share this post


Link to post
Share on other sites