你好我想让像素艺术图像看起来不那么模糊我尝试设置采样器状态但我看不出有什么区别
device->SetSamplerState(0, D3DSAMP_MIPFILTER, D3DTEXF_NONE);
我几乎尝试了 setsamplerstate 中的所有内容,但我看不出有任何区别
我知道我可以使用 photoshop 将照片放大,但我可以使用 direct3d9 使其看起来更硬吗
最佳答案
“像素艺术”通常是在没有任何混合或双线性过滤的情况下绘制的。对于旧版 Direct3D 9,您将使用(假设您的纹理绑定(bind)到插槽 0):
device->SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_POINT);
device->SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_POINT);
device->SetSamplerState(0, D3DSAMP_MIPFILTER, D3DTEXF_NONE);
At this point, you shouldn't use legacy Direct3D 9 at all. Direct3D 11 is your best bet. If you are using C++, take a look at the SpriteBatch class with the CommonStates::PointClamp() sampler state in the DirectX Tool Kit.
关于c++ - direct3d9 如何为像素艺术过滤纹理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58179313/