My sprite is blurry?

Started by
3 comments, last by Cantos 16 years, 5 months ago
I am doing a 2D game with ID3DXSprite but I have a problem with the way my sprites are being drawn. The one on the right is what it looks like in the sprite sheet, and the one on the left is a cropped screen shot of the game. I'm not scaling the sprite at all. In game, it's blurry and there is a gray outline around the edges. This is running windowed, but I made the backbuffer the same size as a GetClientRect. Is there a render state I can set to fix this?
Advertisement
Try setting the texture filtering to point filtering, after calling Sprite.Begin(). This should help.
This is because the ID3DXSprite sets some states and it might not produce the results you want.

I hope this helps.
Take care.
Make sure your texture dimension is power of 2. if not, d3d may stretch your texture.
Maybe this has something to do with texel to pixel mapping. Take a look at this page: Texels to pixels
Thank you, my sprites are pixel perfect now! :)


It was a combination of the texture filtering and my window being a couple of pixels smaller than I thought it was.

This topic is closed to new replies.

Advertisement