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…
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?
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
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.
Has someone a link to sth about using lightmaps?
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)
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.
Or you can use dynamic lightmaps only for some light sources, like a player carrying a torch or something…
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.