I'm setting a render target in XNA using the following lines of code:
Game.GraphicsDevice.SetRenderTarget(physicsTexture); Game.GraphicsDevice.Clear(Color.White); noiseEffect.CurrentTechnique.Passes.Apply(); DrawQuad(); Game.GraphicsDevice.SetRenderTarget(null); physicsTexture.GetData<Color>(physicsBuffer);
Now, physicsTexture is a RenderTarget2D. This texture already has some of its pixels colored by the CPU before it gets set as the render target.
So when my pass in the HLSL pixel shader runs, my question is: Can I get the current pixel color of a given texture coordinate using tex2D or something similar on the render target, before drawing a new pixel at that area?