If someone could give a brief translation, if needed:

I have had little luck with doing that in a pixelshader v1.1. However, I could give you code to do it in the fixed-function pipe.
The code has multi-pass, using 3 textures, 2 blending maps, and 1 shadowmap.

Here's a bad example: