Search code examples
c++11direct3dshadows

Shadow mapping- multiple sources


I'm looking at writing some code that performs shadow mapping, in DX9. The sample code that I've got only shadow maps from one light source. Is it performance viable to shadow map from more than one light source? My scene is VERY light to render otherwise- there's no textures, and only a few hundred or few thousand vertices.

The trouble is that my scene takes place in space, close to the Sun. I was going to create the Sun as a sphere, and render each vertex as a light source- this was also going to produce some good effects for various sci-fi space-ship effects. But reading through the code, I'm very concerned that this is going to destroy my performance, and I'm not entirely sure that it's going to produce the incredible lighting effects that I'm looking for. Am I just overkilling here?


Solution

  • TBH you ARE just overkilling. A light source from every vertex in a large sphere is waay too many. If you are after getting the soft edges on shadows then you are far better off looking into soft shadowing in general.

    To give you an example Half-life 2 achieved soft shadowing by rendering the shadow maps into a seperate render buffer (while using the Z-Buffer from the main render buffer). Then blurring that buffer and apply it back on to the main render buffer. The result is pretty nice looking shadows ...