
Shadow maps are a dead easy way to add lots of depth and interest to your scenes with the minimum of effort. They help to create the illusion of complexity that is often missing from textured surfaces.
In this tutorial we're going to demonstrate just how simple shadow maps are to use - by the end of it, you should have a useful tool in your palette to use to add life to your scenes.
What you need
- 3d graphics program - this have been done in 3d Studio Max, but pretty much anything will do
- 1 surfaced texture -we've used a cobbled texture with bump, specular and displacement maps from the Medieval textures DVD.
- 1 shadow map - again here we've used a shadow map from the same DVD.
The set up
It's a super-simple setup, just a flat plane for the ground surface and a directional light (set to cast ray-traced shadows).
Once you've done this you should have a scene similar to below.

Now this looks nice as a texture, but I think you'll agree that it looks a little lifeless?
Adding the shadow map

In real life, light rarely just hits the ground evenly over large areas, instead there are trees, pylons, clouds, buildings etc etc that cast a multitude of shadows. Now, there's nothing stopping you modelling all these objects and your scene will look great, however that's a fairly time consuming process for objects that won't even be visible, and it's also going to grind your renderer to a halt!
So this is where shadow maps come in - they are a grayscale map used to simulate the shadows cast by complex objects.
So between the ground plance and the light source, should put another plane, this will hold your shadow map.
The shadow map will be a grayscaled image where the black areas will be treated as transparent and the white areas as opaque.
In short, if the light hits a white area it's stopped, if it hits a black area it's allowed through.

Now in your material editor create a material and place a shadow map in the opacity slot.
Then apply to the shadow plane and we're done.
Final render
If you now hit render, you should see a much more realistic scene rendered - the shadow map is being used to cast shadows across the surface creating a much more realistic impression.
