lightmaps vs. vertex lighting
And for tonight.. The great battle between Mr. LightMap and Mr. Vertexlighting. Who will win? Both are strong, and have an established user base. Ladies en gentlemen, come see the battle of the century!
Ahem, back to reality. What do you guys think of the lightmap vs. vertex lighting debate?
Lightmaps allow accurate static lighting on fairly large polygons, but they eat a fairly large amount of texture space, and an extra texturing pass is nescessary.
Would it not be more efficient to just increase the amount of polygons and use vertex lighting, with today''s T&L enabled hardware? This frees texture memory and a texture stage. These can be used for other effects such as detail texturing, for example.
Anyone an opinion?
DaBit.
January 28, 2000 09:25 AM
It really depends on the type of renderer you''re building. If you''re building an indoor game, most likely you will want to use lightmaps, whereas vertex lighting is most appropriate for outdoor games.
Lightmaps allow for pre-computed shadows for static geometry. They are generally far smaller textures than the polys'' main texture (1/4 or 1/16 the size). Computing these shadows in real-time still isn''t possible in most circumstances. Also most graphics cards allow you multitexture in one pass. Another issue is that fillrates have been increasing at a faster rate, making multiple passing to render something less and less of an issue.
Sorry to cut this short, but I have to get back to work.
Lightmaps allow for pre-computed shadows for static geometry. They are generally far smaller textures than the polys'' main texture (1/4 or 1/16 the size). Computing these shadows in real-time still isn''t possible in most circumstances. Also most graphics cards allow you multitexture in one pass. Another issue is that fillrates have been increasing at a faster rate, making multiple passing to render something less and less of an issue.
Sorry to cut this short, but I have to get back to work.
I am using lightmaps now in my engine, but I wonder how much I win or lose by using (eventually static, precomputed) vertex lighting and just more polys. It is true that most accelerators can *theoretically* do multitexturing without extra cost, but in practice there is a cost assigned to multitexturing due to memory access overhead. 3dfx Voodoo2 is the only chip that can do mutitexturing truly for free.
On a TNT2, multitexturing reduces the pixel fillrate with about 30%. On the GeForce it is even more, since it''s fillrate of 480Mpix/sec is only valid when using a single texture.
And sure, there is plenty of fillrate available, but I could use that to enhance image quality even further. Already too many people are doing only texturing+lightmapping. It''s time for something new!
Eventually it boils down to the question:
Can the GeForce/Savage2k/Matrox G450/Glaze3D take the 50 times increase of polygon count with single texturing, and render as fast as a lower polygon count (but they are on average 50 times bigger) but with two textures on it.
DaBit.
On a TNT2, multitexturing reduces the pixel fillrate with about 30%. On the GeForce it is even more, since it''s fillrate of 480Mpix/sec is only valid when using a single texture.
And sure, there is plenty of fillrate available, but I could use that to enhance image quality even further. Already too many people are doing only texturing+lightmapping. It''s time for something new!
Eventually it boils down to the question:
Can the GeForce/Savage2k/Matrox G450/Glaze3D take the 50 times increase of polygon count with single texturing, and render as fast as a lower polygon count (but they are on average 50 times bigger) but with two textures on it.
DaBit.
Vertex Lighting is pretty cool.
I think the only real problem is that you''re limited to lighting effects that fit onto a poly. With a lightmap you can have say a fireball light up a circle on the floor thats smaller than the size of the floor quad (and if the quads are small enough the lighting will have a sqarish look to it). You also can''t do a hard-edged shadow with vertex lighting unless the edge falls on a poly''s edge which is unlikely. You also reach a saturation point where the brightest a texture can be is as bright as it''s originally drawn.
Still, in spite of the above limitations I''m sticking with vertex lighting for now.
I think the only real problem is that you''re limited to lighting effects that fit onto a poly. With a lightmap you can have say a fireball light up a circle on the floor thats smaller than the size of the floor quad (and if the quads are small enough the lighting will have a sqarish look to it). You also can''t do a hard-edged shadow with vertex lighting unless the edge falls on a poly''s edge which is unlikely. You also reach a saturation point where the brightest a texture can be is as bright as it''s originally drawn.
Still, in spite of the above limitations I''m sticking with vertex lighting for now.
-the logistical one-http://members.bellatlantic.net/~olsongt
You guys forget about texture cache. If you think multipass rendering is killing you, precombine all textures with their lightmaps and store them into cache surface. This will increase memory usage, but also will speed up rendering speed.
BTW: there is no need to precombine _all_ textures in a whole scene, this way you can run out of memory. Just allocate some amount of memory and use first in last out algorithm to dynamically manage only needed textures.
FlyFire/CodeX
http://codexorg.webjump.com
BTW: there is no need to precombine _all_ textures in a whole scene, this way you can run out of memory. Just allocate some amount of memory and use first in last out algorithm to dynamically manage only needed textures.
FlyFire/CodeX
http://codexorg.webjump.com
FlyFire/CodeX
http://codexorg.webjump.com
http://codexorg.webjump.com
Is it possible to combine the two? ie. vertex lighting for basic effects and overlay a simple dynamic lightmap on top? I haven''t tried it, but I''m pretty sure that D3D immediate mode will let me do so.
That''s what I do with my engine. Vertex lighting with gouraud shading is effective for diffuse lighting effects. Its not so good for specular effects though, especially if the mesh has big triangles or the material is very shiny. So I use lightmaps for my specular effects.
I did try using lightmaps for both diffuse and specular lighting. I found that most cards (TNT2, ATI Rage128 Pro and Voodoo 3...) can only blend two textures at a time. Base texture + diffuse lightmap + specular lightmap = 3. So I wasn''t able to do it in a single pass.
I did try using lightmaps for both diffuse and specular lighting. I found that most cards (TNT2, ATI Rage128 Pro and Voodoo 3...) can only blend two textures at a time. Base texture + diffuse lightmap + specular lightmap = 3. So I wasn''t able to do it in a single pass.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement