Convert Texture2d to RenderTarget and back?

is there a way to convert a Texture2D to a RenderTarget and then back to a a Texture2D?
I want to make a method that takes a texture2D to draw something on.

A RenderTarget2D is also a Texture2D, so just create a RenderTarget2D.

Do beware of using MSAA on the target though, that requires a resolve to be used meaningfully outside of as screen-buffer and that is not cheap, MSAA-resolve can become a bottle-neck in some kinds of NPR.


If you need to do some sort of render onto the texture then write a utility class to coordinate the base texture and the resultant rendertarget.

To go from a texture2D to a rendertarget

GraphicsDevice.SetRenderTarget(myRenderTarget);
spriteBatch.Draw(... myTexture2D ...);  // draw it to the whole screen.

To go from rendertarget to texture2d

var myTexture2DFromRenderTarget = (Texture2D) myRenderTarget;

awesome thanks guys.
@AcidFaucent I am doing pixel games so I won’t be using MSAA.