View Full Version : Lightmap Question

01-25-2002, 12:34 PM
I would like to confirm something about lightmaps. Is it just a black and white and grey texture generated for every polygon in a scene depending on the lighsources, shadows etc?? If so, wouldnt that take up ALOT of memory for that many textures, even though they are only black and white?? Also, wouldnt it take AGES to generate them?? Because in my terrain engine i generate shadows for the verteces and that takes a while, while lightmaps are ALOT more complex than just vertex colours...

01-25-2002, 12:40 PM
I use color lightmaps. If your code to calculate lighting is written well it shouldn't take to long, define long and how many polys are you talking about?

01-25-2002, 08:49 PM
most games (eg quake2/3) use coloured lightmaps
yes they can take a while to generate if your scene is big, if youve got a nice fast + tight scenegraph though (which hopefully u should have) this can decrease compile times IMENSELY

01-26-2002, 03:18 AM
Also, lightmaps don't usually have to be sampled at a very high resolution to look good, so you save some memory that way. Besides, if you're lucky a lot of your scene is either completely in shadow or completely in light and can therefore use the same parts of a lightmap.

01-26-2002, 04:35 AM
Has someone a link to sth about using lightmaps?

01-27-2002, 01:17 AM
Hi...sorry but I've no answer but questions, because I would like to use lightmaps but I think I didn't understand them very well.
Every time the scene is drawn the processor must calculate for every polygon a new lightmaps in function of the light?
(sorry for my English)

01-27-2002, 02:29 AM
No, you use lightmaps only for static light sources, and calculate the lightmap only once. You can, of course, update your lightmap dynamically, but don't expect any good performance for a somewhat detailed scene.

01-27-2002, 11:56 AM
Or you can use dynamic lightmaps only for some light sources, like a player carrying a torch or something...

01-27-2002, 09:27 PM
Somewhere I have read that it is enough to sample one lightmap texel per one "game" meter, if you understand what I mean (in closed environments, like buildings). I tried some terrain engine and there it was enough even to sample one texel per four or five meters and the results were quite cool. Even with dynamic lights. And performance hit was not that bad. Just few fps.