Illuminated sprites

Feb 27, 2015 at 9:22 AM
Edited Feb 27, 2015 at 9:23 AM
I wonder if anyone's been working on an illuminated sprite shader?

You know the type, the ones that use normal maps/bump maps to add shape to dynamic lighting on them?

For example:

The D3DX9 sprite object was always closed off, so no-one could implement a shader, then I heard that XNA supported "Effects"... which could be used to implement lighting. Though I never found any demos of that.

I've never wrote a shader before, but I'd LOVE to get lighting on my sprites...

Here's a demo of a sprite handling program I wrote (SlimDX sprites):

Here's the source for you:

Imagine that with working Christmas lights!

If anyone can offer any advice, please let me know!
Pixel shaders look very hard.
Mar 2, 2015 at 6:09 PM
Hi Sarah for a third time ;)

taking the SDX SpriteRenderer as a basis, implementing sprite bump mapping ist quite easy. You just need to replace the pixel shader (and pass along a second texture). However, the API does not support such special modifications, so you would have to modify the code yourself.
I am not sure if your scene would benefit from lit sprites at all. The textures already contain pre-computed lighting and most surfaces are quite fuzzy. Simulating a realistic lighting with simple bump mapping on those should be quite hard.