Jump to content
  • Advertisement

Archived

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

Bleakcabal

8 lights

This topic is 6423 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

What''s this I hear about OGL being limited to 8 lights on a scene ? That''s seem a little low. When you run games like QIII or UT in OGL I would be surprised if the number of lights would be limited to 8. WHO DO THEY THINK THEY''RE FOOLING : YOU ?
GARAL website

Share this post


Link to post
Share on other sites
Advertisement
From what I have read I believe that OpenGL supports 8 *hardware* lights. You can add additional lights but they won''t have hardware acceleration.

Quake can uses lightmaps for its high quality lighting so it doesn''t even use OpenGL''s lighting system. You can toggle this off for higher performance. UT probably uses the same system.

Jason A.

---
I write code.
DelphiGL (http://delphigl.cfxweb.net)

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
An OpenGL implementation can support any number of lights, though it is required to support AT LEAST 8 lights. Whether they should be implemented in software or hardware is not specified (And you can''t be sure that if a partcular implementation supports hardware accelerated OpenGL lights, that all 8 lights are accelerated.... Sometimes the driver reverts to software rendering if too many lights are used simultaneously).

Pure software implementations typically support alot of lights (perhaps an `unlimited'' number)

Share this post


Link to post
Share on other sites
GeForce/Quadro supports 8 lights.
3Dlabs boards with hw T&L supports 16 lights.
Wildcat 4000-4210 (well, now it''s also 3Dlabs..) supports 24 lights.

Share this post


Link to post
Share on other sites
This is more tricky than I tough. So in other words, you can''t really know that the user will have x lights in hardware and y in software and when or if you put z number of lights they are all going to be in software instead of hardware...

I am currently rendering a scene which I get the data from a txt file which I open. I wanted to implement lighting ( of course ) for this scene. So my best options seems like using lightmaps ? Im not sure exactly what they are or how they are implemented but my guess is they must be light positions/colors and intensity located somewhere in the map file, or possibly another file. This could use OGL hardware lights, or lights which I implement myself....

Since im a beginner, what do you guys propose I should do ?

WHO DO THEY
THINK THEY''RE
FOOLING : YOU ?



GARAL website

Share this post


Link to post
Share on other sites
<>

not really a lightmap stores how much luminosity a texel of a polygon receives its got nothing to do with opengl lighting.


http://members.xoom.com/myBollux

Share this post


Link to post
Share on other sites
Hi there,

I think the original quake used alpha blended polygons
to simulate lighting in conjuction with light mapping.

you could also query the number of lights in the
opengl implimentation running on your machine using
glGetInteger(GL_MAX_LIGHTS) and prioritize your
lighting in your scene (perhaps mixing this with
light mapping for static lights and only using
opengl lighting for moving lights ie torches etc).


Hope this helps.

Mark

Share this post


Link to post
Share on other sites
You''re pretty much guaranteed to have at least eight lights on any given hardware. Also, don''t trust that further lights will be faithfully emulated in software.

This only really presents a problem if you''re not doing any scene-graph management. Otherwise, it''s not a problem at all. You can position your API lights at any point in time: so for every object (or group of objects, or sector, or leaf, etc.) you find the nearest 8 lights, declare them, and send your vertices to the API. Then with the next you find the closest 8 lights, declare them and send the next batch of vertices again.

Pseudocode:


for each object Obj in scene do begin
var lightarray as array[8] of lights
find nearest 8 lights to Obj (save in lightarray)
for 8 times N do begin
glLightfv ( ID of lightarray[N], GL_POSITION, position of ligharray[N] )
end
render Obj
end


However, like zedzeek said, using all 8 lights would probably be a bad idea. Often API lighting is brutish, and too many lights will wash out your coloring. You''ll probably want to experiment to see what the best count is, but you''ll never really need more than 8 (if so, use lightmapping or a some other technique).

Share this post


Link to post
Share on other sites
Okay so instead of rendering the current scene, then putting all present lights at their respective positions, I should render the scene, then take an object/poly/sector/ect and find the N nearest lights to this object. Than I should apply the lighting. Then I should start all over again for all of the objects on the scene by creating and declaring new lights. I can see from this method how 8 lights per object is over-zealousness. I think I was going all wrong about this, so if I have ten torches/lanterns I should all render say the 3 or 4 closest light source on the torch/lantern object, including one which should be centered on the torch/lantern objecy itself, and then maybe add some alpha-blended bitmap ( flame or corona or colored circle or whatever ) on it or particule effect or something in the like.



WHO DO THEY
THINK THEY''RE
FOOLING : YOU ?



GARAL website

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!