Jump to content
  • Advertisement
Sign in to follow this  

[MDX] Anisotropic filtering?

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

Yep, you can enable max AF in a safe way like this:

// e is the device reset event used in the sampleframework,
// you can just use the device itself in a normal MDX app

if (e.Device.DeviceCaps.TextureFilterCaps.SupportsMinifyAnisotropic)
e.Device.SamplerState[0].MinFilter = TextureFilter.Anisotropic;

if (e.Device.DeviceCaps.TextureFilterCaps.SupportsMagnifyAnisotropic)
e.Device.SamplerState[0].MagFilter = TextureFilter.Anisotropic;

e.Device.SamplerState[0].MaxAnisotropy = e.Device.DeviceCaps.MaxAnisotropy;

You might want to add some fallbacks to use linear filtering if anisotropic is not supported by the device. To enable anisotropic in a HLSL sampler, you can use:

sampler someSampler =
Texture = <someTexture>;

MinFilter = Anisotropic;
MagFilter = Anisotropic;
MipFilter = Linear;

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!