Does anisotropic filtering override bilinear and trilinear?

I’m a bit confused on this. From what I can find online, anisotropic filtering is different than bilinear and trilinear. But in the settings, it seems they go together. Can anyone explain this?

See this earlier informative answer. In short, the UI to choose filtering options is a little bit misleading.

You should only be concerned with anisotropic filtering if you feel the camera will be nearly co-planar with an important texture for a significant period of time. The goal is to make the texture look better when one pixel of screen represents a long stretch of details across a texture.

Great, thank you!

Minor update to my original post. You can apparently enable anisotropic filtering with bilinear filtering in OpenGL, which is why it’s setup the way it is in Unity. Nothing else can do that, and no one should really want to, but you “can”.

Does that mean if we use OpenGL, we need to change every texture from bilinear to trilinear instead?

interesting

as i understand if your texture sample is set “Bilinear” and you set aniso = 2 or higher it is really working in Trilinear regardless what unity setting is

a good example found before was if you locked your shader sampler states with Bilinear the aniso would not work as the GPU requires Trilinear for ansio

has this recently changed ?

Honestly I wouldn’t worry about it. On the platforms that matters on (mobile) you probably want to be selective about which textures you enable Anisotropic textures on, and if they do bilinear + aniso and it’s slightly faster and you don’t notice the difference, leave it.

Otherwise on basically all other platforms there’s little reason to not force it on in the quality settings for all textures. Modern desktop and consoles can have 16x anisotropic filtering on for basically everything and the change in fps is close to within the margin for error.

On Direct3D, Vulkan, and Metal, yes. On OpenGL … maybe? Technically OpenGL “supports” point filtering with anisotropic filtering too, though what that actually does will depend on the GPU you’re using since OpenGL is a very loose spec were “compliance” just means if the user asks for some settings nothing crashes, there’s no requirement for those settings to actually do anything. So a GPU might support bilinear + anisotropic, and setting that might look different than trilinear + anisotropic, or they might look the same, or in some low end mobile hardware enabling anisotropic filtering does nothing at all and they look exactly the same as they did without it.

OpenGL is “fun”.

If you locked your sampler states to trilinear, aniso would still not work, because you locked the sampler state to trilinear. Unity still does not offer a way to define sampler states in the shader with Anisotropic filtering enabled, so they will always disable it.

This is a VR game on the Oculus Quest (mobile), so we need to force it on anyways. I’ve read 2-4x works well enough on that platform though, so planning on trying that out.

FWIW 2021.2.0a21+ has it for inline sampler states.

3 Likes

Yay!:smile:

last time i looked was a year ago
but i recalled with ASE sampler states the Aniso would still work manually on the texture import setting if the sample state was locked into Trilinear, however if it was locked as Bilinear it would not

it nice 2021.2 will expose this as actual 3rd filter now !!

Huh, it’s unusual for Amplify to get stuff wrong.

If that was in the documentation, they were wrong though. Inline sampler states always disable anisotropic filtering. And if it was in the documentation it isn’t anymore. (Note, I can’t find it at all, even going through some of the documentation history. Maybe it was on their forums?)

This is a super simple unlit shader where the first two are using the texture’s sampler state using Bilinear filtering w/ Aniso 0 and Trilinear filtering w/ Aniso 16 and a Trilinear inline sampler state with the texture still set to Aniso 16 and Anisotropic filtering being forced on in the quality settings.
7550242--933283--upload_2021-10-5_23-45-55.png

1 Like