more than 8 lights

Can I “reuse” the lights in some way to support more than 8 opengl lights per frame?

Cheers,
-Lev

No, you can’t have more than 8 lights simultaneously.

Are you checking if 8 lights really is the max, some implementations have more.

yep, you can “reuse” them… for example find out for every mesh while rendering wich 8 are the nearest ones and just set those 8 up for it, but simultaneously, you can just use 8 ( or vertex_program… )

I think it is possible to use more than 8 lights simultaneously using multiple passes.
something like

[b]
for all lights{
render only diffuse and ambient
}
modulate with decal
blendFunc add

for all lights{
render only specular
}

[/b]
I have never tried it, but think this should work.

I may be wrong, but it must be possible to render as much lights as needed using multipass and additive blending …

Lev, I recommend you to look for a white paper called: “Virtualized OpenGL Lights sources for blah blah blah”, from Mark Kilgard. It explains a very good way to have ‘infinite’ num of lights.

Originally posted by Don’t Disturb:
More than 16 passes? That’s an amusing idea.
If you need more than 8 lights simultaneously it would be better to implement lighting yourself in software.

hm… you can use up to 8 lights in one pass… means if you have 16passes, you would have 128 lights… much

Haven’t looked into it myself, but this link gives some info and some source code:
http://reality.sgi.com/mjk/tips/VirtualizedLights/VirtualizedLights.html

Whoops, forgot that you do many lights in each pass :stuck_out_tongue:

Still, more than 4 passes (2 or more for ambient/diffuse, 2 or more for specular) is too much for most applications, so software lighting might be faster.

[This message has been edited by Don’t Disturb (edited 06-14-2001).]