SiliconStudio/xenko

SamplerState.OpenGL doesn't properly set the MaxAnisotropy parameter

Opened this issue · 0 comments

I'm not sure if I should do a Pull Request but here's the bug I've found:

GL.TexParameter(target, (TextureParameterName)OpenTK.Graphics.ES20.ExtTextureFilterAnisotropic.TextureMaxAnisotropyExt, Description.MaxAnisotropy);

the line should be:

GL.TexParameter(target, (TextureParameterName)OpenTK.Graphics.ES20.ExtTextureFilterAnisotropic.TextureMaxAnisotropyExt, maxAnisotropy);

What happens currently is if you apply an Anisotropic SamplerState override and then switch back to Linear, it will continue to render with Anisotropic because the MaxAnisotropy will still be 16 (even though it should be 1 because of the AnisotropicMask)