[MDX] Anisotropic filtering?

Started by
0 comments, last by remigius 17 years, 9 months ago
Is it possible to use Anisotropic filering from MDX? If so, how?
Advertisement
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 = sampler_state{    Texture = <someTexture>;        MinFilter = Anisotropic;    MagFilter = Anisotropic;    MipFilter = Linear;    };
Rim van Wersch [ MDXInfo ] [ XNAInfo ] [ YouTube ] - Do yourself a favor and bookmark this excellent free online D3D/shader book!

This topic is closed to new replies.

Advertisement