Search code examples
c#imagexnaxna-4.0

'Nearest Neighbor' zoom


When I draw a stretched Texture2D, the pixels receive a Blur-like effect.

I want to use 'pixelated' graphics in my game and would like to know how to disable this in favor of the simplest nearest neighbor zoom.

I've created this picture for illustration: (x4 zoom)
enter image description here

In what way can I accomplish this?


Solution

  • In XNA 4, change your SpriteBatch.Begin() to set the sampler state to SamplerState.PointClamp