Jump to content
  • Advertisement
Sign in to follow this  
arkerone

how to enable anisotropic filtering?

This topic is 2474 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
You have to create Texture Sampler with proper flags.


D3D11_SAMPLER_DESC SamplerStateTexture = {
D3D11_FILTER_ANISOTROPIC,
D3D11_TEXTURE_ADDRESS_WRAP,
D3D11_TEXTURE_ADDRESS_WRAP,
D3D11_TEXTURE_ADDRESS_WRAP,
0, 1,
D3D11_COMPARISON_ALWAYS,
0, 0, 0, 0, 0,
D3D11_FLOAT32_MAX
};
mD3D11Device->CreateSamplerState(&SamplerStateTexture, &mSamplerTexture);

Share this post


Link to post
Share on other sites
Hi,

just to point out one detail:

typedef struct D3D11_SAMPLER_DESC {
D3D11_FILTER Filter;
D3D11_TEXTURE_ADDRESS_MODE AddressU;
D3D11_TEXTURE_ADDRESS_MODE AddressV;
D3D11_TEXTURE_ADDRESS_MODE AddressW;
FLOAT MipLODBias;
UINT MaxAnisotropy;
D3D11_COMPARISON_FUNC ComparisonFunc;
FLOAT BorderColor[4];
FLOAT MinLOD;
FLOAT MaxLOD;
} D3D11_SAMPLER_DESC;

Don't forget to set the MaxAnisotropy to desired value (between 1 and 16). In the given example, the MaxAnisotropy is set to 1, which isn't the best quality. Of course, high MaxAnisotropy value means usually lower performance.

Cheers!

[Edit] MaxAnisotropy value may be hardware dependent

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!