Jump to content
  • Advertisement
Sign in to follow this  
BlackJoker

How to use anisotropic filtering D3D 11

This topic is 2102 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

Hello.

 

I cannot enable anisotropic filtering in my engine. I already create sampler state with needed parameters, but rendered image is not filtered.

 

I create a sampler state like this:







ZeroMemory(&anisotropicDesc, sizeof(anisotropicDesc));

	anisotropicDesc.Filter = D3D11_FILTER_ANISOTROPIC;
	anisotropicDesc.AddressU = D3D11_TEXTURE_ADDRESS_WRAP;
	anisotropicDesc.AddressV = D3D11_TEXTURE_ADDRESS_WRAP;
	anisotropicDesc.AddressW = D3D11_TEXTURE_ADDRESS_WRAP;
	anisotropicDesc.MipLODBias = 0;
	anisotropicDesc.MaxAnisotropy = 8;
	anisotropicDesc.ComparisonFunc = D3D11_COMPARISON_ALWAYS;
	//anisotropicDesc.BorderColor = 0.0f;
	anisotropicDesc.MinLOD = 0;
	anisotropicDesc.MaxLOD = 0;

	result = d3d11_Device->CreateSamplerState(&anisotropicDesc,&anisotropicFiltering);
	if (FAILED(result))
		return false; 

But maybe I need to do something more? What did I miss?

Edited by BlackJoker

Share this post


Link to post
Share on other sites
Advertisement

You'll need to set it right before calling it, just so no other sampler state is set before drawing than the desired one.

Share this post


Link to post
Share on other sites

Thanks a lot for help, but I wish to know how to get the max anisotropic level that supports by current video card?

Edited by BlackJoker

Share this post


Link to post
Share on other sites

I ask because my PC on work with embedded Intel card seems does not pay attention to anisotropy level - anisotropic is not working here, but on my home PC it works fine with the same code.

Edited by BlackJoker

Share this post


Link to post
Share on other sites
You can override the graphics settings like anisotropy in almost all graphic drivers. This is probably whats going on on your second pc, it probably has anisotropy specifically disabled or set to a small value.

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!