0

hello i want to make pixel art image looks less blurry i tried set sampler state but i see no difference

device->SetSamplerState(0, D3DSAMP_MIPFILTER, D3DTEXF_NONE);

enter image description here

i tried almost everything in setsamplerstate but i see no difference at all

i know i can make the photo bigger using photoshop but can i just make it looks hard edge with direct3d9

t.niese
  • 39,256
  • 9
  • 74
  • 101
alabdaly891
  • 159
  • 1
  • 8

1 Answers1

1

"Pixel art" is typically drawn without any blending or bi-linear filtering. For legacy Direct3D 9, you'd use (assuming your textures are bound to slot 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.

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