Creating shadows in WPF & Silverlight games
Friday, June 18th, 2010In this short post I will show example of creating shadows for isometric games, like one shown on the picture below:

For this purpose you need an image with transparent background. Then a copy of the image should be:
1) Flipped - Scale transform (y = -1)
<ScaleTransform ScaleY=”-1″ />
2) Skewed - To simulate position of light
<SkewTransform AngleX=”20″ />
3) Blurred
<BlurEffect></BlurEffect>
4) Opacity Mask applied to make shadow more realistic
<LinearGradientBrush StartPoint=”0.5,1″ EndPoint=”0.5,0″ >
<LinearGradientBrush.GradientStops><GradientStop Offset=”0″ Color=”Black”/>
<GradientStop Offset=”1″ Color=”Transparent”/>
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
5) Source image transformed to Black and White:
<FormatConvertedBitmap Source=”..”
DestinationFormat=”BlackWhite” />
As a result you will get something like this:

Links:
Download Source
Code Project Article on the same topic