After finishing the new Ring-Menu this weekend I continued working at other stuff.
One of those things I like to share. I extended the HLSL Terrain Shader with the ability to use the alpha-channel of the mask-texture as shadowmap.
Then I wrote a raytrace-function that analyzes the whole level to create the needed shadowmap.
Edit:
I'm still working on it.
To get the overall darkness of 1 m² I use 8 traces now, 4 to get the terrain heigt at 4 places in a square within the 1 m² and another 4 traces to see how many actually hit the ground.
Thus there can be 100% lit, 75% lit, 50% lit, 25% lit and 0% lit for each alpha(shadow) pixel.
This applys to shadows cast by the terrain itself, too.
Rendering the shadowmap for a 250x250 meters Level takes more than 3 minutes...

This is the result:


