All I want is to clear my renderTarget2D once so that it starts off compeltely transparent, and then preserve it's contents between frames.
I draw the renderTarget texture after I draw the background texture, so I don't want it to paint over. However Clear(Color.Transparent) it shows up as an opaque purple, which as I understand is the default clear color...
What am I doing wrong? I tried changing the SurfaceFormat parameter in the constructor but that had no effect. what am I doing wrong?
// instantiate renderTarget to preserve contents
renderTarget = new RenderTarget2D(GraphicsDevice,
GraphicsDevice.PresentationParameters.BackBufferWidth,
GraphicsDevice.PresentationParameters.BackBufferHeight,
false,
GraphicsDevice.PresentationParameters.BackBufferFormat,
DepthFormat.Depth24,
0,
RenderTargetUsage.PreserveContents);
// clear with transparent color
GraphicsDevice.SetRenderTarget(Globals.renderTarget);
GraphicsDevice.Clear(Color.Transparent);
GraphicsDevice.SetRenderTarget(null);