• Advertisement
Sign in to follow this  

[MDX] Anisotropic filtering?

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