0

enter image description here

The text becomes blurry if I use a non whole number for the position of the string. Any ideas what is causing this and how to correct it?

this->pSpriteBatch->Begin();
this->pSpriteFont->DrawString(this->pSpriteBatch, szTempMessage, XMFLOAT2(x, y), color);
this->pSpriteBatch->End();

I'm calling it with only the position and color parameters.

John
  • 5,942
  • 3
  • 42
  • 79

1 Answers1

0

SpriteBatch renders using CommonStates::LinearClamp by default, so it will be blurry if you rendering to a sub-pixel location. You can try using another filtering mode by overriding it with Begin:

// create an instance of CommonStates as pStates

pSpriteBatch->Begin(SpriteSortMode_Deferred,
    nullptr /*use default blend state */,
    pStates->AnisotropicClamp());
pSpriteFont->DrawString(...);
pSpriteBatch->End();

See if that improves your results.

Chuck Walbourn
  • 38,259
  • 2
  • 58
  • 81