View Full Version : Should I dismiss "Opengl" Lighting all togeather?

01-22-2003, 04:33 AM
I was wondering, Do games like Quake 3, or whatever, even use "Opengl" lighting for anything? Or is is ALL per pixel, and light maps? I think the only thing "Opengl" style lighting would be good for in games like that would be gamma background light intesitiy? Am i right? Or am i mistaken??

01-22-2003, 04:42 AM
Standard GL lighting is fine for diffuse - it's specular where it falls down, that's when sphere/cubemaps become useful.

01-22-2003, 04:57 AM
use lightmaps for any objects that are static, dont't move, and where the light-position doesn't change -> should be faster
use opengl lighting for actors

01-22-2003, 05:25 AM
gl lighting is fine for high tesselated geometry, so quite good for actors like humans, robots, what ever.. it does fail to illuminate big triangles => unuseable for indoor rooms (big walls built with a low amount of polygons).. there, lightmap, or some sort of perpixellighting is bether..

q3 uses gl lighting for the meshes, too

01-22-2003, 07:50 AM
Assuming you want standard diffuse lighting is it best to use opengl or do it yourself?Doing it yourself would not make use of TnL but opengl lighting can't be optimized(based on wether the source and object have moved with respect to each other for example).What course do people take usually?

01-22-2003, 08:13 AM
you do your own if you want to add some features.. like perpixellighing stuff, for example.. or you do really static stuff, like in the good old days.. (so, lightmaps there)..

else, you can normally use gl lights..

01-22-2003, 08:22 AM
>>q3 uses gl lighting for the meshes, too<<

aye? no it doesnt
quake3 simulates per vertex lighting (like gl lighting) but on the cpu + thern passes the results as glcolors

01-22-2003, 08:35 AM
I've found that on low-end hardware-transform hardware (such as the ubiquitous GeForce 2/4 MX), per-vertex lighting is pretty much free, whereas light maps (a second texture pass) has a noticeable fill rate impact.

01-22-2003, 10:04 PM
Q3 uses a light grid to get a single directional + ambient light source for every point in space. It gets this ambient + directional light for one point in an entity, and then uses it to do software lighting. This is only done for game entities that want lighting (via the "rgbGen lightingDiffuse" shader command); static entities, such as the statues you see in q3dm1, are vertex lit by the light compiler.

Incidentally, this direction vector is also the direction Q3 uses during its stencil shadow algorithm.

Also, remember that Q3 shipped only about a month after the original GeForce256 hit shelves; this didn't really give id any time or motivation to implement OpenGL lighting, since no cards on the market supported it in hardware. Actually, I think when Carmack got his hands on a GeForce was when he started work on Doom3's engine and stopped work on Q3; I seem to recall him saying that he started working on Doom3 tech before Q3 shipped.

01-23-2003, 07:28 AM
okay, i stand corrected. i just remember i've read in every docu for rendering q3 scenes: for the mesh lighting, read out of the lightgrid, bind the values there in to glLightfv(GL_LIGHT0,...), and render the mesh with that..

so i thought q3 does it as well.. but it makes sence. before hw t&l, lighting could as well be done on software..