WebGL2RenderingContext

这是 实验性技术
检查 浏览器兼容性表格 在生产中使用这之前。

WebGL2RenderingContext interface provides the OpenGL ES 3.0 rendering context for the drawing surface of an HTML <canvas> 元素。

To get an object of this interface, call getContext() on a <canvas> element, supplying "webgl2" as the argument:

var canvas = document.getElementById('myCanvas');
var gl = canvas.getContext('webgl2');
					

WebGL 2 is an extension to WebGL 1. The WebGL2RenderingContext interface implements all members of the WebGLRenderingContext interface. Some methods of the WebGL 1 context can accept additional values when used in a WebGL 2 context. You will find this info noted on the WebGL 1 reference pages.

WebGL tutorial has more information, examples, and resources on how to get started with WebGL.

常量

WebGL constants 页面。

State information

WebGL2RenderingContext.getIndexedParameter()
Returns the indexed value for the given target .

Buffers

WebGL2RenderingContext.bufferData()
Initializes and creates the buffer object's data store.
WebGL2RenderingContext.bufferSubData()
Updates a subset of a buffer object's data store.
WebGL2RenderingContext.copyBufferSubData()
Copies part of the data of a buffer to another buffer.
WebGL2RenderingContext.getBufferSubData()
Reads data from a buffer and writes them to an ArrayBuffer or SharedArrayBuffer .

Framebuffers

WebGL2RenderingContext.blitFramebuffer()
Transfers a block of pixels from the read framebuffer to the draw framebuffer.
WebGL2RenderingContext.framebufferTextureLayer()
Attaches a single layer of a texture to a framebuffer.
WebGL2RenderingContext.invalidateFramebuffer()
Invalidates the contents of attachments in a framebuffer.
WebGL2RenderingContext.invalidateSubFramebuffer()
Invalidates portions of the contents of attachments in a framebuffer
WebGL2RenderingContext.readBuffer()
Selects a color buffer as the source for pixels.

Renderbuffers

WebGL2RenderingContext.getInternalformatParameter()
Returns information about implementation-dependent support for internal formats.
WebGL2RenderingContext.renderbufferStorageMultisample()
Creates and initializes a renderbuffer object's data store and allows specifying the number of samples to be used.

Textures

WebGL2RenderingContext.texStorage2D()
Specifies all levels of two-dimensional texture storage.
WebGL2RenderingContext.texStorage3D()
Specifies all levels of a three-dimensional texture or two-dimensional array texture.
WebGL2RenderingContext.texImage3D()
Specifies a three-dimensional texture image.
WebGL2RenderingContext.texSubImage3D()
Specifies a sub-rectangle of the current 3D texture.
WebGL2RenderingContext.copyTexSubImage3D()
Copies pixels from the current WebGLFramebuffer into an existing 3D texture sub-image.
WebGL2RenderingContext.compressedTexImage3D()
Specifies a three-dimensional texture image in a compressed format.
WebGL2RenderingContext.compressedTexSubImage3D()
Specifies a three-dimensional sub-rectangle for a texture image in a compressed format.

Programs and shaders

WebGL2RenderingContext.getFragDataLocation()
Returns the binding of color numbers to user-defined varying out variables.

Uniforms and attributes

WebGL2RenderingContext.uniform[1234][uif][v]()
Methods specifying values of uniform variables.
WebGL2RenderingContext.uniformMatrix[234]x[234]fv()
Methods specifying matrix values for uniform variables.
WebGL2RenderingContext.vertexAttribI4[u]i[v]()
Methods specifying integer values for generic vertex attributes.
WebGL2RenderingContext.vertexAttribIPointer()
Specifies integer data formats and locations of vertex attributes in a vertex attributes array.

Drawing buffers

WebGL2RenderingContext.vertexAttribDivisor()
Modifies the rate at which generic vertex attributes advance when rendering multiple instances of primitives with gl.drawArraysInstanced() and gl.drawElementsInstanced() .
WebGL2RenderingContext.drawArraysInstanced()
Renders primitives from array data. In addition, it can execute multiple instances of the range of elements.
WebGL2RenderingContext.drawElementsInstanced()
Renders primitives from array data. In addition, it can execute multiple instances of a set of elements.
WebGL2RenderingContext.drawRangeElements()
Renders primitives from array data in a given range.
WebGL2RenderingContext.drawBuffers()
Specifies a list of color buffers to be drawn into.
WebGL2RenderingContext.clearBuffer[fiuv]()
Clears buffers from the currently bound framebuffer.

Query objects

Methods for working with WebGLQuery 对象。

WebGL2RenderingContext.createQuery()
创建新的 WebGLQuery 对象。
WebGL2RenderingContext.deleteQuery()
Deletes a given WebGLQuery 对象。
WebGL2RenderingContext.isQuery()
返回 true if a given object is a valid WebGLQuery 对象。
WebGL2RenderingContext.beginQuery()
Begins an asynchronous query.
WebGL2RenderingContext.endQuery()
Marks the end of an asynchronous query.
WebGL2RenderingContext.getQuery()
返回 WebGLQuery object for a given target.
WebGL2RenderingContext.getQueryParameter()
Returns information about a query.

Sampler objects

WebGL2RenderingContext.createSampler()
创建新的 WebGLSampler 对象。
WebGL2RenderingContext.deleteSampler()
Deletes a given WebGLSampler 对象。
WebGL2RenderingContext.bindSampler()
Binds a given WebGLSampler to a texture unit.
WebGL2RenderingContext.isSampler()
返回 true if a given object is a valid WebGLSampler 对象。
WebGL2RenderingContext.samplerParameter[if]()
Sets sampler parameters.
WebGL2RenderingContext.getSamplerParameter()
Returns sampler parameter information.

Sync objects

WebGL2RenderingContext.fenceSync()
创建新的 WebGLSync object and inserts it into the GL command stream.
WebGL2RenderingContext.isSync()
返回 true if the passed object is a valid WebGLSync 对象。
WebGL2RenderingContext.deleteSync()
Deletes a given WebGLSync 对象。
WebGL2RenderingContext.clientWaitSync()

Blocks and waits for a WebGLSync object to become signaled or a given timeout to be passed.

WebGL2RenderingContext.waitSync()
Returns immediately, but waits on the GL server until the given WebGLSync object is signaled.
WebGL2RenderingContext.getSyncParameter()
Returns parameter information of a WebGLSync 对象。

Transform feedback

WebGL2RenderingContext.createTransformFeedback()
Creates and initializes WebGLTransformFeedback 对象。
WebGL2RenderingContext.deleteTransformFeedback()
Deletes a given WebGLTransformFeedback 对象。
WebGL2RenderingContext.isTransformFeedback()
返回 true if the passed object is a valid WebGLTransformFeedback 对象。
WebGL2RenderingContext.bindTransformFeedback()
Binds a passed WebGLTransformFeedback object to the current GL state.
WebGL2RenderingContext.beginTransformFeedback()
Starts a transform feedback operation.
WebGL2RenderingContext.endTransformFeedback()
Ends a transform feedback operation.
WebGL2RenderingContext.transformFeedbackVaryings()
Specifies values to record in WebGLTransformFeedback buffers.
WebGL2RenderingContext.getTransformFeedbackVarying()
Returns information about varying variables from WebGLTransformFeedback buffers.
WebGL2RenderingContext.pauseTransformFeedback()
Pauses a transform feedback operation.
WebGL2RenderingContext.resumeTransformFeedback()
Resumes a transform feedback operation.

Uniform buffer objects

WebGL2RenderingContext.bindBufferBase()
Binds a given WebGLBuffer to a given binding point ( target ) at a given index .
WebGL2RenderingContext.bindBufferRange()
Binds a range of a given WebGLBuffer to a given binding point ( target ) at a given index .
WebGL2RenderingContext.getUniformIndices()

Retrieves the indices of a number of uniforms within a WebGLProgram .

WebGL2RenderingContext.getActiveUniforms()
Retrieves information about active uniforms within a WebGLProgram .
WebGL2RenderingContext.getUniformBlockIndex()
Retrieves the index of a uniform block within a WebGLProgram .
WebGL2RenderingContext.getActiveUniformBlockParameter()
Retrieves information about an active uniform block within a WebGLProgram .
WebGL2RenderingContext.getActiveUniformBlockName()
Retrieves the name of the active uniform block at a given index within a WebGLProgram .
WebGL2RenderingContext.uniformBlockBinding()
Assigns binding points for active uniform blocks.

Vertex array objects

Methods for working with WebGLVertexArrayObject (VAO) objects.

WebGL2RenderingContext.createVertexArray()
创建新的 WebGLVertexArrayObject .
WebGL2RenderingContext.deleteVertexArray()
Deletes a given WebGLVertexArrayObject .
WebGL2RenderingContext.isVertexArray()
返回 true if a given object is a valid WebGLVertexArrayObject .
WebGL2RenderingContext.bindVertexArray()
Binds a given WebGLVertexArrayObject to the buffer.

规范

规范 状态 Comment
WebGL 2.0
The definition of 'WebGL2RenderingContext' in that specification.
编者草案 初始定义。

浏览器兼容性

更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
WebGL2RenderingContext Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
beginQuery Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
beginTransformFeedback Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
bindBufferBase Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
bindBufferRange Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
bindSampler Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
bindTransformFeedback Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
bindVertexArray Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
blitFramebuffer Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
bufferSubData Chrome Yes Edge 79 Firefox 51 IE No Opera Yes Safari No WebView Android Yes Chrome Android Yes Firefox Android 51 Opera Android Yes Safari iOS No Samsung Internet Android Yes
clearBufferfi Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
clearBufferfv Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
clearBufferiv Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
clearBufferuiv Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
clientWaitSync Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
compressedTexImage3D Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
compressedTexSubImage3D Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
copyBufferSubData Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
copyTexSubImage3D Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
createQuery Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
createSampler Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
createTransformFeedback Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
createVertexArray Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
deleteQuery Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
deleteSampler Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
deleteSync Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
deleteTransformFeedback Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
deleteVertexArray Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
drawArraysInstanced Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
drawBuffers Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
drawElementsInstanced Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
drawRangeElements Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
endQuery Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
endTransformFeedback Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
fenceSync Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
framebufferTextureLayer Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
getActiveUniformBlockName Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
getActiveUniformBlockParameter Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
getActiveUniforms Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
getBufferSubData Chrome 56 Edge 79 Firefox 51 IE No Opera Yes Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android Yes Safari iOS No Samsung Internet Android 7.0
getFragDataLocation Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
getIndexedParameter Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
getInternalformatParameter Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
getQuery Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
getQueryParameter Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
getSamplerParameter Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
getSyncParameter Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
getTransformFeedbackVarying Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
getUniformBlockIndex Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
getUniformIndices Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
invalidateFramebuffer Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
invalidateSubFramebuffer Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
isQuery Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
isSampler Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
isSync Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
isTransformFeedback Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
isVertexArray Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
pauseTransformFeedback Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
readBuffer Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
renderbufferStorageMultisample Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
resumeTransformFeedback Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
samplerParameterf Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
samplerParameteri Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
texImage3D Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
texStorage2D Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
texStorage3D Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
texSubImage3D Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
transformFeedbackVaryings Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
uniform1f Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
uniform1i Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
uniform1ui Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
uniform1uiv Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
uniform2f Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
uniform2i Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
uniform2ui Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
uniform2uiv Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
uniform3f Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
uniform3i Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
uniform3ui Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
uniform3uiv Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
uniform4f Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
uniform4i Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
uniform4ui Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
uniform4uiv Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
uniformBlockBinding Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
uniformMatrix2fv Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
uniformMatrix2x3fv Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
uniformMatrix2x4fv Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
uniformMatrix3fv Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
uniformMatrix3x2fv Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
uniformMatrix3x4fv Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
uniformMatrix4fv Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
uniformMatrix4x2fv Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
uniformMatrix4x3fv Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
vertexAttribDivisor Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
vertexAttribI4i Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
vertexAttribI4iv Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
vertexAttribI4ui Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
vertexAttribI4uiv Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
vertexAttribIPointer Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0
waitSync Chrome 56 Edge 79 Firefox 51 IE No Opera 43 Safari No WebView Android 58 Chrome Android 58 Firefox Android 51 Opera Android 43 Safari iOS No Samsung Internet Android 7.0

图例

完整支持
完整支持
不支持
不支持

另请参阅

  1. WebGL API
  2. WebGL2RenderingContext
  3. 方法
    1. beginQuery()
    2. beginTransformFeedback()
    3. bindBufferBase()
    4. bindBufferRange()
    5. bindSampler()
    6. bindTransformFeedback()
    7. bindVertexArray()
    8. blitFramebuffer()
    9. clearBuffer[fiuv]()
    10. clientWaitSync()
    11. compressedTexSubImage3D()
    12. copyBufferSubData()
    13. copyTexSubImage3D()
    14. createQuery()
    15. createSampler()
    16. createTransformFeedback()
    17. createVertexArray()
    18. deleteQuery()
    19. deleteSampler()
    20. deleteSync()
    21. deleteTransformFeedback()
    22. deleteVertexArray()
    23. drawArraysInstanced()
    24. drawBuffers()
    25. drawElementsInstanced()
    26. drawRangeElements()
    27. endQuery()
    28. endTransformFeedback()
    29. fenceSync()
    30. framebufferTextureLayer()
    31. getActiveUniformBlockName()
    32. getActiveUniformBlockParameter()
    33. getActiveUniforms()
    34. getBufferSubData()
    35. getFragDataLocation()
    36. getIndexedParameter()
    37. getInternalformatParameter()
    38. getQuery()
    39. getQueryParameter()
    40. getSamplerParameter()
    41. getSyncParameter()
    42. getTransformFeedbackVarying()
    43. getUniformBlockIndex()
    44. getUniformIndices()
    45. invalidateFramebuffer()
    46. invalidateSubFramebuffer()
    47. isQuery()
    48. isSampler()
    49. isSync()
    50. isTransformFeedback()
    51. isVertexArray()
    52. pauseTransformFeedback()
    53. readBuffer()
    54. renderbufferStorageMultisample()
    55. resumeTransformFeedback()
    56. samplerParameter[if]()
    57. texImage3D()
    58. texStorage2D()
    59. texStorage3D()
    60. texSubImage3D()
    61. transformFeedbackVaryings()
    62. uniform[1234][uif][v]()
    63. uniformBlockBinding()
    64. uniformMatrix[234]x[234]fv()
    65. vertexAttribDivisor()
    66. vertexAttribI4[u]i[v]()
    67. vertexAttribIPointer()
    68. waitSync()
  4. 继承:
    1. WebGLRenderingContext
  5. Related pages for WebGL
    1. ANGLE_instanced_arrays
    2. EXT_blend_minmax
    3. EXT_color_buffer_half_float
    4. EXT_disjoint_timer_query
    5. EXT_frag_depth
    6. EXT_sRGB
    7. EXT_shader_texture_lod
    8. EXT_texture_filter_anisotropic
    9. OES_element_index_uint
    10. OES_standard_derivatives
    11. OES_texture_float
    12. OES_texture_float_linear
    13. OES_texture_half_float
    14. OES_texture_half_float_linear
    15. OES_vertex_array_object
    16. WEBGL_color_buffer_float
    17. WEBGL_compressed_texture_atc
    18. WEBGL_compressed_texture_etc1
    19. WEBGL_compressed_texture_pvrtc
    20. WEBGL_compressed_texture_s3tc
    21. WEBGL_compressed_texture_s3tc_srgb
    22. WEBGL_debug_renderer_info
    23. WEBGL_debug_shaders
    24. WEBGL_depth_texture
    25. WEBGL_draw_buffers
    26. WEBGL_lose_context
    27. WebGLActiveInfo
    28. WebGLBuffer
    29. WebGLContextEvent
    30. WebGLFramebuffer
    31. WebGLObject
    32. WebGLProgram
    33. WebGLQuery
    34. WebGLRenderbuffer
    35. WebGLRenderingContext
    36. WebGLSampler
    37. WebGLShader
    38. WebGLShaderPrecisionFormat
    39. WebGLSync
    40. WebGLTexture
    41. WebGLTransformFeedback
    42. WebGLUniformLocation
    43. WebGLVertexArrayObject