I have a sprite that I'm trying to scale up in XNA, but XNA is applying some sort of texture filtering that smooths it and makes it look ugly. I'd like it to just do pixel doubling instead of interpolation. How would I accomplish that?
Answer
You need to set the sampler state. The default for SpriteBatch is SamplerState.LinearClamp
(ie: linear interpolation - the smooth/blurry one).
Choose one of the SpriteBatch.Begin
calls that takes a SamplerState
and pass in SamplerState.PointClamp
(selects the pixel at that precice "point").
No comments:
Post a Comment