LightMaps


#1

I’ve been doing a lot of reading the last 2 days but still a bit confused on lightmaps.

If I understand right, a texture is mixed with a another texture that represents the light. If this lightmap is placed on the wall, it will eject light particles which will illuminate any character that walks infront of it?


#2

No, light maps don’t emit light. A surface’s lightmap contains only the lighting for the surface itself. When you prelight a game level with lightmaps you’re basically baking the lighting into the surfaces, into the walls. The character lighting is handled seperately, usually done using vertex lighting ( except for the next gen games coming out of course ).
Dan


#3

Hmm, then why not just use vertex lighting altogether? It seems this lightmaping is just a fancy way of burning shadows into textures.


#4

To get vertex lighting/shadowing at the same “resolution” as lightmapping would require the meshes to be tesselated to quite a high density, hence the use of lightmapping which is only as slow as applying a second texture to a surface.

It’s less of an issue now, what with graphics cards having hardware transforms, but then the emphasis moves to bus bandwith. You need to shove these vertices to the graphics chip, and you probably wouldn’t store them on the graphics card because that would take up space used for framebuffers/textures. Damn, another problem :wink:

Another advantage of lightmaps is that you can use a global illumination solution (most probably radiosity or photon mapping) to get “nicer” lighting, stuff like color bleeding between surfaces and that sort of thing. Vertex lighting is only a local solution, so the resulting color is only a function of the vertex and the light and doesn’t take into account light from other surfaces.

The whole thing is shifting again now though, using stencil shadow volumes and dot3 lighting is giving reasonably good results, although it’s back to being a local lighting solution, albeit per-pixel.

To go back to your original question, are you thinking of the lightmap calculation here? i.e. the radiosity calculation? If so, then yes you’re correct. Light bounces around between all the surfaces until a certain negligible energy level is all that’s leaving the surfaces. After that the energy at each surface is converted into an illumination level and stored in the lightmap texture. When rendering the surface (at run-time) all you need to do is lightmap*albedo colormap and you get the lit/shadowed surface.

phew, big post. HTH.


#5

So it would be fair to say, for now that vertex lighting is becoming the minority and the big shift is towards lightmaps?


#6

you could say that a few years ago perhaps ;). Vertex lighting (for static objects) hasn’t really been a big thing for a while now. Quake and Unreal really spurred on the use of lightmaps, and it was pretty much the defacto standard model of lighting in first person shooters (as well as other sorts of games) for a long time. Although it was only the static geometry (i.e. the levels) that were lightmapped. Dynamic objects were still vertex lit because it would just be too slow to calculate the lightmaps dynamically.

What’s happening now is a shift towards per-pixel lighting methods (see Doom3 and Halo2 for examples). Basically, instead of calculating light at each vertex, the lighting is calculated for each pixel of the surface being rendered. By interpolating the vertex normal across the surface, or by using a normal map, and calculating the lighting from that, you can get much finer lighting details on surfaces. Coupling this with a shadowing technique, either stencil shadow volumes or shadow depth/id maps, you get nice light+shadow all done by the graphics chip in real-time, and you only have to debug a single method of lighting for all your objects. Lovely :slight_smile:

There’s probably still room for lightmaps in a lot of situations, but higher end PC games, and some XBox games are making the move towards per-pixel lighting.

For (lots) more information on per-pixel lighting, shadowing, generally cool graphics stuff, check out the developer section of the nVidia and ATI websites. They’ve got a ton of interesting stuff. http://developer.nvidia.com and http://www.ati.com/developer/


#7

Ok thanks. Seems i’ll have to try to keep on top of things as far as lighting goes. I’ll keep much stronger interest in it from now on.


#8

Is it possible to create lightmaps in 3d studio max if I’m making a level for a game in it?
If it’s possible how do I do it?


#9

which bersion of max do you have…if you dont have v5 im not sure you can without exporting yur levels to a lightmap maker…if you have v5 then just use render to texture…and select lightmap and bake the lightmap to your mesh altho it is a slow process:annoyed: …but if you dont mind spending a couple of extra bucks (under 50) then get this program.

http://www.windssoft.com/


#10

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.