Original Post
Hi there,
I just read the Article about 2D soft shadows. I tried to implement such a feature into my own game. Everything went well, until I tried to use multiple lights at one object.
The problem is, that the shadow of a second lightsource will be drawn over the first light source, and removes the light intensities. Well have a look:
http://d3-genetic.de/ftp/xardias/shadow5.jpg
The right Shadow is great, the lightsource has been drawn over it and lightens the shadow (by additive blending).
But the left shadow has been drawn after the lightsource so the shadow removes the light intensity.
Orangy Tang told me, that he has a rendering pass of all visible objects, done once per light. Well i draw these two lights light like this:
- Render Lightsource 1 (this multiplies the colorbuffer with a triangle fan and vertex colors)
- Render shadow of Lightsource 1 (here the the shadow casted by the lightsource 1 is calculated.
- Render Lightsource2 (the second Lightsource is rendered, it lays over the shadow of the first, so the shadow is lightend)
- Render shadow of Lightsource2 (the shadow casted by the second light is calculated. It will be drawn OVER the first lightsource, so the second lightsource will be oppaqued)
Should I use Depth testing to place the shadows ?
But then i would have problems with the blending operations...
Greetings
Dennis ''Xardias'' Kempin
PS: Please forgive my english.