Eight GL_LIGHT limit

Started by
34 comments, last by Spongemop 20 years, 9 months ago
God, how many times does this have to be said...

The 8 light limit is PER-PRIMITIVE . This means, you can make it per triangle, model, world, whatever. Also, this is per-pass. The 10 guys in a room thing you were going on about could easily be achieved, as the guys flash from across the room wouldn''t affect a guy from the other side. Get it? For each of the guys you''d render, you''d enable the 8 lights closest to it, render, etc, and do this for all the models.

Death of one is a tragedy, death of a million is just a statistic.
If at first you don't succeed, redefine success.
Advertisement
Oh, and yeah, as WildFire sort of said, it could just be a projective texture ( aka ''Dynamic Lightmap'' ).

Death of one is a tragedy, death of a million is just a statistic.
If at first you don't succeed, redefine success.
quote:
The 10 guys in a room thing you were going on about could easily be achieved, as the guys flash from across the room wouldn''t affect a guy from the other side. Get it?


Yes, I get it. My approach was to avoid having more then eight lights to begin with. Or to avoid gl-lights entirely by using dynamic lightmaps (which should be faster?).

I just remembered there''s a very good demo by Mark J. Kilgard about this topic. Go to this page and look up the multilight demo. The comments in the sourcecode should tell you what it''s about. Basically he''s enabling those lights that have the most influence on the primitive being rendered (which must not be the closest lights, if you take diffuse light contribution into account).

Back to the original question:
quote:
Seems a little low. Aside from, say, doing soft lighting using glColor and distance calculations, is there some way to get more lights in the scene?

So far you have dynamic lightmaping, distance calculations, Kilgard''s "Lambertian-based"-approach, multi-pass rendering and custom lights with programable shaders (Am I forgetting anything?).
How do I set my laser printer on stun?
I used more that 8 lights with vertex program and register combiners on GeForce cards. The more complex the slower. but for simple lighting effects, the speed will be high.
for ATI, use vertex program and Fragment Progam.

Bobby
Game Core
Personally Id set everything up to use per-pixel lights. If you stick with vertex-lighting, you need to have your geometry/models fairly well tesselated, else you get rather large lighting issues. Per-pixel lighting is fairly easy to setup, and doesnt suffer from the same visual anomolies as vertex-lighting does, though this does come at the cost of your fillrate. It does look a LOT nicer though.

-----------------------
"When I have a problem on an Nvidia, I assume that it is my fault. With anyone else''s drivers, I assume it is their fault" - John Carmack
-----------------------"When I have a problem on an Nvidia, I assume that it is my fault. With anyone else's drivers, I assume it is their fault" - John Carmack
That is probably what they did in zelda (on the cube) now that I think of it. Though im too much of a newbie to do that yet

This topic is closed to new replies.

Advertisement