GO-Ve01
ServicesDevelopersBooksDictionaryPapersWikidataEncyclopediaSearchBabelCareersDeck

EXT_texture_filter_anisotropic extension

WebGL

WebGL

The **`EXT_texture_filter_anisotropic`** extension is part of the [WebGL API](/docs/Web/API/WebGL_API) and exposes two constants for [anisotropic filtering (AF)](https://en.wikipedia.org/wiki/Anisotropic_filtering).

AF improves the quality of mipmapped texture access when viewing a textured primitive at an oblique angle. Using just mipmapping, these lookups have a tendency to average to gray.

WebGL extensions are available using the WebGLRenderingContext.getExtension() method.
For more information, see [Using WebGL extensions](/docs/Web/API/WebGL_API/Using_Extensions).

> [!NOTE]
> This extension is available to both, WebGL1 and WebGL2 contexts.

## Constants

- `ext.MAX_TEXTURE_MAX_ANISOTROPY_EXT`
- : This is the `pname` argument to the gl.getParameter() call, and it returns the maximum available anisotropy.
- `ext.TEXTURE_MAX_ANISOTROPY_EXT`
- : This is the `pname` argument to the gl.getTexParameter() and gl.texParameterf() / gl.texParameteri() calls and sets the desired maximum anisotropy for a texture.

## Examples

```js
const texture = gl.createTexture();
gl.bindTexture(gl.TEXTURE_2D, texture);
const ext =
gl.getExtension("EXT_texture_filter_anisotropic") ||
gl.getExtension("MOZ_EXT_texture_filter_anisotropic") ||
gl.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
if (ext) {
const max = gl.getParameter(ext.MAX_TEXTURE_MAX_ANISOTROPY_EXT);
gl.texParameterf(gl.TEXTURE_2D, ext.TEXTURE_MAX_ANISOTROPY_EXT, max);
}
```

## Specifications

## Browser compatibility

## See also

- WebGLRenderingContext.getExtension()

source: MDN Web Docs mirror · page

Cite this

"EXT_texture_filter_anisotropic extension". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/Web/API/EXT_texture_filter_anisotropic

JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy

Save to pass ·