Blending Online

Home

Blender Games

Vertigo [Incomplete]
The Shooting Gallery
Shadowdale
Space Assault
Transcendent Christmas Demo

CG Projects

Lamp
Rod
Asgard Ship
Another Ship
James Pond
Sword of Nibelungos
Sword of Odin
Human Head

University Projects

Library Model Walkthrough
Flash Game
VRML World

Tutorials

Building a Menu
Camera Collision
Adding Music Support
Screen Effects
Static Shadows
Using Text
Walk Cycles

Resources

Additional Font Sets
Menu Builder Template
Custom Cursor Template

Links

Random Stuff

MMORPG Characters

Faking Static Shadows

Looking for a method to fake detailed shadows in your games? In this tutorial I'll outline a basic method of doing this. You'll need some basic knowledge of how to work with alpha channels in an image manipulation program (Photoshop, Paint Shop Pro, etc.).

This method is ideal for adding greater realism to environments. It works best using static objects, however it can also have limited uses with dynamic ones. So here's the method...

1. Firstly take the object you want to cast a shadow from. Align the viewpoint with the angle the shadow will be cast from. In other words the overall shape of your object on the screen will form the outline of the shadow. Set the world background to white and run the game. Take a screenshot of the object.

This is the object I will be using for this tutorial:



2. Import the image into your image manipulation program. Using various tools to select different areas of the image, convert the object itself into a solid block of grey and the background into black. This new image will be used as the alpha channel of the final image. Having the white background usually helps here as selection tools can easily detect the object's outline.

You should end up with something like this:



3. Take the original image and this time convert the object into a solid block of black, which should leave you with something like this:



4. Combine the 2 images using the grey object as the alpha channel, and you should end up with a nice semi-transparent shadow effect:



5. Save this new image in a format which maintains the alpha channel, such as PNG or TGA.

6. That's it for the photo manipulation aspect. Now we're ready to import the image into Blender.

Firstly create a new plane and elevate it slightly off the ground. Map the shadow image to this plane and set the face to Alpha. It should look something like this:



7. Now all that's left to do is properly scale and align the plane with the original object. When you're done you should have some pretty realistic looking shadows!