3
\$\begingroup\$

I'm confused about the usage of trilinear filtering and anisotropic filtering in SharpDX.

As far as i understood, trilinear filtering does linear filtering to the textures and in a case of LOD-change it also interpolates between the too LODs to smooth the transition.

Anisotropic filtering make the texture bigger. Now it is possible to use trilinear filtering to do the same thing, due to anisotropic filtering with bigger textures. This causes a lesser blurred image, when you use anisotropy, because the interpolation is better.

Now, it should be possible to use trilinear filtering and anisotropic filtering at the same time. But in the SamplerState i can only choose Filter.Anisotropy or Filter.MinMagMipLinear (should be trilinear, right?). You can see all possible filters here: D3D11 Filter Enumeration.

So my question: Can you use both techniques together, if yes, how can i archieve that in SharpDX with SamplerState?

\$\endgroup\$
  • \$\begingroup\$ Anisotropic filtering does not make the texture bigger, it just increases the size of the sample window from 2x2 to something more appropriate for the angle of the surface being sampled. \$\endgroup\$ – Andon M. Coleman Jun 12 '14 at 22:36
2
\$\begingroup\$

Anisotropic filtering does not alter the size of the texture. Anisotropic filtering allows the texture to be probed at a different rate on each axis, versus isotropic filtering (linear, bilinear, trilinear...) which must be probed at the same rate on each axis.

Anisotropic filtering is primarily to solve the problem of texture blurring at highly oblique angles such as looking down a roadway or standing next to a wall. Objects that are rendered long and skinny look better because the filter can choose the right mip level on each axis instead of being stuck with the resolution of the smaller axis and blurring the other one.

Anisotropic and isotropic textures are stored differently in the hardware because they do different things. Anisotropic filtering isn't inherently better, it's only "better for objects at funny angles". You can't mix them.

You don't want to use it all the time because you'll be paying a performance penalty. Batch the objects its appropriate for and use it only for those, or if you don't have enough objects to justify it, copy them into pieces so the chunks aren't oblique when rendered.

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.