Elurahu

Hi guys.

This is kinda a newbie question that I hope someone can nail for me.

What exactly is the purpose of the DepthStencilBuffer. I'm using it to render a shadowmap into a rendertarget, but I need to know exactly why it's needed. The code doesn't seam to use it.

Another thing I would love to know is why I'm not able to save the content of a rendertarget2D with Single format to a file.

Regards



Re: XNA Framework DepthStencilBuffer question

Derek Nedelman

The depth part of the buffer contain the depth value of each pixel and is used to produce a reasonably correct depth ordering of the scene so that nearer pixels (and their corresponding objects) obscure further ones. The stencil part of the buffer is typically used to prevent parts of the buffer from being drawn into.