A lightmap is a lighting information that is baked right into the textures. Since lightmaps are pre-computed, they are very useful in freeing up resources that would otherwise be spent computing lighting at runtime. To set up a lightmap, we simply add a static light source such as the default one included with ShiVa. Make sure that the direction of the light is the same as the dynamic lights that you will be using—you don't want static shadows going one way and dynamic shadows going in the other direction. In our case, the tunnel was too big to generate a lightmap. It threw an error, but we can create the individual obstacles. The following screenshot shows one of the obstacles before (left-hand side of the screenshot) and after (right-hand side of the screenshot) the lighting effects are added:
You can see that the image on the right has more detail brought out by the light. It is definitely worth the effort, especially in games where all of the static assets can be baked in this way. The following steps will show you how it's done:
The process can take quite a while, especially if you set the quality to higher levels. The Reset button is handy for removing the lightmap and starting over again.
Lightmap quality
It's worth mentioning that it is very helpful to keep the lightmap quality low during development so that you can make changes as needed and recompute the lighting quickly. Once you have things looking the way you want, crank the quality up so that you have high quality in the final game.
18.191.205.99