2016-07-13 1 views
0

enter image description hereDirectxtk SpriteFont 흐릿하지 않을 때 정수

내가 문자열의 위치를 ​​비 정수를 사용하는 경우 텍스트가 흐릿하게된다. 어떤 아이디어가 원인이되며이를 해결하는 방법은 무엇입니까?

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

위치 및 색상 매개 변수만으로 호출합니다.

답변

0

SpriteBatch은 기본적으로 CommonStates::LinearClamp을 사용하여 렌더링하므로 하위 픽셀 위치로 렌더링하면 흐리게 보입니다. 당신은 Begin로를 재정 의하여 다른 필터링 모드를 사용하여 시도 할 수 있습니다 : 그 결과를 향상 경우

// create an instance of CommonStates as pStates 

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

을 참조하십시오.

관련 문제