In XNA is there a way to render the contents of a spriteBatch after drawing to a texture object before rendering to the screen?
Asked
Active
Viewed 4,395 times
3 Answers
1
You'll need to switch your render target for the spritebatch and then grab the texture out of it. This MSDN article explains it pretty well.

scottheckel
- 9,106
- 1
- 35
- 47
1
As Hexxagonal already answered, yes you can. But you might get into trouble, if you are using sprites with translucency. The reason is, that two overlapping sprites wont end up with the right alphavalue in your offscreen rendertarget.
To make things right you will have to make your own SpriteBatch and start using premultiplied alpha.

LaZe
- 692
- 4
- 14
0
Here's an additional link to Shawn Hargreaves' excellent blog where he talks about rendertarget semantics:
http://blogs.msdn.com/shawnhar/archive/2007/02/04/xna-rendertarget-semantics.aspx

Joel Martinez
- 46,929
- 26
- 130
- 185