Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

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

  GraphicsDevice.SamplerStates[0] = SamplerState.PointClamp;
share|improve this answer
    
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; }; –  user27811 Sep 24 '13 at 11:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.