The WebGLTexture interface is part of the WebGL API and represents an opaque texture object providing storage and state for texturing operations.
DescriptionEdit
The WebGLTexture
object does not define any methods or properties of its own and its content is not directly accessible. When working with WebGLTexture
objects, the following methods of the WebGLRenderingContext
are useful:
WebGLRenderingContext.bindTexture()
WebGLRenderingContext.createTexture()
WebGLRenderingContext.deleteTexture()
WebGLRenderingContext.isTexture()
ExamplesEdit
Creating a texture
var canvas = document.getElementById("canvas");
var gl = canvas.getContext("webgl");
var texture = gl.createTexture();
SpecificationsEdit
Specification | Status | Comment |
---|---|---|
WebGL 1.0 The definition of 'WebGLTexture' in that specification. |
Recommendation | Initial definition. |
Browser compatibilityEdit
[1] This feature is behind a feature preference setting. In about:config, set gfx.offscreencanvas.enabled
to true
.
See alsoEdit
WebGLRenderingContext.bindTexture()
WebGLRenderingContext.createTexture()
WebGLRenderingContext.deleteTexture()
WebGLRenderingContext.isTexture()
WebGLRenderingContext.compressedTexImage2D()
WebGLRenderingContext.compressedTexSubImage2D()
WebGLRenderingContext.copyTexImage2D()
WebGLRenderingContext.copyTexSubImage2D()
WebGLRenderingContext.generateMipmap()
WebGLRenderingContext.getTexParameter()
WebGLRenderingContext.texImage2D()
WebGLRenderingContext.texSubImage2D()
WebGLRenderingContext.texParameterf()
WebGLRenderingContext.texParameteri()