So I have a texture that I make during play, which I then stretch out to the whole screen so that you can see the individual pixels and it’s not just really small. The problem is that the texture is a tenth of the size of the full screen, so it is really blurry. I know that in the pipeline I can set the compression type of an image for pixel art to nearest, but how do I do that during runtime for a generated texture? Thanks
If I understood you correctly, you just have to set the samplerState
parameter to SamplerState.PointClamp
in your call to SpriteBatch.Begin()
. That should apply nearest neighbour interpolation to every drawn sprite. Here’s the API reference.