How to texture2d setpixel ?

You can just render all that as you normally would, but render it to a RenderTarget2D - this single RenderTarget2D can then be used as a texture as often as you like. I guess this is what you want to do.

// do this once:
device.SetRenderTarget(mybigtex);
spriteBatch.Begin();
... 10.000 times 2x2 texture draws
spriteBatch.End();
device.SetRenderTarget(null);

// do this in consecutive calls
spriteBatch.Begin();
spriteBatch.Draw(mybigtex,...);
spriteBatch.End();

But you are always drawing 3D Quads - because it is actually way faster then traditional 2D (parallel processing in GPU)

1 Like