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.

It appears that if a image is undersized for covering the model it's set to cover, it anti-aliases instead of stretches. How can I control this behavior?

share|improve this question
add comment

2 Answers

up vote 6 down vote accepted

You should set the sampler state to Point:

graphicsDevice.SamplerStates[0] = SamplerState.PointClamp;
share|improve this answer
add comment

The default texture magnification filter seems to be bilinear filtering, which will interpolate linearly between texels if the texture needs to be blown up to cover the target. If the sample doesn't lie on a texel center, bilinear filtering takes the closest pixels horizontally and vertically and blends them together based on their distance to the sample point.

If you want a square pixel look you probably want the Point (or Nearest in other APIs) filter, which instead picks the closest texel to the sample coordinates and uses the value of that texel alone.

share|improve this answer
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.