|
|
|
| Home Blender Games CG Projects University Projects Tutorials Resources Links Random Stuff |
Faking Static ShadowsLooking 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.
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.
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.
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!
|