4
\$\begingroup\$

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?

\$\endgroup\$
5
\$\begingroup\$

You should set the sampler state to Point:

graphicsDevice.SamplerStates[0] = SamplerState.PointClamp;
\$\endgroup\$
3
\$\begingroup\$

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.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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