Nesting Rendertargets works only partially

I am employing a nested rendertarget strategy as a way to manage clipping and group transformation in a 2D environment. I’ve found that the nesting works only 2 levels deep. I’ve unrolled my drawing loop below. I see the contents of RenderBuffer_1 and RenderBuffer_2 just fine, but RenderBuffer3 doesn’t show up at all. Any ideas what is wrong?

	// Draw Something on RenderBuffer_1
		// Draw Something  on RenderBuffer_2
			// Draw Something  on RenderBuffer_3
		// _spriteBatch.Draw RenderBuffer_3 -> RenderBuffer_2
	 // _spriteBatch.Draw RenderBuffer_2 -> RenderBuffer_1
// _spriteBatch.Draw RenderBuffer_1 -> mainbuffer

And here is how I construct my render targets:

        return new RenderTarget2D(

Have you verified that RT3 is getting what you expect if you draw it separately outside of the nesting?

Is this to do something like

Draw on RT1
    Draw RT1 on RT2
        Draw RT2 on RT3
    Draw RT3 back onto RT2
Draw RT2 back onto RT1

That would be the only reason I can see to try to preserve contents with that draw sequence. If “draw something on RT” in your comments above does not involve the previous RT, you don’t have to nest.

Draw something on RT3

Draw something on RT2
Draw RT3 on RT2

Draw something on RT1
Draw RT2 on RT1

No preserve contents required, and is much more efficient.

These are helpful ideas, thanks.

The main thing I am accomplishing is to achieve transformations and clipping in a tree hierarchy. Imagine something like this:

Child1 (rotates)
child 2 (also rotates)

If child 1 and child 2 are drawing complicated graphics, it is simple to have child2 render in it’s own buffer, then draw that rotated onto the buffer for child1. Then the child1 buffer is rotated and drawn onto the window.

I’m going to try some experiments around the timeframe buffers are created, their size, and possible using areas from inside a single buffer.

It turns out the problem was with depth clipping. The clipper was allowing buffer depths of only 0.0 to 1.0. I was using values outside of these and these buffers were getting clipped