XNA Creators Club Online
Page 1 of 1 (2 items)
Sort Posts: Previous Next

Scaling a Texture2D without anti-aliasing?

Last post 7/5/2009 5:40 AM by legalize. 1 replies.
  • 4/6/2009 1:17 AM

    Scaling a Texture2D without anti-aliasing?

    Hi. I'm using XNA Game Studio 3.0, Texture2D and SpriteBatch.

    Is there a way to scale the texture without it being blurred? It displays correctly at a scale of 1 (of course), but setting it to other solid scales such as 2 or 3 results in a blurred image.

    Thanks!
  • 7/5/2009 5:40 AM In reply to

    Re: Scaling a Texture2D without anti-aliasing?

    Since you're increasing the size of the source texels relative to the size of screen pixels beyond a 1:1 mapping between them, there isn't any additional detail to use. The best that the GPU can do is to interpolate between adjacent texels in the texture to create the new screen pixels required. If you want more detail, you'll need a higher resolution source image for your texture.

    If you'd rather have a 'blocky' rendering of your magnified texture, you can turn off the interpolation by adjusting the sampler state for the appropriate texture stage. You want to change the SamplerState.MagFilter to TextureFilter.Point.

Page 1 of 1 (2 items) Previous Next