setAnisotropicFilter doesn't work on GWT
Author: Frosty-JCreated Aug 9, 2026Updated Aug 9, 2026
Describe the bug
I don't think this works in WebGL:
So for my project, I had AI write this workaround:
public static void setAnisotropicFilter(Texture texture, float level) {
if (Gdx.app.getType() == Application.ApplicationType.WebGL) {
boolean supported = Gdx.graphics.supportsExtension("EXT_texture_filter_anisotropic")
|| Gdx.graphics.supportsExtension("WEBKIT_EXT_texture_filter_anisotropic")
|| Gdx.graphics.supportsExtension("MOZ_EXT_texture_filter_anisotropic");
if (supported) {
texture.bind();
Gdx.gl20.glTexParameterf(GL20.GL_TEXTURE_2D, GL20.GL_TEXTURE_MAX_ANISOTROPY_EXT, level);
}
} else {
texture.setAnisotropicFilter(level);
}
}I don't know if the WebKit/Moz prefixes are really necessary. I haven't put any brainpower into this, hence why this is just an issue and not a pull request that fixes it.
Reproduction
Render a mipmapped texture at a sharp angle. Try to do texture.setAnisotropicFilter(16f). You would expect it to look like this:
But instead it looks like this (GWT):
(camera angle is slightly different between these screenshots, but you get the picture)
version
1.14.2
Stack trace
Affected platforms
- Android
- iOS
- HTML/GWT
- Windows
- Linux
- macOS
Source: libgdx/libgdx