Can somebody explain to me or point me to a resource on using a basic stencil buffer on a render target in XNA 4? I'm finding a lot of XNA 3 resources and I know that it's changed in XNA 4, and a lot of articles on XNA4 that are overkill and confusing.
I want a rendertarget with a stencil buffer, which is drawn to during initialization. Then at draw time I want to pass the render target to the pixel shader, selecting pixels from the passed render target to render to the current render target, but discarding pixels based on the original render target's stencil buffer.
I THINK, correct me if I'm wrong:
The graphics device has a stencil buffer which is zeroed out when you set the rendertarget.
I have to enable the stencil buffer.
I can set the game state to compare the graphics device stencil buffer and the render target stencil buffer at draw time.
BUT, how do I set the values in the render target stencil buffer?
Also I'm using Multiple Render Targets, if this makes any difference.
I know this is probably simple stuff but I'm not finding any resource that gives a simple explanation of What It Is and How To Use It.
Edited by danromeo, 26 August 2014 - 02:34 PM.