Esta tradução está em curso.

A interface de WebGLRenderingContext fornece o contexto de renderização de OpenGL ES 2.0 para a superfície de desenho de um elemento <canvas> de HTML.

Para obter um objeto desta interface, call getContext() num elemento de <canvas>, fornecendo "webgl" como um argumento:

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

Once you have the WebGL rendering context for a canvas, you can render within it.

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

Constantes

See the WebGL constants page.

O contexto de WebGL

The following properties and methods provide general information and functionality to deal with the WebGL context:

WebGLRenderingContext.canvas
A read-only back-reference to the HTMLCanvasElement. Might be null if it is not associated with a <canvas> element.
WebGLRenderingContext.commit()

Pushes frames back to the original HTMLCanvasElement, if the context is not directly fixed to a specific canvas.

WebGLRenderingContext.drawingBufferWidth
The read-only width of the current drawing buffer. Should match the width of the canvas element associated with this context.
WebGLRenderingContext.drawingBufferHeight
The read-only height of the current drawing buffer. Should match the height of the canvas element associated with this context.
WebGLRenderingContext.getContextAttributes()
Returns a WebGLContextAttributes object that contains the actual context parameters. Might return null, if the context is lost.
WebGLRenderingContext.isContextLost()
Returns true if the context is lost, otherwise returns false.

Visualização e  recorte

WebGLRenderingContext.scissor()
Defines the scissor box.
WebGLRenderingContext.viewport()
Sets the viewport.

Informação de estado

WebGLRenderingContext.activeTexture()
Selects the active texture unit.
WebGLRenderingContext.blendColor()
Sets the source and destination blending factors.
WebGLRenderingContext.blendEquation()
Sets both the RGB blend equation and alpha blend equation to a single equation.
WebGLRenderingContext.blendEquationSeparate()
Sets the RGB blend equation and alpha blend equation separately.
WebGLRenderingContext.blendFunc()
Defines which function is used for blending pixel arithmetic.
WebGLRenderingContext.blendFuncSeparate()
Defines which function is used for blending pixel arithmetic for RGB and alpha components separately.
WebGLRenderingContext.clearColor()
Specifies the color values used when clearing color buffers.
WebGLRenderingContext.clearDepth()
Specifies the depth value used when clearing the depth buffer.
WebGLRenderingContext.clearStencil()
Specifies the stencil value used when clearing the stencil buffer.
WebGLRenderingContext.colorMask()
Sets which color components to enable or to disable when drawing or rendering to a WebGLFramebuffer.
WebGLRenderingContext.cullFace()
Specifies whether or not front- and/or back-facing polygons can be culled.
WebGLRenderingContext.depthFunc()
Specifies a function that compares incoming pixel depth to the current depth buffer value.
WebGLRenderingContext.depthMask()
Sets whether writing into the depth buffer is enabled or disabled.
WebGLRenderingContext.depthRange()
Specifies the depth range mapping from normalized device coordinates to window or viewport coordinates.
WebGLRenderingContext.disable()
Disables specific WebGL capabilities for this context.
WebGLRenderingContext.enable()
Enables specific WebGL capabilities for this context.
WebGLRenderingContext.frontFace()
Specifies whether polygons are front- or back-facing by setting a winding orientation.
WebGLRenderingContext.getParameter()
Returns a value for the passed parameter name.
WebGLRenderingContext.getError()
Returns error information.
WebGLRenderingContext.hint()
Specifies hints for certain behaviors. The interpretation of these hints depend on the implementation.
WebGLRenderingContext.isEnabled()
Tests whether a specific WebGL capability is enabled or not for this context.
WebGLRenderingContext.lineWidth()
Sets the line width of rasterized lines.
WebGLRenderingContext.pixelStorei()
Specifies the pixel storage modes
WebGLRenderingContext.polygonOffset()
Specifies the scale factors and units to calculate depth values.
WebGLRenderingContext.sampleCoverage()
Specifies multi-sample coverage parameters for anti-aliasing effects.
WebGLRenderingContext.stencilFunc()
Sets the both front and back function and reference value for stencil testing.
WebGLRenderingContext.stencilFuncSeparate()
Sets the front and/or back function and reference value for stencil testing.
WebGLRenderingContext.stencilMask()
Controls enabling and disabling of both the front and back writing of individual bits in the stencil planes.
WebGLRenderingContext.stencilMaskSeparate()
Controls enabling and disabling of front and/or back writing of individual bits in the stencil planes.
WebGLRenderingContext.stencilOp()
Sets both the front and back-facing stencil test actions.
WebGLRenderingContext.stencilOpSeparate()
Sets the front and/or back-facing stencil test actions.

Buffers

WebGLRenderingContext.bindBuffer()
Binds a WebGLBuffer object to a given target.
WebGLRenderingContext.bufferData()
Updates buffer data.
WebGLRenderingContext.bufferSubData()
Updates buffer data starting at a passed offset.
WebGLRenderingContext.createBuffer()
Creates a WebGLBuffer object.
WebGLRenderingContext.deleteBuffer()
Deletes a WebGLBuffer object.
WebGLRenderingContext.getBufferParameter()
Returns information about the buffer.
WebGLRenderingContext.isBuffer()
Returns a Boolean indicating if the passed buffer is valid.

Framebuffers

WebGLRenderingContext.bindFramebuffer()
Binds a WebGLFrameBuffer object to a given target.
WebGLRenderingContext.checkFramebufferStatus()
Returns the status of the framebuffer.
WebGLRenderingContext.createFramebuffer()
Creates a WebGLFrameBuffer object.
WebGLRenderingContext.deleteFramebuffer()
Deletes a WebGLFrameBuffer object.
WebGLRenderingContext.framebufferRenderbuffer()
Attaches a WebGLRenderingBuffer object to a WebGLFrameBuffer object.
WebGLRenderingContext.framebufferTexture2D()
Attaches a textures image to a WebGLFrameBuffer object.
WebGLRenderingContext.getFramebufferAttachmentParameter()
Returns information about the framebuffer.
WebGLRenderingContext.isFramebuffer()
Returns a Boolean indicating if the passed WebGLFrameBuffer object is valid.
WebGLRenderingContext.readPixels()
Reads a block of pixels from the WebGLFrameBuffer.

Renderbuffers

WebGLRenderingContext.bindRenderbuffer()
Binds a WebGLRenderBuffer object to a given target.
WebGLRenderingContext.createRenderbuffer()
Creates a WebGLRenderBuffer object.
WebGLRenderingContext.deleteRenderbuffer()
Deletes a WebGLRenderBuffer object.
WebGLRenderingContext.getRenderbufferParameter()
Returns information about the renderbuffer.
WebGLRenderingContext.isRenderbuffer()
Returns a Boolean indicating if the passed WebGLRenderingBuffer is valid.
WebGLRenderingContext.renderbufferStorage()
Creates a renderbuffer data store.

Texturas

WebGLRenderingContext.bindTexture()
Binds a WebGLTexture object to a given target.
WebGLRenderingContext.compressedTexImage2D()
Specifies a 2D texture image in a compressed format.
WebGLRenderingContext.compressedTexSubImage2D()
Specifies a 2D texture sub-image in a compressed format.
WebGLRenderingContext.copyTexImage2D()
Copies a 2D texture image.
WebGLRenderingContext.copyTexSubImage2D()
Copies a 2D texture sub-image.
WebGLRenderingContext.createTexture()
Creates a WebGLTexture object.
WebGLRenderingContext.deleteTexture()
Deletes a WebGLTexture object.
WebGLRenderingContext.generateMipmap()
Generates a set of mipmaps for a WebGLTexture object.
WebGLRenderingContext.getTexParameter()
Returns information about the texture.
WebGLRenderingContext.isTexture()
Returns a Boolean indicating if the passed WebGLTexture is valid.
WebGLRenderingContext.texImage2D()
Specifies a 2D texture image.
WebGLRenderingContext.texSubImage2D()
Updates a sub-rectangle of the current WebGLTexture.
WebGLRenderingContext.texParameterf()
Sets texture parameters.
WebGLRenderingContext.texParameteri()
Sets texture parameters.

Programas e shaders

WebGLRenderingContext.attachShader()
Attaches a WebGLShader to a WebGLProgram.
WebGLRenderingContext.bindAttribLocation()
Binds a generic vertex index to a named attribute variable.
WebGLRenderingContext.compileShader()
Compiles a WebGLShader.
WebGLRenderingContext.createProgram()
Creates a WebGLProgram.
WebGLRenderingContext.createShader()
Creates a WebGLShader.
WebGLRenderingContext.deleteProgram()
Deletes a WebGLProgram.
WebGLRenderingContext.deleteShader()
Deletes a WebGLShader.
WebGLRenderingContext.detachShader()
Detaches a WebGLShader.
WebGLRenderingContext.getAttachedShaders()
Returns a list of WebGLShader objects attached to a WebGLProgram.
WebGLRenderingContext.getProgramParameter()
Returns information about the program.
WebGLRenderingContext.getProgramInfoLog()
Returns the information log for a WebGLProgram object.
WebGLRenderingContext.getShaderParameter()
Returns information about the shader.
WebGLRenderingContext.getShaderPrecisionFormat()
Returns a WebGLShaderPrecisionFormat object describing the precision for the numeric format of the shader.
WebGLRenderingContext.getShaderInfoLog()
Returns the information log for a WebGLShader object.
WebGLRenderingContext.getShaderSource()
Returns the source code of a WebGLShader as a string.
WebGLRenderingContext.isProgram()
Returns a Boolean indicating if the passed WebGLProgram is valid.
WebGLRenderingContext.isShader()
Returns a Boolean indicating if the passed WebGLShader is valid.
WebGLRenderingContext.linkProgram()
Links the passed WebGLProgram object.
WebGLRenderingContext.shaderSource()
Sets the source code in a WebGLShader.
WebGLRenderingContext.useProgram()
Uses the specified WebGLProgram as part the current rendering state.
WebGLRenderingContext.validateProgram()
Validates a WebGLProgram.

Uniforms e atributos

WebGLRenderingContext.disableVertexAttribArray()
Disables a vertex attribute array at a given position.
WebGLRenderingContext.enableVertexAttribArray()
Enables a vertex attribute array at a given position.
WebGLRenderingContext.getActiveAttrib()
Returns information about an active attribute variable.
WebGLRenderingContext.getActiveUniform()
Returns information about an active uniform variable.
WebGLRenderingContext.getAttribLocation()
Returns the location of an attribute variable.
WebGLRenderingContext.getUniform()
Returns the value of a uniform variable at a given location.
WebGLRenderingContext.getUniformLocation()
Returns the location of a uniform variable.
WebGLRenderingContext.getVertexAttrib()
Returns information about a vertex attribute at a given position.
WebGLRenderingContext.getVertexAttribOffset()
Returns the address of a given vertex attribute.
WebGLRenderingContext.uniform[1234][fi][v]()
Specifies a value for a uniform variable.
WebGLRenderingContext.uniformMatrix[234]fv()
Specifies a matrix value for a uniform variable.
WebGLRenderingContext.vertexAttrib[1234]f[v]()
Specifies a value for a generic vertex attribute.
WebGLRenderingContext.vertexAttribPointer()
Specifies the data formats and locations of vertex attributes in a vertex attributes array.

Drawing buffers

WebGLRenderingContext.clear()
Clears specified buffers to preset values.
WebGLRenderingContext.drawArrays()
Renders primitives from array data.
WebGLRenderingContext.drawElements()
Renders primitives from element array data.
WebGLRenderingContext.finish()
Blocks execution until all previously called commands are finished.
WebGLRenderingContext.flush()
Empties different buffer commands, causing all commands to be executed as quickly as possible.

Trabalhar com extensões

These methods manage WebGL extensions:

WebGLRenderingContext.getSupportedExtensions()
Returns an Array of DOMString elements with all the supported WebGL extensions.
WebGLRenderingContext.getExtension()
Returns an extension object.

Exemplos

WebGL context feature detection

This example demonstrates how to detect a WebGL rendering context and reports the result to the user.

<p>[ Here would go the result of WebGL feature detection ]</p>
<button>Press here to detect WebGLRenderingContext</button>
body {
  text-align : center;
}
button {
  display : block;
  font-size : inherit;
  margin : auto;
  padding : 0.6em;
}
// Run everything inside window load event handler, to make sure
// DOM is fully loaded and styled before trying to manipulate it.
window.addEventListener("load", function() {
  var paragraph = document.querySelector("p"),
    button = document.querySelector("button");
  // Adding click event handler to button.
  button.addEventListener("click", detectWebGLContext, false);
  function detectWebGLContext () {
    // Create canvas element. The canvas is not added to the
    // document itself, so it is never displayed in the
    // browser window.
    var canvas = document.createElement("canvas");
    // Get WebGLRenderingContext from canvas element.
    var gl = canvas.getContext("webgl")
      || canvas.getContext("experimental-webgl");
    // Report the result.
    if (gl && gl instanceof WebGLRenderingContext) {
      paragraph.innerHTML =
        "Congratulations! Your browser supports WebGL.";
    } else {
      paragraph.innerHTML = "Failed to get WebGL context. "
        + "Your browser or device may not support WebGL.";
    }
  }
}, false);

The source code of this example is also available on GitHub.

Effect of canvas size on rendering with WebGL

With scissor() and clear() we can demonstrate how the WebGL drawing buffer is affected by the size of the canvas.

The size of the first canvas is set to the styled Element size, determined by CSS. This is done by assigning the width and height properties of the canvas to the values of the clientWidth and clientHeight properties, respectively.

In contrast, no such assignment is done for the second canvas. The internal width and height properties of the canvas remain at default values, which are different than the actual size of the canvas Element in the browser window.

The effect is clearly visible when using scissor() and clear() to draw a square in the center of the canvas, by specifying its position and size in pixels. In the first canvas, we get the desired result. In the second, the square has the wrong shape, size, and position.

<p>Compare the two canvases.</p>
<canvas>Your browser does not seem to support 
    HTML5 canvas.</canvas>
<canvas>Your browser does not seem to support 
    HTML5 canvas.</canvas>
body {
  text-align : center;
}
canvas {
  display : inline-block;
  width : 120px;
  height : 80px;
  margin : auto;
  padding : 0;
  border : none;
  background-color : black;
}
window.addEventListener("load", function() {
  "use strict"
  var firstCanvas = document.getElementsByTagName("canvas")[0],
    secondCanvas = document.getElementsByTagName("canvas")[1];
  firstCanvas.width = firstCanvas.clientWidth;
  firstCanvas.height = firstCanvas.clientHeight;
  [firstCanvas, secondCanvas].forEach(function(canvas) {
    var gl = canvas.getContext("webgl")
      || canvas.getContext("experimental-webgl");
    if (!gl) {
      document.querySelector("p").innerHTML =
        "Failed to get WebGL context. "
        + "Your browser or device may not support WebGL.";
      return;
    }
    gl.viewport(0, 0,
      gl.drawingBufferWidth, gl.drawingBufferHeight);
    gl.enable(gl.SCISSOR_TEST);
    gl.scissor(30, 10, 60, 60);
    gl.clearColor(1.0, 1.0, 0.0, 1.0);
    gl.clear(gl.COLOR_BUFFER_BIT);
  });
}, false);

The source code of this example is also available on GitHub.

Especificações

Specification Status Comment
WebGL 1.0
The definition of 'WebGLRenderingContext' in that specification.
Recommendation Initial definition

Compatibilidade de navegador

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support91214111125.1
Available in workers No No442 No No No
activeTexture912411125.1
attachShader912411125.1
bindAttribLocation912411125.1
bindBuffer912411125.1
bindFramebuffer912411125.1
bindRenderbuffer912411125.1
bindTexture912411125.1
blendColor912411125.1
blendEquation912411125.1
blendEquationSeparate912411125.1
blendFunc912411125.1
blendFuncSeparate912411125.1
bufferData912411125.1
bufferSubData912411125.1
canvas912411125.1
checkFramebufferStatus912411125.1
clear912411125.1
clearColor912411125.1
clearDepth912411125.1
clearStencil912411125.1
colorMask912411125.1
commit No No442 No No No
compileShader912411125.1
compressedTexImage2D912411125.1
compressedTexSubImage2D912411125.1
copyTexImage2D912411125.1
copyTexSubImage2D912411125.1
createBuffer912411125.1
createFramebuffer912411125.1
createProgram912411125.1
createRenderbuffer912411125.1
createShader912411125.1
createTexture912411125.1
cullFace912411125.1
deleteBuffer912411125.1
deleteFramebuffer912411125.1
deleteProgram912411125.1
deleteRenderbuffer912411125.1
deleteShader912411125.1
deleteTexture912411125.1
depthFunc912411125.1
depthMask912411125.1
depthRange912411125.1
detachShader912411125.1
disable912411125.1
disableVertexAttribArray912411125.1
drawArrays912411125.1
drawElements912411125.1
drawingBufferHeight912411125.1
drawingBufferWidth912411125.1
enable912411125.1
enableVertexAttribArray912411125.1
finish912411125.1
flush912411125.1
framebufferRenderbuffer912411125.1
framebufferTexture2D912411125.1
frontFace912411125.1
generateMipmap912411125.1
getActiveAttrib912411125.1
getActiveUniform912411125.1
getAttachedShaders912411125.1
getAttribLocation912411125.1
getBufferParameter912411125.1
getContextAttributes912411125.1
getError912411125.1
getExtension912411125.1
getFramebufferAttachmentParameter912411125.1
getParameter912411125.1
getProgramInfoLog912411125.1
getProgramParameter912411125.1
getRenderbufferParameter912411125.1
getShaderInfoLog912411125.1
getShaderParameter912411125.1
getShaderPrecisionFormat912411125.1
getShaderSource912411125.1
getSupportedExtensions912411125.1
getTexParameter912411125.1
getUniform912411125.1
getUniformLocation912411125.1
getVertexAttrib912411125.1
getVertexAttribOffset912411125.1
hint912411125.1
isBuffer912411125.1
isContextLost912411125.1
isEnabled912411125.1
isFramebuffer912411125.1
isProgram912411125.1
isRenderbuffer912411125.1
isShader912411125.1
isTexture912411125.1
lineWidth No No No No No No
linkProgram912411125.1
pixelStorei912411125.1
polygonOffset912411125.1
readPixels912411125.1
renderbufferStorage912411125.1
sampleCoverage912411125.1
scissor912411125.1
shaderSource912411125.1
stencilFunc912411125.1
stencilFuncSeparate912411125.1
stencilMask912411125.1
stencilMaskSeparate912411125.1
stencilOp912411125.1
stencilOpSeparate912411125.1
texImage2D912411125.1
texParameterf912411125.1
texParameteri912411125.1
texSubImage2D912411125.1
uniform1f912411125.1
uniform1fv912411125.1
uniform1i912411125.1
uniform1iv912411125.1
uniform2f912411125.1
uniform2fv912411125.1
uniform2i912411125.1
uniform2iv912411125.1
uniform3f912411125.1
uniform3fv912411125.1
uniform3i912411125.1
uniform3iv912411125.1
uniform4f912411125.1
uniform4fv912411125.1
uniform4i912411125.1
uniform4iv912411125.1
uniformMatrix2fv912411125.1
uniformMatrix3fv912411125.1
uniformMatrix4fv912411125.1
useProgram912411125.1
validateProgram912411125.1
vertexAttrib1f912411125.1
vertexAttrib1fv912411125.1
vertexAttrib2f912411125.1
vertexAttrib2fv912411125.1
vertexAttrib3f912411125.1
vertexAttrib3fv912411125.1
vertexAttrib4f912411125.1
vertexAttrib4fv912411125.1
vertexAttribPointer912411125.1
viewport912411125.1
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidIE mobileOpera AndroidiOS Safari
Basic support Yes25 Yes1 Yes111128.1
Available in workers No No No No No No No
activeTexture Yes25 Yes Yes11128.1
attachShader Yes25 Yes Yes11128.1
bindAttribLocation Yes25 Yes Yes11128.1
bindBuffer Yes25 Yes Yes11128.1
bindFramebuffer Yes25 Yes Yes11128.1
bindRenderbuffer Yes25 Yes Yes11128.1
bindTexture Yes25 Yes Yes11128.1
blendColor Yes25 Yes Yes11128.1
blendEquation Yes25 Yes Yes11128.1
blendEquationSeparate Yes25 Yes Yes11128.1
blendFunc Yes25 Yes Yes11128.1
blendFuncSeparate Yes25 Yes Yes11128.1
bufferData Yes25 Yes Yes11128.1
bufferSubData Yes25 Yes Yes11128.1
canvas Yes25 Yes Yes11128.1
checkFramebufferStatus Yes25 Yes Yes11128.1
clear Yes25 Yes Yes11128.1
clearColor Yes25 Yes Yes11128.1
clearDepth Yes25 Yes Yes11128.1
clearStencil Yes25 Yes Yes11128.1
colorMask Yes25 Yes Yes11128.1
commit No No No No No No No
compileShader Yes25 Yes Yes11128.1
compressedTexImage2D Yes25 Yes Yes11128.1
compressedTexSubImage2D Yes25 Yes Yes11128.1
copyTexImage2D Yes25 Yes Yes11128.1
copyTexSubImage2D Yes25 Yes Yes11128.1
createBuffer Yes25 Yes Yes11128.1
createFramebuffer Yes25 Yes Yes11128.1
createProgram Yes25 Yes Yes11128.1
createRenderbuffer Yes25 Yes Yes11128.1
createShader Yes25 Yes Yes11128.1
createTexture Yes25 Yes Yes11128.1
cullFace Yes25 Yes Yes11128.1
deleteBuffer Yes25 Yes Yes11128.1
deleteFramebuffer Yes25 Yes Yes11128.1
deleteProgram Yes25 Yes Yes11128.1
deleteRenderbuffer Yes25 Yes Yes11128.1
deleteShader Yes25 Yes Yes11128.1
deleteTexture Yes25 Yes Yes11128.1
depthFunc Yes25 Yes Yes11128.1
depthMask Yes25 Yes Yes11128.1
depthRange Yes25 Yes Yes11128.1
detachShader Yes25 Yes Yes11128.1
disable Yes25 Yes Yes11128.1
disableVertexAttribArray Yes25 Yes Yes11128.1
drawArrays Yes25 Yes Yes11128.1
drawElements Yes25 Yes Yes11128.1
drawingBufferHeight Yes25 Yes Yes11128.1
drawingBufferWidth Yes25 Yes Yes11128.1
enable Yes25 Yes Yes11128.1
enableVertexAttribArray Yes25 Yes Yes11128.1
finish Yes25 Yes Yes11128.1
flush Yes25 Yes Yes11128.1
framebufferRenderbuffer Yes25 Yes Yes11128.1
framebufferTexture2D Yes25 Yes Yes11128.1
frontFace Yes25 Yes Yes11128.1
generateMipmap Yes25 Yes Yes11128.1
getActiveAttrib Yes25 Yes Yes11128.1
getActiveUniform Yes25 Yes Yes11128.1
getAttachedShaders Yes25 Yes Yes11128.1
getAttribLocation Yes25 Yes Yes11128.1
getBufferParameter Yes25 Yes Yes11128.1
getContextAttributes Yes25 Yes Yes11128.1
getError Yes25 Yes Yes11128.1
getExtension Yes25 Yes Yes11128.1
getFramebufferAttachmentParameter Yes25 Yes Yes11128.1
getParameter Yes25 Yes Yes11128.1
getProgramInfoLog Yes25 Yes Yes11128.1
getProgramParameter Yes25 Yes Yes11128.1
getRenderbufferParameter Yes25 Yes Yes11128.1
getShaderInfoLog Yes25 Yes Yes11128.1
getShaderParameter Yes25 Yes Yes11128.1
getShaderPrecisionFormat Yes25 Yes Yes11128.1
getShaderSource Yes25 Yes Yes11128.1
getSupportedExtensions Yes25 Yes Yes11128.1
getTexParameter Yes25 Yes Yes11128.1
getUniform Yes25 Yes Yes11128.1
getUniformLocation Yes25 Yes Yes11128.1
getVertexAttrib Yes25 Yes Yes11128.1
getVertexAttribOffset Yes25 Yes Yes11128.1
hint Yes25 Yes Yes11128.1
isBuffer Yes25 Yes Yes11128.1
isContextLost Yes25 Yes Yes11128.1
isEnabled Yes25 Yes Yes11128.1
isFramebuffer Yes25 Yes Yes11128.1
isProgram Yes25 Yes Yes11128.1
isRenderbuffer Yes25 Yes Yes11128.1
isShader Yes25 Yes Yes11128.1
isTexture Yes25 Yes Yes11128.1
lineWidth No No No No No No No
linkProgram Yes25 Yes Yes11128.1
pixelStorei Yes25 Yes Yes11128.1
polygonOffset Yes25 Yes Yes11128.1
readPixels Yes25 Yes Yes11128.1
renderbufferStorage Yes25 Yes Yes11128.1
sampleCoverage Yes25 Yes Yes11128.1
scissor Yes25 Yes Yes11128.1
shaderSource Yes25 Yes Yes11128.1
stencilFunc Yes25 Yes Yes11128.1
stencilFuncSeparate Yes25 Yes Yes11128.1
stencilMask Yes25 Yes Yes11128.1
stencilMaskSeparate Yes25 Yes Yes11128.1
stencilOp Yes25 Yes Yes11128.1
stencilOpSeparate Yes25 Yes Yes11128.1
texImage2D Yes25 Yes Yes11128.1
texParameterf Yes25 Yes Yes11128.1
texParameteri Yes25 Yes Yes11128.1
texSubImage2D Yes25 Yes Yes11128.1
uniform1f Yes25 Yes Yes11128.1
uniform1fv Yes25 Yes Yes11128.1
uniform1i Yes25 Yes Yes11128.1
uniform1iv Yes25 Yes Yes11128.1
uniform2f Yes25 Yes Yes11128.1
uniform2fv Yes25 Yes Yes11128.1
uniform2i Yes25 Yes Yes11128.1
uniform2iv Yes25 Yes Yes11128.1
uniform3f Yes25 Yes Yes11128.1
uniform3fv Yes25 Yes Yes11128.1
uniform3i Yes25 Yes Yes11128.1
uniform3iv Yes25 Yes Yes11128.1
uniform4f Yes25 Yes Yes11128.1
uniform4fv Yes25 Yes Yes11128.1
uniform4i Yes25 Yes Yes11128.1
uniform4iv Yes25 Yes Yes11128.1
uniformMatrix2fv Yes25 Yes Yes11128.1
uniformMatrix3fv Yes25 Yes Yes11128.1
uniformMatrix4fv Yes25 Yes Yes11128.1
useProgram Yes25 Yes Yes11128.1
validateProgram Yes25 Yes Yes11128.1
vertexAttrib1f Yes25 Yes Yes11128.1
vertexAttrib1fv Yes25 Yes Yes11128.1
vertexAttrib2f Yes25 Yes Yes11128.1
vertexAttrib2fv Yes25 Yes Yes11128.1
vertexAttrib3f Yes25 Yes Yes11128.1
vertexAttrib3fv Yes25 Yes Yes11128.1
vertexAttrib4f Yes25 Yes Yes11128.1
vertexAttrib4fv Yes25 Yes Yes11128.1
vertexAttribPointer Yes25 Yes Yes11128.1
viewport Yes25 Yes Yes11128.1

1. To access the WebGL context, use experimental-webgl rather than the standard webgl identifier.

2. From version 44: this feature is behind the gfx.offscreencanvas.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.

Consulte também

Etiquetas do documento e contribuidores

 Contribuidores para esta página: mansil
 Última atualização por: mansil,