Thanks alot guys.
I have some more questions:
7) How do I define where the pixelshader output gets written? For example if I want to render a depthmap from a lightsource position, I don't want the output to be written to the backbuffer(and appear onscreen) but rather be written to some bitmap/texture. I think this is called a render target, how do I set it?
8) I often see people complain about limitations of the 3dgs shader system, but it's not exactly clear what these are. I've heard people say you can't access a depthmap and that there are only 2 render targets. What exactly are the implications of this and what other limitations are there? This is especialy important information for converting shaders I find on the net or in books.