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[0].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?
.Clear()
the surface to white. So, all of the pixels on the RenderTarget2D would be white when your pass runs. Maybe I've misunderstood your question. \$\endgroup\$