Is there a way around the limit of 7 (or 8) light sources in OpenGL? Using Windows…
Thx
Drag0n
Is there a way around the limit of 7 (or 8) light sources in OpenGL? Using Windows…
Thx
Drag0n
Get an implementation that supports more than 8 lights. If you can’t find one, then download MESA, chanage the source and recompile.
… or, do the lighting calculations yourself.
my GL.h says this.
#define GL_MAX_LIGHTS 0x0D31
Does this mean allowed lights in system is
3377?
No, that is simply the value of the token GL_MAX_LIGHTS. You pass that to glGet to get the maximum number of lights.
Cross-posting eh? Hehe, I just responded to the same question on Gamedev.net… http://www.gamedev.net/community/forums/topic.asp?topic_id=62752
Originally posted by ShiningKnight:
Cross-posting eh? Hehe, I just responded to the same question on Gamedev.net… http://www.gamedev.net/community/forums/topic.asp?topic_id=62752
That might be because I asked the same questiong twice…
Thx anyway…
Drag0n
You could probably blag it by drawing the scene a few times and using blending :
Disable your eight lights
Enable blending
Enable another 8 lights
Redraw.
Disable blending
swap buffers
Lighting is an additive process…
alternatively look towards using light mapping …
You very seldom need more than 5-6 lights lighting a single surface => it pretty quikly gets totally white.
Try using some per-object based dynamic ligtht source enabling/disabling, based on:
A) distance to the light source
B) light source position relative to the object and the viewer (if it’s “behind” the object from a certain viewpoint, its effect will never be seen by the viewer)
This way you will not only solve your problem, but you will most likely gain speed aswell.
/Marcus