c# - RenderTarget2D not preserving transparent background -
i'm working on project. 2d using spritebatch.
i'm having things explosions use custom effects not apply rest of image. here flow far:
1)clear background
2)draw explosion sprites
3)capture image , implement effects separate rendertarget2d
4)draw background
5)draw rendertarget2d created in step 3
6) draw else
the problem i'm running rendertarget2d created not transparent in areas not drawn on. result, background drawn in step 4 not shown.
i have tried graphicsdevice.clear(color.transparent) following calls setrendertarget(null). however, still getting purple background.
any ideas?
i'd post code, there's have parse through.
if follow flow should work;
graphicsdevice.setrendertarget(rendertarget); graphicsdevice.clear(color.transparent); // draw stuff texture graphicsdevice.setrendertarget(null); graphicsdevice.clear(backgroundcolor); // important clear here // draw background // draw texture // draw stuff
Comments
Post a Comment