大网数据广告活动
Web 标准与前端开发

EXT_texture_filter_anisotropic extension

· 52CE 我爱测

The **`EXT_texture_filter_anisotropic`** extension is part of the WebGL API and exposes two constants for anisotropic filtering (AF).

WebGL

The EXT_texture_filter_anisotropic extension is part of the WebGL API and exposes two constants for anisotropic filtering (AF).

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.

[!NOTE] This extension is available to both, WebGLRenderingContext and WebGL2RenderingContext contexts.

Constants

  • ext.MAX_TEXTURE_MAX_ANISOTROPY_EXT
    • : This is the pname argument to the WebGLRenderingContext.getParameter call, and it returns the maximum available anisotropy.
  • ext.TEXTURE_MAX_ANISOTROPY_EXT
    • : This is the pname argument to the WebGLRenderingContext.getTexParameter and WebGLRenderingContext.texParameter / WebGLRenderingContext.texParameter calls and sets the desired maximum anisotropy for a texture.

Examples

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()

来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
MDN Web Docs / Mozilla 贡献者
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 2.5

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。