Shadow maps

Hi

I'm looking for some information about texture shadow maps.
I've looked in goole for a sample, but i can't find one.
The ones I found, or are incomplete or too complex (because they involved other more complex concepts, like soft shadows).
The sample about Shadow Maps in the DX SDK run soooooooo slowly that it is very hard to properly study it (I think that's because it is meant for DX 10).
What I'm realy looking, is a sample code as simple as it can get. I'm not too bothered about perfection or antialising. I just want to cast a shadow of an object in the ground. Thats all.
I hope I don't need to learn about directx efect files for this.

Thanks



Answer this question

Shadow maps

  • Jirka Nouza

    It might be possible that my hardware doesn't support some feature.

    Ettinne, the sample doesn't work either. Probably there's some feature that is not supported.
    But I got the idea of that sample. It is not about texture shadow maps though.
    The sample works by projecting the mesh into a plane and then rendering the shadow mesh. I don't like that idea, because I would have to keep generating the shadow mesh everytime the object moves.

  • Khookie

    I assume by "shadow maps" you mean depth buffer shadow maps, as opposed to pre-compiled shadow maps.

    I believe both the NVIDIA SDK and the ATI SDK contain shadow map examples. If I were you, I would download the ATI SDK (because it's smaller :-) and start reading there.

    If you just want to learn about shadow maps in general, I would suggest doing it in OpenGL, where it's a first-class API citizen. Under DirectX, you have to pull some tricks to make it work, because the depth buffer is a little more "special" (mainly to support deferred and tiled renderers). Thus, I find using depth buffer maps in GL slightly easier.

    As an alternative, if you have a high-precision card, you could just render depth to a floating-point surface (R32F), and then compare against that when you render to the real framebuffer.That would be quite straightforward (assuming you have render targets and shaders already set up).


  • einaros

  • naveen.jaikumar

    Which SDK sample The ShadowMap runs at 100fps on my ATI 9800. If its running slowly on your machine I suspect its becuase this sample need pixel shader v2 and floating point textures to work. What is your hardware.

    Shadow maps are certainly not designed for use only on D3D10 - this particular sample is from the July 2004 SDK.



  • Mediorco

    For now I have my problem solved.
    I've decided to use shadow volumes instead. I have them working properly. It sure gives a nice effect.

    Thanks

  • Shadow maps