When I started on my AppWeek game, I wanted to build the game using the Reach profile as much as possible so I could more easily reuse the graphics part on Windows Phone. I was pretty close; the only piece of my game that didn’t directly convert to Windows Phone was the 3D Particles I was using. So when it came to lighting, I decided the best option was lightmaps.
Lightmaps were originally used in Quake, but they are still around as a big part of almost all commercial game engines such as Unity, Unreal, and id Tech 5. Because they are precomputed, you get all the high quality ambient occlusion, soft shadows, and a relatively infinite number of lights (capped only at how long you want to wait for the lighting to bake) and yet they are also incredibly cheap to apply being just another texture lookup and a few operations to blend with the diffuse texture.
As Shawn shows, DualTextureEffect is one of the more interesting built-in effects for XNA Game Studio 4.0. While it’s a simple concept, the ability to combine two textures easily enables lightmaps and detail textures across all platforms supported by XNA Game Studio 4.0. DualTextureEffect ended up being my silver bullet that got me the great look I wanted without having to compromise on portability to Windows Phone.
I used 3D World Studio to generate my levels and lightmaps, but many of the 3D modeling packages support baking lightmaps such as 3D Studio Max, Maya, Blender, and likely many more. Once a lightmap was generated, I could easily use DualTextureEffect across all of my platforms to add lighting to my game. See Shawn’s post for more details on how to get your content to use DualTextureEffect in the games.
Here’s a small comparison of what a level looks like without and with the lightmap turned on. You’ll see that not only does the lightmap add high quality shadows, but the lights also contribute a color to the scene which helps the world feel warmer and more real. So if you’re planning a 3D game for Windows Phone or Xbox LIVE Indie Games, make sure you consider lightmaps when thinking of ways to increase your game’s visual quality.