Normal Mapping pixel shader
With this pixel shader you can apply 3D-like colored lighting to your sprites that you can update in real-time (up to 3 completely separate lights)
To make the effect, you only need two versions of your image.
To make a normal map of your sprite, you first need to make a "heightmap" of your sprite. It is a greyscale image where the lightness of the pixel determines how "close" to the viewer that point is. In my example the nose of "Alyx Vance" is the closest to the viwer (us) and is therefore very light.
- Your sprite
- A normal map made from your sprite that covers your sprite
I then use a tool like either Photoshop using this plugin from Nvidia to convert the image from a heightmap to a normal map.
If you use Gimp you can use this plugin.
I'm quite sure there is some plugin for Paint.NET as well.
What do you think?