In my XNA-4.0-game (which somehow is a bit like MineCraft), I have got some big cubes with small textures (16x16px) on it. By default, XNA just scales them up smooth so there aren't any hard borders. But as the game is a retro game, I want these big pixels. So how do I turn of that interpolation?


1 Answer 1


Change the sampler state to Point clamp or wrap before drawing.

  GraphicsDevice.SamplerStates[0] = SamplerState.PointClamp;
  • \$\begingroup\$ If you program the shader yourself, you can do this in HLSL, too. This is done while defining a texture sampler. sampler2D ColorMapSampler = sampler_state { Texture = <ColorMap>; MinFilter = linear; MagFilter = linear; MipFilter = linear; AddressU = Wrap; AddressV = Wrap; }; \$\endgroup\$
    – 0xBADF00D
    Sep 24, 2013 at 11:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .