سؤال

I know that, there is a way to set "the nearest neighbor" for 3D render. I mean:

d3ddevice->SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_NONE);
d3ddevice->SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_NONE);
d3ddevice->SetSamplerState(0, D3DSAMP_MIPFILTER, D3DTEXF_NONE);

But it doesn't work for sprites.

هل كانت مفيدة؟

المحلول

When you call Begin to start rendering your sprite, you need to pass the flag D3DXSPRITE_DONOTMODIFY_RENDERSTATE or it will use the states documented in MSDN here. In this case, you need to set all of the state you require beforehand, and make sure you select the desired sampler state.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top