[MDX] Anisotropic filtering?
Yep, you can enable max AF in a safe way like this:
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:
// 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; };
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement