Bridge.WebGL
Contains data returned by getActiveAttrib or getActiveUniform calls.
Represents the name of the data variable requested with a getActiveUniform or getActiveAttrib call.
Represents the size of the data returned by getActiveUniform or getActiveAttrib calls.
Represents the type of data returned by a getActiveUniform or getActiveAttrib call.
Represents a buffer object that contains numeric data such as vertices or colors.
The WebGLBuffer object does not define any members.
A dictionary object of attributes used to initialize the context for the first time.
Gets or sets whether the drawing buffer has an alpha channel for alpha compositing and operations.
Get or set the antialias state on a WebGL rendering context.
Gets or sets whether the drawing buffer has a depth buffer. Returns false if no depth buffer exists.
A flag that sets whether WebGL creates a context with getContext if system performance is low.
Gets or sets whether the colors in the drawing buffer are premultiplied alpha values. This property is ignored if the alpha property is false.
Sets or gets whether the drawing buffer's is cleared once content is presented.
Represents a collection of buffers that serve as a rendering destination.
The WebGLFramebuffer object does not define any members.
Provides the precision, rangeMin, and rangeMax properties returned by the getShaderPrecisionFormat method.
Represents the precision in bits for a given data type.
Gets the maximum positive value in log base 2 that can be represented by a type.
Returns the base 2 log of the absolute value of the minimum value that can be represented.
Represents the programmable WebGL pipeline and associated shader programs.
The WebGLProgram object does not define any members.
Represents a buffer which can contain an image and act as the source or target of a render operation.
The WebGLRenderbuffer object does not define any members.
A renderbuffer stores data that represents a single image. A renderbuffer object can be attached to a framebuffer object and used to store either stencil data or a combination of stencil and depth data.
WebGLRenderingContext objects expose the WebGLRenderingContext interface, the principal interface in WebGL which provides special properties and methods to manipulate the 3D content rendered in an HTML canvas element.
The docs sources are:
https://www.khronos.org/registry/webgl/specs/1.0/
https://www.khronos.org/opengles/sdk/docs/man/
https://developer.mozilla.org/ru/docs/Web/API/WebGLRenderingContext
https://msdn.microsoft.com/en-us/library/ie/dn621085%28v=vs.85%29.aspx
WebGLRenderingContext objects expose the WebGLRenderingContext interface, the principal interface in WebGL which provides special properties and methods to manipulate the 3D content rendered in an HTML canvas element.
The docs sources are:
https://www.khronos.org/registry/webgl/specs/1.0/
https://www.khronos.org/opengles/sdk/docs/man/
https://developer.mozilla.org/ru/docs/Web/API/WebGLRenderingContext
https://msdn.microsoft.com/en-us/library/ie/dn621085%28v=vs.85%29.aspx
WebGLRenderingContext objects expose the WebGLRenderingContext interface, the principal interface in WebGL which provides special properties and methods to manipulate the 3D content rendered in an HTML canvas element.
The docs sources are:
https://www.khronos.org/registry/webgl/specs/1.0/
https://www.khronos.org/opengles/sdk/docs/man/
https://developer.mozilla.org/ru/docs/Web/API/WebGLRenderingContext
https://msdn.microsoft.com/en-us/library/ie/dn621085%28v=vs.85%29.aspx
Passed to clear() to clear the current depth buffer
Passed to clear() to clear the current stencil buffer
Passed to clear() to clear the current color buffer
Draws a single dot per vertex. For example, 12 vertices produce 12 dots.
Draws a line between a pair of vertices. For example, 12 vertices produce 6 separate lines.
Similar to gl.LINE_STRIP, but connects the last vertex back to the first. For example, 12 vertices produce 12 straight lines. Not as efficient as gl.LINES, and incurs a conversion cost.
Draws a line to the next by a straight line. For example, 12 vertices produce 11 lines connected end to end.
Draws a triangle for each group of three consecutive vertices. For example, 12 vertices create 4 separate triangles.
Creates a strip of triangles where each additional vertex creates an additional triangle once the first three vertices have been drawn. For example, 12 vertices create 10 triangles.
Similar to gl.TRIANGLE_STRIP, but creates a fan shaped output. For example 12 vertices create 10 triangles. May incur a conversion cost.
The destination depends on the method that the constant is passed to.
Factor: 1 1 1 1
Multiplies all colors by 1.
Factror: Rs Gs Bs As
Multiply by source color value.
Factor: (1-Rs) (1-Gs) (1-Bs) (1-As)
Multiply by 1 minus each color value.
Factor: Rd Gd Bd Ad
Multiply by destination color value.
Factor: (1-Rd) (1-Gd) (1-Bd) (1-Ad)
Multiply by 1 minus each color value.
Factor: As As As As
Multiply all colors by source alpha value.
Factor: (1-As) (1-As) (1-As) (1-As)
Multiply all colors by 1 minus source alpha value.
Factor: Ad Ad Ad Ad
Multiply all colors by source alpha value.
Factor: (1-Ad) (1-Ad) (1-Ad) (1-Ad)
Multiply all colors by 1 minus destination alpha value.
Factor: min(As, Ad) min(As,Ad) min(As,Ad) 1
Multiply by the smaller of either source or destination alpha value.
Passed to depthFunction() or stencilFunction() to specify depth or stencil tests will never pass. i.e. nothing will be drawn.
Passed to depthFunction() or stencilFunction() to specify depth or stencil tests will pass if the new depth value is less than the stored value.
Passed to depthFunction() or stencilFunction() to specify depth or stencil tests will pass if the new depth value is less than the stored value.
Passed to depthFunction() or stencilFunction() to specify depth or stencil tests will pass if the new depth value is equals to the stored value.
Passed to depthFunction() or stencilFunction() to specify depth or stencil tests will pass if the new depth value is less than or equal to the stored value.
Passed to depthFunction() or stencilFunction() to specify depth or stencil tests will pass if the new depth value is greater than the stored value.
Passed to depthFunction() or stencilFunction() to specify depth or stencil tests will pass if the new depth value is greater than or equal to the stored value.
Passed to depthFunction() or stencilFunction() to specify depth or stencil tests will pass if the new depth value is not equal to the stored value.
Passed to blendFuncSeparate to specify an addition blend function.
Passed to getParameter to get the current rgb blend function. Same as BLEND_EQUATION
Passed to getParameter to get the current alpha blend function.
Passed to bendFuncSeparate to specify a subtraction blend function (source - destination).
Passed to bendFuncSeparate to specify a reverse subtraction blend function (destination - source).
Passed to getParameter to get the current destination rgb blend function.
Passed to getParameter to get the current destination rgb blend function.
Passed to getParameter to get the current destination alpha blend function.
Passed to getParameter to get the current source alpha blend function.
Passed to blendFunc to specify a constant color blend function.
Passed to blendFunc to specify one minus a constant color blend function.
Passed to blendFunc to specify a constant alpha blend function.
Passed to blendFunc to specify one minus a constant alpha blend function.
Passed to getParameter to return a the current blend color.
Passed to bindBuffer or bufferData to specify the type of buffer being used.
Passed to bindBuffer or bufferData to specify the type of buffer being used.
Passed to getVertexAttrib to recall a buffer.
Passed to getParameter to get the current element array buffer.
Passed to bufferData as a hint about whether the contents of the buffer are likely to not be used often.
Passed to bufferData as a hint about whether the contents of the buffer are likely to be used often and not change often.
Passed to bufferData as a hint about whether the contents of the buffer are likely to be used often and change often.
Passed to getBufferParameter to get a buffer's size.
Passed to getBufferParameter to get the hint for the buffer passed in when it was created.
Passed to getVertexAttrib to read back the current vertex attribute.
Passed to cullFace to specify that only front faces should be drawn.
Passed to cullFace to specify that only back faces should be drawn.
Passed to cullFace to specify that front and back faces should be drawn.
Passed to enable()/disable() to turn on/off culling. Can also be used with getParameter to find the current culling method.
Passed to enable()/disable() to turn on/off blending. Can also be used with getParameter() to find the current blending method.
Passed to enable()/disable() to turn on/off dithering. Can also be used with getParameter to find the current dithering method.
Passed to enable()/disable() to turn on/off the stencil test. Can also be used with getParameter to query the stencil test.
Passed to enable()/disable() to turn on/off the depth test. Can also be used with getParameter to query the depth test.
Passed to enable()/disable() to turn on/off the scissor test. Can also be used with getParameter to query the scissor test.
Passed to enable()/disable() to turn on/off the polygon offset. Useful for rendering hidden-line images, decals, and or solids with highlighted edges.
Passed to enable()/disable() to turn on/off the alpha to coverage. Used in multi-sampling alpha channels.
Passed to enable()/disable() to turn on/off the sample coverage. Used in multi-sampling.
No error has been recorded. This can occur if getError has been called previously, and continues until the error has been corrected.
An unacceptable value for an enumerated argument was specified.
A number that was passed is out of range. The unacceptable value is ignored.
The specified operation isn't allowed for the current state. The command is ignored.
The command requires more memory than is available. After this error is reported, the state of the WebGL context is undefined except for error flags.
Passed to frontFace to specify the front face of a polygon is drawn inthe clockwise direction
Passed to frontFace to specify the front face of a polygon is drawn inthe counter clockwise direction
Passed to getParameter to get the current lineWidth (set by the lineWidth method).
Passed to getParamter to get the current size of a point drawn with gl.POINTS.
Passed to getParamter to get the range of available widths for a line. Returns a length-2 array with the lo value at 0, and hight at 1.
Passed to getParameter to get the current value of cullFace. Should return FRONT, BACK, or FRONT_AND_BACK
Passed to getParameter to determine the current value of frontFace. Should return CW or CCW.
Passed to getParameter to return a length-2 array of floats giving the current depth range.
Passed to getParameter to determine if the depth write mask is enabled.
Passed to getParameter to determine the current depth clear value.
Passed to getParamter to get the current depth function. Returns NEVER, ALWAYS, LESS, EQUAL, LEQUAL, GREATER, GEQUAL, or NOTEQUAL.
Passed to getParamter to get the value the stencil will be cleared to.
Passed to getParameter to get the current stencil function. Returns NEVER, ALWAYS, LESS, EQUAL, LEQUAL, GREATER, GEQUAL, or NOTEQUAL.
Passed to getParameter to get the current stencil fail function. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP.
Passed to getParamter to get the current stencil fail function should the depth buffer test fail. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP.
Passed to getParameter to get the current stencil fail function should the depth buffer test pass. Should return KEEP, REPLACE, INCR, DECR, INVERT, INCR_WRAP, or DECR_WRAP.
Passed to getParameter to get the reference value used for stencil tests.
Passed to getParameter to get the mask that is used to mask both the stencil reference value and the stencil buffer value before they are compared for front-facing polygons and non-polygons.
The initial value is all 1's. See glStencilFunc and glStencilFuncSeparate.
Passed to getParameter to get the mask that controls writing of the stencil bitplanes for front-facing polygons and non-polygons.
The initial value is all 1's. See glStencilMask and glStencilMaskSeparate.
Passed to getParameter to get
Passed to getParameter to get a symbolic constant indicating what function is used for back-facing polygons to compare the stencil reference value with the stencil buffer value.
The initial value is GL_ALWAYS. See glStencilFuncSeparate.
Passed to getParameter to get a symbolic constant indicating what action is taken for back-facing polygons when the stencil test passes, but the depth test fails.
The initial value is GL_KEEP. See glStencilOpSeparate.
Passed to getParameter to get a symbolic constant indicating what action is taken for back-facing polygons when the stencil test passes and the depth test passes.
The initial value is GL_KEEP. See glStencilOpSeparate.
Passed to getParameter to get the reference value that is compared with the contents of the stencil buffer for back-facing polygons.
The initial value is 0. See glStencilFuncSeparate.
Passed to getParameter to get the mask that is used for back-facing polygons to mask both the stencil reference value and the stencil buffer value before they are compared.
The initial value is all 1's. See glStencilFuncSeparate.
Passed to getParameter to get the mask that controls writing of the stencil bitplanes for back-facing polygons.
The initial value is all 1's. See glStencilMaskSeparate.
Passed to getParameter to get the viewport, i.e. the x and y window coordinates of the viewport, followed by its width and height. Initially the x and y window coordinates are both set to 0,
and the width and height are set to the width and height of the window into which the GL will do its rendering.
See glViewport.
Passed to getParameter to get the scissor box, i.e. the x and y window coordinates of the scissor box, followed by its width and height.
Initially the x and y window coordinates are both 0, and the width and height are set to the size of the window.
See glScissor.
Passed to getParameter to get the red, green, blue, and alpha values used to clear the color buffers. Integer values, if requested, are linearly mapped from the internal floating-point representation such that 1.0 returns the most positive representable integer value,
and -1.0 returns the most negative representable integer value.
The initial value is (0, 0, 0, 0).
See glClearColor.
Passed to getParameter to get the red, green, blue, and alpha write enables for the color buffers.
The initial value is (GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE).
See glColorMask.
Passed to getParameter to get the byte alignment used for reading pixel data from memory.
The initial value is 4.
See glPixelStorei.
Passed to getParameter to get the byte alignment used for writing pixel data to memory.
The initial value is 4.
See glPixelStorei.
Passed to getParameter to get The value gives a rough estimate of the largest texture that the GL can handle. The value must be at least 64.
See glTexImage2D.
Passed to getParameter to get the maximum supported width and height of the viewport. These must be at least as large as the visible dimensions of the display being rendered to.
See glViewport.
Passed to getParameter to get an estimate of the number of bits of subpixel resolution that are used to position rasterized geometry in window coordinates. The value must be at least 4.
Passed to getParameter to get the number of red bitplanes in the color buffer of the currently bound framebuffer.
Passed to getParameter to get the number of green bitplanes in the color buffer of the currently bound framebuffer.
Passed to getParameter to get the number of blue bitplanes in the color buffer of the currently bound framebuffer.
Passed to getParameter to get the number of alpha bitplanes in the color buffer of the currently bound framebuffer.
Passed to getParameter to get the number of bitplanes in the depth buffer of the currently bound framebuffer.
Passed to getParameter to get the number of bitplanes in the stencil buffer of the currently bound framebuffer.
Passed to getParameter to get the value that is multiplied by an implementation-specific value and then added to the depth value of each fragment generated when a polygon is rasterized.
The initial value is 0.
See glPolygonOffset.
Passed to getParameter to get the scaling factor used to determine the variable offset that is added to the depth value of each fragment generated when a polygon is rasterized.
The initial value is 0.
See glPolygonOffset.
Passed to getParameter to get the name of the texture currently bound to the target GL_TEXTURE_2D for the active multitexture unit.
The initial value is 0.
See glBindTexture.
Passed to getParameter to get
Passed to getParameter to get a single integer value indicating the number of sample buffers associated with the currently bound framebuffer.
See glSampleCoverage.
Passed to getParameter to get a single positive floating-point value indicating the current sample coverage value.
See glSampleCoverage.
Passed to getParameter to get a single boolean value indicating if the temporary coverage value should be inverted.
See glSampleCoverage.
Passed to getParameter to get a list of symbolic constants of length GL_NUM_COMPRESSED_TEXTURE_FORMATS indicating which compressed texture formats are available.
See glCompressedTexImage2D.
No preference.
See glHint.
The most efficient option should be chosen.
See glHint.
The most correct, or highest quality, option should be chosen.
See glHint.
Passed to getParameter to get a symbolic constant indicating the mode of the mipmap generation filtering hint.
The initial value is GL_DONT_CARE.
See glHint.
The byte data type
The unsigned byte data type
The short data type
The unsigned short data type
The int data type
The unsigned int data type
The float data type
To be used for depth textures.
See texImage2D.
Each element is a single alpha component. The system converts it to floating point, clamped to the range [0, 1], and assembles it into an RGBA element by placing attaching 0.0 to the red, green and blue channels.
See texImage2D.
Red, green, and blue channels.
See texImage2D.
Red, green, blue, and alpha (transparency) channels.
See texImage2D.
Each element is a single luminance component. The system converts it to floating point value, clamped to the range [0, 1], and assembles it into an RGBA element by placing the luminance value in the red, green and blue channels, and attaching 1.0 to the alpha channel.
See texImage2D.
Each element is an luminance/alpha double. The systems converts each component to floating point, clamped to the range [0, 1], and assembles them into an RGBA element by placing the luminance value in the red, green and blue channels.
See texImage2D.
Represents colors in a Uint16Array where red = 4 bits, green=4 bits, blue=4 bits, and alpha=4 bits.
See texImage2D.
Represents colors in a Uint16Array where red = 5 bits, green=5 bits, blue=5 bits and alpha=1 bit.
See texImage2D.
Represents colors in a Uint16Array where red = 5 bits, green=6 bits, and blue=5 bits.
See texImage2D.
Passed to createShader to define a fragment shader.
Passed to createShader to define a vertex shader
Passed to getParameter to get the maximum number of 4-component generic vertex attributes accessible to a vertex shader. The value must be at least 8.
See glVertexAttrib.
Passed to getParameter to get the maximum number of four-element floating-point, integer, or boolean vectors that can be held in uniform variable storage for a vertex shader. The value must be at least 128.
See glUniform.
Passed to getParameter to get the maximum number four-element floating-point vectors available for interpolating varying variables used by vertex and fragment shaders. Varying variables declared as matrices or arrays will consume multiple interpolators. The value must be at least 8.
Passed to getParameter to get the maximum supported texture image units that can be used to access texture maps from the vertex shader and the fragment processor combined.
If both the vertex shader and the fragment processing stage access the same texture image unit, then that counts as using two texture image units against this limit.
The value must be at least 8.
See glActiveTexture.
Passed to getParameter to get the maximum supported texture image units that can be used to access texture maps from the vertex shader. The value may be 0.
See glActiveTexture.
Passed to getParameter to get the maximum supported texture image units that can be used to access texture maps from the fragment shader.
The value must be at least 8.
See glActiveTexture.
Passed to getParameter to get the maximum number of four-element floating-point, integer, or boolean vectors that can be held in uniform variable storage for a fragment shader.
The value must be at least 16.
See glUniform.
Passed to getShaderParameter as pname.
Passed to getShaderParameter to determine if a shader was deleted via deleteShader. Returns true if it was, false otherwise.
Passed to getProgramParameter after calling linkProgram to determine if a program was linked correctly. Returns false if there were errors. Use getProgramInfoLog to find the exact error.
Passed to getProgramParameter after calling validateProgram to determine if it is valid. Returns false if errors were found.
Passed to getProgramParameter after calling attachShader to determine if the shader was attached correctly. Returns false if errors occurred.
Passed to getProgramParameter to get the number of uniforms active in a program.
Passed to getProgramParameter to get the number of attributes active in a program.
Passed to getParameter to get the name of the program object that is currently active, or 0 if no program object is active.
See glUseProgram.
Passed to stencilOp. Keeps the current value.
Passed to stencilOp. Sets the stencil buffer value to ref, as specified by glStencilFunc.
Passed to stencilOp. Increments the current stencil buffer value. Clamps to the maximum representable unsigned value.
Passed to stencilOp. Decrements the current stencil buffer value. Clamps to 0.
Passed to stencilOp. Bitwise inverts the current stencil buffer value.
Passed to stencilOp. Increments the current stencil buffer value. Wraps stencil buffer value to zero when incrementing the maximum representable unsigned value.
Passed to stencilOp. Decrements the current stencil buffer value. Wraps stencil buffer value to the maximum representable unsigned value when decrementing a stencil buffer value of zero.
Passed to getParameter to get the company responsible for this WebGL implementation. This name does not change from release to release.
Passed to getParameter to get the name of the renderer. This name is typically specific to a particular configuration of a hardware platform. It does not change from release to release.
Passed to getParameter to get a version or release number of the form WebGL<space>1.0<space><vendor-specific information>.
Passed to getParameter to get a version or release number of the form WebGL $lt;space$gt;GLSL$lt;space$gt;ES$lt;space$gt;1.0$lt;space$gt;$lt;vendor-specific information$gt;.
Returns the value of the texture element that is nearest (in Manhattan distance) to the center of the pixel being textured.
See glTexParameter.
Returns the weighted average of the four texture elements that are closest to the center of the pixel being textured.
See glTexParameter.
Chooses the mipmap that most closely matches the size of the pixel being textured and uses the GL_NEAREST criterion (the texture element nearest to the center of the pixel) to produce a texture value.
See glTexParameter.
Chooses the mipmap that most closely matches the size of the pixel being textured and uses the GL_LINEAR criterion (a weighted average of the four texture elements that are closest to the center of the pixel) to produce a texture value.
See glTexParameter.
Chooses the two mipmaps that most closely match the size of the pixel being textured and uses the GL_NEAREST criterion (the texture element nearest to the center of the pixel) to produce a texture value from each mipmap. The final texture value is a weighted average of those two values.
See glTexParameter.
Chooses the two mipmaps that most closely match the size of the pixel being textured and uses the GL_LINEAR criterion (a weighted average of the four texture elements that are closest to the center of the pixel) to produce a texture value from each mipmap. The final texture value is a weighted average of those two values.
See glTexParameter.
The texture magnification function is used when the pixel being textured maps to an area less than or equal to one texture element.
It sets the texture magnification function to either GL_NEAREST or GL_LINEAR (see below). GL_NEAREST is generally faster than GL_LINEAR,
but it can produce textured images with sharper edges because the transition between texture elements is not as smooth.
The initial value of GL_TEXTURE_MAG_FILTER is GL_LINEAR.
See glTexParameter.
The texture minifying function is used whenever the pixel being textured maps to an area greater than one texture element.
There are six defined minifying functions. Two of them use the nearest one or nearest four texture elements to compute the texture value. The other four use mipmaps.
See glTexParameter.
Sets the wrap parameter for texture coordinate s.
See glTexParameter.
Sets the wrap parameter for texture coordinate t.
See glTexParameter.
Represents a 2D image.
See glTexParameter.
Represents a texture.
See glTexParameter.
The texture is composed of six 2D images, one for each face of a cube.
See glTexParameter.
Passed to getParameter to get the name of the texture currently bound to the target GL_TEXTURE_CUBE_MAP for the active multitexture unit.
The initial value is 0.
See glBindTexture.
Image for the positive X face of the cube map.
See texImage2D.
Image for the negative X face of the cube map.
See texImage2D.
Image for the positive Y face of the cube map.
See texImage2D.
Image for the negative Y face of the cube map.
See texImage2D.
Image for the positive Z face of the cube map.
See texImage2D.
Image for the negative Z face of the cube map.
See texImage2D.
Passed to getParameter to get the value gives a rough estimate of the largest cube-map texture that the GL can handle.
The value must be at least 16.
See glTexImage2D.
The texture number that is returned by getParameter(ACTIVE_TEXTURE) call.
The texture number that is returned by getParameter(ACTIVE_TEXTURE) call.
The texture number that is returned by getParameter(ACTIVE_TEXTURE) call.
The texture number that is returned by getParameter(ACTIVE_TEXTURE) call.
The texture number that is returned by getParameter(ACTIVE_TEXTURE) call.
The texture number that is returned by getParameter(ACTIVE_TEXTURE) call.
The texture number that is returned by getParameter(ACTIVE_TEXTURE) call.
The texture number that is returned by getParameter(ACTIVE_TEXTURE) call.
The texture number that is returned by getParameter(ACTIVE_TEXTURE) call.
The texture number that is returned by getParameter(ACTIVE_TEXTURE) call.
The texture number that is returned by getParameter(ACTIVE_TEXTURE) call.
The texture number that is returned by getParameter(ACTIVE_TEXTURE) call.
The texture number that is returned by getParameter(ACTIVE_TEXTURE) call.
The texture number that is returned by getParameter(ACTIVE_TEXTURE) call.
The texture number that is returned by getParameter(ACTIVE_TEXTURE) call.
The texture number that is returned by getParameter(ACTIVE_TEXTURE) call.
The texture number that is returned by getParameter(ACTIVE_TEXTURE) call.
The texture number that is returned by getParameter(ACTIVE_TEXTURE) call.
The texture number that is returned by getParameter(ACTIVE_TEXTURE) call.
The texture number that is returned by getParameter(ACTIVE_TEXTURE) call.
The texture number that is returned by getParameter(ACTIVE_TEXTURE) call.
The texture number that is returned by getParameter(ACTIVE_TEXTURE) call.
The texture number that is returned by getParameter(ACTIVE_TEXTURE) call.
The texture number that is returned by getParameter(ACTIVE_TEXTURE) call.
The texture number that is returned by getParameter(ACTIVE_TEXTURE) call.
The texture number that is returned by getParameter(ACTIVE_TEXTURE) call.
The texture number that is returned by getParameter(ACTIVE_TEXTURE) call.
The texture number that is returned by getParameter(ACTIVE_TEXTURE) call.
The texture number that is returned by getParameter(ACTIVE_TEXTURE) call.
The texture number that is returned by getParameter(ACTIVE_TEXTURE) call.
The texture number that is returned by getParameter(ACTIVE_TEXTURE) call.
Passed to getParameter to get the active multitexture unit.
The initial value is GL_TEXTURE0.
See glActiveTexture.
The wrap parameter for texture coordinate.
REPEAT causes the integer part of the coordinate to be ignored.
See glTexParameter.
The wrap parameter for texture coordinates.
CLAMP_TO_EDGE causes coordinates to be clamped.
See glTexParameter.
The wrap parameter for texture coordinate.
MIRRORED_REPEAT causes the s coordinate to be set to the fractional part of the texture coordinate.
See glTexParameter.
The uniform variable type
The uniform variable type
The uniform variable type
The uniform variable type
The uniform variable type
The uniform variable type
The uniform variable type
The uniform variable type
The uniform variable type
The uniform variable type
The uniform variable type
The uniform variable type
The uniform variable type
The uniform variable type
Passed to the getVertexAttrib to get a single value that is non-zero (true) if the vertex attribute array for index is enabled and 0 (false) if it is disabled.
The initial value is GL_FALSE.
Passed to the getVertexAttrib to get a single value, the size of the vertex attribute array for index. The size is the number of values for each element of the vertex attribute array, and it will be 1, 2, 3, or 4.
The initial value is 4.
Passed to the getVertexAttrib to get a single value, the array stride for (number of bytes between successive elements in) the vertex attribute array for index. A value of 0 indicates that the array elements are stored sequentially in memory.
The initial value is 0.
Passed to the getVertexAttrib to get a single value, a symbolic constant indicating the array type for the vertex attribute array for index.
Possible values are GL_BYTE, GL_UNSIGNED_BYTE, GL_SHORT, GL_UNSIGNED_SHORT, GL_FIXED and GL_FLOAT.
The initial value is GL_FLOAT.
Passed to the getVertexAttrib to get a single value that is non-zero (true) if fixed-point data types for the vertex attribute array indicated by index are normalized when they are converted to floating point, and 0 (false) otherwise.
The initial value is GL_FALSE.
Passed to the vertexAttribPointer to get the address of the specified generic vertex attribute pointer.
Passed to the getVertexAttrib to get the the name of the buffer object currently bound to he binding point corresponding to generic vertex attribute array index.
If no buffer object is bound, 0 is returned.
The initial value is 0.
Passed to getParameter to get the type chosen by the implementation with which pixels may be read from the color buffer of the currently bound framebuffer in conjunction with GL_IMPLEMENTATION_COLOR_READ_FORMAT.
In addition to this implementation-dependent format/type pair, format GL_RGBA in conjunction with type GL_UNSIGNED_BYTE is always allowed by every implementation, regardless of the currently bound render surface.
See glReadPixels.
Passed to getParameter to get the format chosen by the implementation in which pixels may be read from the color buffer of the currently bound framebuffer in conjunction with GL_IMPLEMENTATION_COLOR_READ_TYPE.
In addition to this implementation-dependent format/type pair, format GL_RGBA in conjunction with type GL_UNSIGNED_BYTE is always allowed by every implementation, regardless of the currently bound render surface.
See glReadPixels.
Passed to getShaderParameter to get the status of the compilation. Returns false if the shader was not compiled. You can then query getShaderInfoLog to find the exact error.
The shader precision type. See getShaderPrecisionFormat.
The shader precision type. See getShaderPrecisionFormat.
The shader precision type. See getShaderPrecisionFormat.
The shader precision type. See getShaderPrecisionFormat.
The shader precision type. See getShaderPrecisionFormat.
The shader precision type. See getShaderPrecisionFormat.
Passed to bindFramebuffer as a target.
Passed to bindRenderbuffer as a target.
RGBA with 4 bits per channel.
See renderbufferStorage.
RGBA value with 5 bits for RGB and 1 bit for Alpha.
See renderbufferStorage.
RGB value with 5 bits red, 6 bits green, and 5 bits blue respectively.
See renderbufferStorage.
16 bit Depth component.
See renderbufferStorage.
The stencil-renderable format of the renderbuffer.
See renderbufferStorage.
The stencil-renderable format of the renderbuffer.
See renderbufferStorage.
Call renderbufferStorage with the DEPTH_STENCIL internal format to attach both depth and stencil buffers to a framebuffer object.
Passed to getRenderbufferParameter to get the width (in pixels).
Passed to getRenderbufferParameter to get The height (in pixels).
Passed to getRenderbufferParameter to get the internal format for the image.
Passed to getRenderbufferParameter to get the resolution size (in bits) for the red component.
Passed to getRenderbufferParameter to get the resolution size (in bits) for the green component.
Passed to getRenderbufferParameter to get the resolution size (in bits) for the blue component.
Passed to getRenderbufferParameter to get the resolution size (in bits) for the alpha component.
Passed to getRenderbufferParameter to get the resolution size (in bits) for the depth component.
Passed to getRenderbufferParameter to get the resolution size (in bits) for the stencil component.
Passed to getFramebufferAttachmentParameter to get the type of object which contains the attached image, either GL_RENDERBUFFER, GL_TEXTURE, or if no image is attached, GL_NONE.
The initial value is GL_NONE.
Passed to getFramebufferAttachmentParameter as a parameter name.
If the value of GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is GL_RENDERBUFFER, params returns the name of the renderbuffer object which contains the attached image.
If the value of GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is GL_TEXTURE, params returns the name of the texture object which contains the attached image.
The initial value is zero.
Passed to getFramebufferAttachmentParameter as a parameter name.
If the value of GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is GL_TEXTURE, params returns the mipmap level of the texture object which contains the attached image.
The initial value is zero.
Passed to getFramebufferAttachmentParameter as a parameter name.
If the value of GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is GL_TEXTURE and GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME is the name of a cube-map texture, params returns the cube map face of the cube-map texture object which contains the attached image.
If the attached image is from a texture object but not a cube-map, params returns 0.
The initial value is GL_TEXTURE_CUBE_MAP_POSITIVE_X.
Passed to getFramebufferAttachmentParam as an attacment type.
Passed to getFramebufferAttachmentParam as an attacment type.
Passed to getFramebufferAttachmentParam as an attacment type.
Passed to getFramebufferAttachmentParam as an attacment type.
The None constant
The frame buffer is ready to display. A possible return value of a checkFramebufferStatus call.
The attachment types are mismatched. A possible return value of a checkFramebufferStatus call.
There is no attachment. A possible return value of a checkFramebufferStatus call.
The height and width of the attachments are not the same. A possible return value of a checkFramebufferStatus call.
The attachments aren't supported. A possible return value of a checkFramebufferStatus call.
Passed to getParameter to get the name of the currently bound framebuffer.
The initial value is 0, indicating the default framebuffer.
See glBindFramebuffer.
Passed to getParameter to get the name of the currently bound renderbuffer.
The initial value is 0, indicating no renderbuffer is bound.
See glBindRenderbuffer.
Passed to getParameter to get the value indicates the largest renderbuffer width and height that the GL can handle.
The value must be at least 1.
See glRenderbufferStorage.
The command is trying to render to or read from the framebuffer while the currently bound framebuffer is not framebuffer complete (i.e. the return value from glCheckFramebufferStatus is not GL_FRAMEBUFFER_COMPLETE).
The offending command is ignored and has no other side effect than to set the error flag.
Flips the source data along its vertical axis when texImage2D or texSubImage2D are called when param is true. The initial value for param is false.
See pixelStorei.
Multiplies the alpha channel, if it exists, into the other color channels during the data transfer when texImage2D or texSubImage2D are called when param is true. The initial value for param is false.
See pixelStorei.
If WebGL context is lost, this error is returned on the first call to getError. Subsequent calls return NO_ERROR until context is restored.
The browser's default colorspace conversion is applied when texImage2D or texSubImage2D are called with an HTMLImageElement texture data source. The initial value for param is BROWSER_DEFAULT_WEBGL. No colorspace conversion is applied when set to NONE.
See pixelStorei.
If set to BROWSER_DEFAULT_WEBGL, then the browser's default colorspace conversion is applied during subsequent texImage2D and texSubImage2D calls taking HTMLImageElement. The precise conversions may be specific to both the browser and file type. If set to NONE, no colorspace conversion is applied. The initial value is BROWSER_DEFAULT_WEBGL.
See pixelStorei.
Specifies the active texture unit.
Errors:
gl.INVALID_ENUM - Texture isn't in the format of gl.TEXTUREi where i is within the range from 0 to gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS -1.
The texture unit to make active. Value is gl.TEXTUREi where i is in the range from 0 to gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS -1.
Attaches a WebGLShader object to a WebGLProgram object.
Errors:
gl.INVALID_OPERATION
If program isn't a program object.
If shader isn't a shader object.
If shader is already attached to program, or another shader object of the same type is already attached.
gl.INVALID_VALUE - If either program or shader isn't a value generated by WebGL.
The WebGLProgram object created using the createProgram method.
The WebGLShader object to attach.
Binds a generic vertex index to a user-defined attribute variable.
More than one name can be bound to the same vertex index, but multiple indexes cannot be bound to the same name.
If name is a matrix attribute, then index points to the first column of the matrix. Additional matrix columns are automatically bound to index+1, index+2, and so forth based on matrix variable (mat2,mat3,mat4).
Errors:
gl.INVALID_VALUE If index is greater than or equal to gl.MAX_VERTEX_ATTRIBS.
gl.INVALID_VALUE If program is not generated by WebGL.
gl.INVALID_OPERATION If name starts with the reserved prefix gl_.
gl.INVALID_OPERATION If program isn't a program object.
Program object to bind.
The index of the generic vertex to bind.
me of the user variable to a bind to the generic vertex index.
Associates a buffer with a buffer target.
One of the following: gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER
A WebGLBuffer object to bind to target.
Associates a WebGLFramebuffer object with the gl.FRAMEBUFFER bind target.
The currently bound framebuffer is the target of drawing operations. If the framebuffer is null, the context reverts to the default framebuffer.
Errors:
gl.INVALID_ENUM - If target isn't gl.FRAMEBUFFER.
The target the WebGLFramebuffer object is bound to. Must be gl.FRAMEBUFFER.
The WebGLFramebuffer object.
Binds a WebGLRenderbuffer object to be used for rendering.
Setting this to a null value effectively unbinds any previously bound WebGLRenderbuffer.
When a buffer is bound to a target, the previously bound Renderbuffer for that target is automatically unbound.
Errors:
gl.INVALID_ENUM - If target isn't gl.FRAMEBUFFER.
Set to gl.RENDERBUFFER.
The name of the new WebGLRenderbuffer.
Binds a named texture object to a target.
Errors:
gl.INVALID_ENUM If target isn't one of the listed values..
gl.INVALID_OPERATION If texture was created with different target than target.
gl.TEXTURE_2D or gl.TEXTURE_CUBE_MAP
Either a reference to a texture object or null.
Specifies the blend color used to calculate source and destination blending.
Red component in the range of 0-1.
Green component in the range of 0-1.
Blue component in the range of 0-1.
Alpha (transparency) component in the range of 0-1.
Sets the equation used to blend RGB and Alpha values of an incoming source fragment with a destination values as stored in the fragment's frame buffer.
Errors:
gl.INVALID_ENUM - If mode is not one of the three possible values.
One of these values: gl.FUNC_ADD, gl.FUNC_SUBTRACT, gl.FUNC_REVERSE_SUBTRACT
Controls the blending of an incoming source fragment's R, G, B, and A values with a destination R, G, B, and A values as stored in the fragment's WebGLFramebuffer.
Blending is dependent on the incoming fragment's alpha value of the currently stored pixel.
Errors:
gl.INVALID_ENUM - If modeRGB or modeAlpha are not one of the three possible values.
One of these values: gl.FUNC_ADD, gl.FUNC_SUBTRACT, gl.FUNC_REVERSE_SUBTRACT
One of these values: gl.FUNC_ADD, gl.FUNC_SUBTRACT, gl.FUNC_REVERSE_SUBTRACT
Sets the blending factors used to combine source and destination pixels.
The blending function is calculated like this: color(RGBA) = ((source color) * sfactor) + ((destination color) * dfactor). Values of colors are between 0 and 1 for each RGB value. Alpha values are between 1 (fully opaque) and 0 (fully transparent).
Possible sfactor and dfactors multipliers are: ZERO, ONE, SRC_COLOR, ONE_MINUS_SRC_COLOR, DST_COLOR, ONE_MINUS_DST_COLOR, SRC_ALPHA, ONE_MINUS_SRC_ALPHA, DST_ALPHA, ONE_MINUS_DST_ALPHA, SRC_ALPHA_SATURATE
Errors:
gl.INVALID_ENUM - If the sfactor or the dfactor isn't one of the listed values.
A multiplier for the source color.
A multiplier for destination color.
Sets the weighting factors that are used by blendEquationSeparate.
Possible values for multipliers: ZERO, ONE, SRC_COLOR, ONE_MINUS_SRC_COLOR, DST_COLOR, ONE_MINUS_DST_COLOR, SRC_ALPHA, ONE_MINUS_SRC_ALPHA, DST_ALPHA, ONE_MINUS_DST_ALPHA
Errors:
gl.INVALID_ENUM - If the srcRGB or the srcAlpha isn't one of the listed values.
A multiplier for the source color.
A multiplier for the destination color.
A multiplier for the source alpha.
A multiplier for the destination alpha.
Creates a buffer in memory and initializes it with array data. If no array is provided, the contents of the buffer is initialized to 0.
BufferData deletes any existing data store and sets the state variables gl.BUFFER_SIZE and gl.BUFFER_USAGE to the new values.
Errors:
gl.OUT_OF_MEMORY - If WebGL can't create the buffer to the requested size.
Set to gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER.
The size of the buffer to initialize
One of the following values:
gl.STATIC_DRAW The data store contents are modified once, and used many times as the source for WebGL drawing commands.
gl.DYNAMIC_DRAW The data store contents are repeatedly respecified, and used many times as the source for WebGL drawing commands.
gl.STREAM_DRAW The data store contents are specified once, and used occasionally as the source of a WebGL drawing command.
Usage is provided only as a performance hint. The usage value doesn't restrict the way the data store is used.
Creates a buffer in memory and initializes it with array data. If no array is provided, the contents of the buffer is initialized to 0.
BufferData deletes any existing data store and sets the state variables gl.BUFFER_SIZE and gl.BUFFER_USAGE to the new values.
Errors:
gl.OUT_OF_MEMORY - If WebGL can't create the buffer to the requested size.
Set to gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER.
An array of data points
One of the following values:
gl.STATIC_DRAW The data store contents are modified once, and used many times as the source for WebGL drawing commands.
gl.DYNAMIC_DRAW The data store contents are repeatedly respecified, and used many times as the source for WebGL drawing commands.
gl.STREAM_DRAW The data store contents are specified once, and used occasionally as the source of a WebGL drawing command.
Usage is provided only as a performance hint. The usage value doesn't restrict the way the data store is used.
Creates a buffer in memory and initializes it with array data. If no array is provided, the contents of the buffer is initialized to 0.
BufferData deletes any existing data store and sets the state variables gl.BUFFER_SIZE and gl.BUFFER_USAGE to the new values.
Errors:
gl.OUT_OF_MEMORY - If WebGL can't create the buffer to the requested size.
Set to gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER.
An array of data points
One of the following values:
gl.STATIC_DRAW The data store contents are modified once, and used many times as the source for WebGL drawing commands.
gl.DYNAMIC_DRAW The data store contents are repeatedly respecified, and used many times as the source for WebGL drawing commands.
gl.STREAM_DRAW The data store contents are specified once, and used occasionally as the source of a WebGL drawing command.
Usage is provided only as a performance hint. The usage value doesn't restrict the way the data store is used.
Used to modify or update some or all of a data store for a bound buffer object.
Errors:
gl.INVALID_VALUE If the new data writes past the end of the buffer.
gl_INVALID_ENUM If the target is not GL_ARRAY_BUFFER or GL_ELEMENT_ARRAY_BUFFER.
glINVALID_OPERATION No buffer is bound to target.
The bind target of the buffer to update. Set to ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER.
The offset in bytes where data replacement begins. Must be greater than or equal to 0.
The new data to be copied into the buffer.
Returns whether the currently bound WebGLFramebuffer is complete. If not complete, returns the reason why.
One of the following:
gl.FRAMEBUFFER_COMPLETE The frame buffer is ready to display.
gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT The attachment types are mismatched.
gl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT There is no attachment.
gl.FRAMEBUFFER_INCOMPLETE_DIMENSIONS The height and width of the attachments are not the same.
gl.FRAMEBUFFER_UNSUPPORTED The attachments aren't supported.
Errors:
gl.INVALID_ENUM - If the target isn't gl.FRAMEBUFFER.
The following constant - gl.FRAMEBUFFER
The current status of WebGLFramebuffer
Sets all pixels in a specific buffer to the same value.
The mask parameter contains one or both (OR'd together) of the following values:
gl.DEPTH_BUFFER_BIT Clears the depth buffer
gl.STENCIL_BUFFER_BIT Clears the stencil buffer
gl.COLOR_BUFFER_BIT Clears the color buffer
The clear method sets the buffer to values preselected by clearColor, clearDepth, or clearStencil. If a buffer doesn't exist, this method has no effect.
The clear function can be used to clear the stencil buffer either by itself or in conjunction with other buffers (such as the color or depth buffers).
You can set a stencil write mask prior to clearing the stencil buffer, and the stencil write mask will be respected during the clear operation. This also applies to when the stencil test is disabled.
Examples:
gl.clear(gl.DEPTH_BUFFER_BIT);
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
Errors:
gl.INVALID_VALUE If any bit other than the ones listed are defined in mask.
gl.INVALID_FRAMEBUFFER_OPERATION framebuffer or renderbuffer is in valid.
Contains one or both (OR'd together) of the buffer bits.
Specifies color values to use by the clear method to clear the color buffer.
The parameters must be in the range of 0 - 1. The default value is 0.
The red component.
The green component.
The blue component.
The alpha component.
Clears the depth buffer to a specific value.
Value in the range of 0 to 1 to clear the depth buffer to.
Specifies the clear value to be used by the clear method to clear the stencil buffer.
The s parameter is masked with 2m - 1, where m is the number of bits in the stencil buffer.
A value in the range of 0 to 1 to clear the stencil buffer to. Default value is 0.
Lets you set whether individual colors can be written when drawing or rendering to a framebuffer.
The default value of parameters is true, all colors can be written to the framebuffer.
false on any parameter disables that color from being written.
The red component
The green component
The blue component
The alpha component
Compiles the GLSL shader source into binary data used by the WebGLProgram object.
When compiling shader source code, call getShaderParameter to get the status. getShaderParameter returns true if the source compiled successfully, or false if compilation failed. On failure, call getShaderInfoLog for the shader compiler's log. Errors are contained in the log.
Errors:
gl.INVALID_VALUE The shader isn't a WebGLShader object.
The shader is not generated by WebGL.
gl.INVALID_OPERATION The shader compiler isn't supported.
An object that represents source code strings.
Specifies a two-dimensional texture image or cube Map image from compressed image data. You must call getExtension("WEBGL_compressed_texture_s3tc") to enable compressed textures before calling this method.
Errors:
gl.INVALID_VALUE If internalFormat does not equal one of the specified values.
gl.INVALID_OPERATION If width or height are not a multiple of 4.
gl.INVALID_ENUM If target isn't one of the specified values.
gl.INVALID_ENUM If internalFormat isn't a supported format.
gl.INVALID_VALUE If width or width is less than 0 or greater than gl.MAX_TEXTURE_SIZE.
gl.INVALID_VALUE If border is not 0.
The target texture. One of the following:
gl.TEXTURE_2D Uses a 2D image.
gl.TEXTURE_CUBE_MAP_POSITIVE_X Image for the positive X face of the cube map.
gl.TEXTURE_CUBE_MAP_NEGATIVE_X Image for the negative X face of the cube map.
gl.TEXTURE_CUBE_MAP_POSITIVE_Y Image for the positive Y face of the cube map.
gl.TEXTURE_CUBE_MAP_NEGATIVE_Y Image for the negative Y face of the cube map.
gl.TEXTURE_CUBE_MAP_POSITIVE_Z Image for the positive Z face of the cube map.
gl.TEXTURE_CUBE_MAP_NEGATIVE_Z Image for the negative Z face of the cube map.
The level of detail. Level 0 equals the base image level.
The image format of the compressed image stored in memory. Use one of the following:
COMPRESSED_RGB_S3TC_DXT1_EXT The byteLength of data (ArrayBufferView) in pixels that's passed must be match the equation floor((width + 3) / 4) * floor((height + 3) / 4) * 8
COMPRESSED_RGBA_S3TC_DXT1_EXT The byteLength of data (ArrayBufferView) in pixels that's passed must be match the equation floor((width + 3) / 4) * floor((height + 3) / 4) * 8
COMPRESSED_RGBA_S3TC_DXT3_EXT The byteLength of data (ArrayBufferView) in pixels that's passed must be match the equation floor((width + 3) / 4) * floor((height + 3) / 4) * 16
COMPRESSED_RGBA_S3TC_DXT5_EXT The byteLength of data (ArrayBufferView) in pixels that's passed must be match the equation floor((width + 3) / 4) * floor((height + 3) / 4) * 16
The width of the texture image. A 2D texture image needs to be at least 64 texels wide, and cube-mapped texture images should be 16 texels wide.
The height of the texture image. A 2D texture image needs to be at least 64 texels high, and cube-mapped texture images should be 16 texels high.
Width of border.
Object that contains the image data.
Specifies a two-dimensional texture or cube Map sub-image from compressed image data. You must call getExtension("WEBGL_compressed_texture_s3tc") to enable compressed textures before calling this method.
The target texture. One of the following:
gl.TEXTURE_2D Uses a 2D image.
gl.TEXTURE_CUBE_MAP_POSITIVE_X Image for the positive X face of the cube map.
gl.TEXTURE_CUBE_MAP_NEGATIVE_X Image for the negative X face of the cube map.
gl.TEXTURE_CUBE_MAP_POSITIVE_Y Image for the positive Y face of the cube map.
gl.TEXTURE_CUBE_MAP_NEGATIVE_Y Image for the negative Y face of the cube map.
gl.TEXTURE_CUBE_MAP_POSITIVE_Z Image for the positive Z face of the cube map.
gl.TEXTURE_CUBE_MAP_NEGATIVE_Z Image for the negative Z face of the cube map.
The level of detail. Level 0 equals the base image level.
The horizontal offset of the image in the texture array.
The vertical offset of the image in the texture array.
The width of the subimage texture.
The height of the subimage texture.
The format or extension of the compressed image. This must be the same format specified previously by compressedTexImage2D. Possible values:
COMPRESSED_RGB_S3TC_DXT1_EXT The byteLength of data (ArrayBufferView) in pixels that's passed must be match the equation floor((width + 3) / 4) * floor((height + 3) / 4) * 8
COMPRESSED_RGBA_S3TC_DXT1_EXT The byteLength of data (ArrayBufferView) in pixels that's passed must be match the equation floor((width + 3) / 4) * floor((height + 3) / 4) * 8
COMPRESSED_RGBA_S3TC_DXT3_EXT The byteLength of data (ArrayBufferView) in pixels that's passed must be match the equation floor((width + 3) / 4) * floor((height + 3) / 4) * 16
COMPRESSED_RGBA_S3TC_DXT5_EXT The byteLength of data (ArrayBufferView) in pixels that's passed must be match the equation floor((width + 3) / 4) * floor((height + 3) / 4) * 16
Copies a rectangle of pixels from the current WebGLFramebuffer into a texture image.
CopyTexImage2D doesn't support floating point texture sources or destinations.
Errors:
gl.INVALID_ENUM Value of target is not one of the specified constants.
gl.INVALID_VALUE The value of level is < 0.
If xoffset is < 0.
If yoffset is < 0.
If xoffset + width is greater than the width of the image being modified.
If yoffset + height is greater than the height of the image being modified.
If width or if height is < 0.
gl.INVALID_OPERATION No WebGLTexture is bound.
gl.INVALID_FRAMEBUFFER_OPERATION The currently bound WebGLFramebuffer is not framebuffer complete
checkFramebufferStatus does not return gl.FRAMEBUFFER_COMPLETE
The currently bound WebGLRenderbuffer is invalid.
The target texture. One of the following:
gl.TEXTURE_2D Uses a 2D image.
gl.TEXTURE_CUBE_MAP_POSITIVE_X Image for the positive X face of the cube map.
gl.TEXTURE_CUBE_MAP_NEGATIVE_X Image for the negative X face of the cube map.
gl.TEXTURE_CUBE_MAP_POSITIVE_Y Image for the positive Y face of the cube map.
gl.TEXTURE_CUBE_MAP_NEGATIVE_Y Image for the negative Y face of the cube map.
gl.TEXTURE_CUBE_MAP_POSITIVE_Z Image for the positive Z face of the cube map.
gl.TEXTURE_CUBE_MAP_NEGATIVE_Z Image for the negative Z face of the cube map.
The level of detail. Level 0 equals the base image level. Additional levels (n) equal the nth mipmap reduction image. See generateMipmap to create mipmaps.
Specifies the internal format of the texture.
gl.ALPHA Each element is a single alpha component. The system converts it to floating point, clamped to the range [0, 1], and assembles it into an RGBA element by placing attaching 0.0 to the red, green and blue channels.
gl.LUMINANCE Each element is a single luminance component. The system converts it to floating point value, clamped to the range [0, 1], and assembles it into an RGBA element by placing the luminance value in the red, green and blue channels, and attaching 1.0 to the alpha channel.
gl.LUMINANCE_ALPHA Each element is an luminance/alpha double. The systems converts each component to floating point, clamped to the range [0, 1], and assembles them into an RGBA element by placing the luminance value in the red, green and blue channels.
gl.RGB Red, green, and blue channels.
gl.RGBA Red, green, blue, and alpha (transparency) channels.
Horizontal coordinate of the lower left corner of the pixels to copy.
Vertical coordinate of the lower left corner of the pixels to copy.
The width of the rectangle or box you want to copy from. A 2D texture image needs to be at least 64 texels wide, and cube-mapped texture images should be 16 texels wide.
The height of the rectangle or box you want to copy from. A 2D texture image needs to be at least 64 texels high, and cube-mapped texture images should be 16 texels high.
Width of border.
Replaces a portion of an existing 2D texture image with data from the current framebuffer.
CopyTexImage2D doesn't support floating point texture sources or destinations.
Errors:
gl.INVALID_ENUM Value of target is not one of the specified constants.
gl.INVALID_VALUE The value of level is < 0.
If xoffset is < 0.
If yoffset is < 0.
If xoffset + width is greater than the width of the image being modified.
If yoffset + height is greater than the height of the image being modified.
If width or if height is < 0.
gl.INVALID_OPERATION No WebGLTexture is bound.
gl.INVALID_FRAMEBUFFER_OPERATION The currently bound WebGLFramebuffer is not framebuffer complete
checkFramebufferStatus does not return gl.FRAMEBUFFER_COMPLETE
The target texture. One of the following:
gl.TEXTURE_2D Uses a 2D image.
gl.TEXTURE_CUBE_MAP_POSITIVE_X Image for the positive X face of the cube map.
gl.TEXTURE_CUBE_MAP_NEGATIVE_X Image for the negative X face of the cube map.
gl.TEXTURE_CUBE_MAP_POSITIVE_Y Image for the positive Y face of the cube map.
gl.TEXTURE_CUBE_MAP_NEGATIVE_Y Image for the negative Y face of the cube map.
gl.TEXTURE_CUBE_MAP_POSITIVE_Z Image for the positive Z face of the cube map.
gl.TEXTURE_CUBE_MAP_NEGATIVE_Z Image for the negative Z face of the cube map.
The level of detail. Level 0 equals the base image level. Additional levels (n) equal the nth mipmap reduction image. See generateMipmap to create mipmaps.
The horizontal offset of the image in the texture array.
The vertical offset of the image in the texture array.
Horizontal coordinate of the lower left corner of the pixels to copy.
Vertical coordinate of the lower left corner of the pixels to copy.
The width of the texture subimage.
Creates and initializes a WebGLBuffer.
The buffer object.
Returns a WebGLFramebuffer object.
The framebuffer object.
Creates an empty WebGLProgram object to which vector and fragment WebGLShader objects can be bound.
Return a 0 if an error occurs creating a program object.
A program object or 0 if error
Creates and returns a WebGLRenderbuffer object.
The render buffer object.
Returns an empty vertex or fragment shader object based on the type specified.
Errors:
gl.INVALID_ENUM The shader type is not an accepted value.
Either gl.FRAGMENT_SHADER or gl.VERTEX_SHADER constants.
Shader object of type fragment or vertex shader.
Used to generate a WebGLTexture object to which images can be bound.
Texture object.
Sets whether or not front, back, or both facing facets are able to be culled.
Sets which facets are candidates for culling.
gl.FRONT
gl.BACK
gl.FRONT_AND_BACK
Delete a specific buffer.
If a buffer has already been deleted, this method has no effect.
The buffer to delete
Deletes a specific WebGLFramebuffer object. If you delete the currently bound framebuffer, the default framebuffer will be bound. Deleting a framebuffer detaches all of its attachments.
If a buffer has already been deleted, this method has no effect.
Framebuffer object to delete.
Flags a specific WebGLProgram object for deletion if currently active. It will be deleted when it is no longer being used. Any shader objects associated with the program will be detached. They will be deleted if they were already flagged for deletion.
The program to be deleted.
Deletes the specified renderbuffer object. If the renderbuffer is currently bound, it will become unbound. If the renderbuffer is attached to the currently bound framebuffer, it is detached.
If renderbuffer has previously been deleted, this method has no effect.
The renderbuffer object to delete.
Deletes a specific shader object.
If shader is attached to a program object, it's flagged for deletion until it's no longer attached to the object. A shader needs to be detached with detachShader before it can be deleted.
Errors:
gl.INVALID_VALUE If the shader isn't generated by WebGL.
The shader to delete
Deletes a specific texture object.
If texture is currently bound is deleted, the binding reverts to a default 0 value texture.
The texture to delete
Sets a function to use to compare incoming pixel depth to the current depth buffer value.
Errors:
gl.INVALID_ENUM If func is not from the listed values.
Sets conditions for pixels to be drawn. Use one of the following comparison values:
gl.NEVER Incoming value never passes.
gl.LESS Pass if the incoming value is less than the depth buffer value.
gl.EQUAL Pass if the incoming value is equal to the depth buffer value.
gl.LEQUAL Pass if the incoming value is less than or equal to the depth buffer value.
gl.GREATER Pass if the incoming value is greater than the depth buffer value.
gl.NOTEQUAL Pass if the incoming value isn't equal to the depth buffer value.
gl.GEQUAL Pass if the incoming value is greater than or equal to the depth buffer value.
gl.ALWAYS Always pass, regardless of value.
Sets whether or not you can write to the depth buffer.
true - you can write to the depth buffer.
false - you can't write to the depth buffer.
Sets the depth range for normalized coordinates to canvas or viewport depth coordinates.
Errors:
gl.INVALID_OPERATION If the zNear value is greater than zFar.
Value between 0 - 1, and less than or equal to zFar. Initial value of 0.
Value in the range of 0 - 1. Initial value of 1.
Detach a shader object from a program object.
If the shader is flagged for deletion by deleteShader, it's deleted after it's removed.
The program object that contains the shader to detach.
The shader to detach.
Turns off specific WebGL capabilities for this context.
Errors:
gl.INVALID_ENUM If capability is not from the listed values.
One of the following values:
gl.BLEND Don't blend computed fragment color values with color buffer values.
gl.DEPTH_TEST Don't update the depth buffer, including when the depth buffer exists and the depth mask is non-zero.
gl.CULL_FACE Don't cull polygons. see cullFace.
gl.POLYGON_OFFSET_FILL Don't add an offset to the depth values of a polygon's fragments.
gl.SCISSOR_TEST Don't discard fragments outside a scissor rectangle.
Turns off a vertex attribute array at a specific index position.
Errors:
gl.INVALID_VALUE If the index is negative or greater than the gl.MAX_VERTEX_ATTRIBS.
Index of the vertex attribute to disable.
Render geometric primitives from bound and enabled vertex data.
Errors:
gl.INVALID_ENUM If mode is not an accepted value.
gl.INVALID_VALUE If count is negative.
gl.INVALID_FRAMEBUFFER_OPERATION If the currently bound WebGLFramebuffer is not framebuffer complete or the WebGLRenderbuffer is invalid.
gl.INVALID_OPERATION The vertex attribute is enabled but no buffer is bound or if first + count goes past the end of the vertex attribute array.
Specifies the kind of geometric primitives to render from a given set of vertex attributes.
gl.POINTS Draws a single dot per vertex. For example, 10 vertices produce 10 dots.
gl.LINES Draws a line between a pair of vertices. For example, 10 vertices produce 5 separate lines.
gl.LINE_STRIP Draws a line to the next vertex by a straight line. For example, 10 vertices produce 9 lines connected end to end.
gl.LINE_LOOP Similar to gl.LINE_STRIP, but connects the last vertex back to the first. For example, 10 vertices produce 10 straight lines.
gl.TRIANGLES Draws a triangle for each group of three consecutive vertices. For example, 12 vertices create 4 separate triangles.
gl.TRIANGLE_STRIP Creates a strip of triangles where each additional vertex creates an additional triangle once the first three vertices have been drawn. For example, 12 vertices create 10 triangles.
gl.TRIANGLE_FAN Similar to gl.TRIANGLE_STRIP, but creates a fan shaped output. For example 12 vertices create 10 triangles.
The first element to render in the array of vector points.
The number of vector points to render. For example, a triangle would be 3.
Renders geometric primitives indexed by element array data.
Specifies the kind of primitives to render.
gl.POINTS Draws a single dot per vertex. For example, 10 vertices produce 10 dots.
gl.LINES Draws a line between a pair of vertices. For example, 10 vertices produce 5 separate lines.
gl.LINE_STRIP Draws a line to the next vertex by a straight line. For example, 10 vertices produce 9 lines connected end to end.
gl.LINE_LOOP Similar to gl.LINE_STRIP, but connects the last vertex back to the first. For example, 10 vertices produce 10 straight lines.
gl.TRIANGLES Draws a triangle for each group of three consecutive vertices. For example, 12 vertices create 4 separate triangles.
gl.TRIANGLE_STRIP Creates a strip of triangles where each additional vertex creates an additional triangle once the first three vertices have been drawn. For example, 12 vertices create 10 triangles.
gl.TRIANGLE_FAN Similar to gl.TRIANGLE_STRIP, but creates a fan shaped output. For example 12 vertices create 10 triangles.
The number of elements to render.
The type of elements in the element array buffer. Must be a gl.UNSIGNED_SHORT.
Offset into the element array buffer. Must be a valid multiple of the size of type.
Turns on specific WebGL capabilities for this context.
Errors:
gl.INVALID_ENUM If capability is not from the listed values.
One of the following values:
gl.BLEND Don't blend computed fragment color values with color buffer values.
gl.DEPTH_TEST Don't update the depth buffer, including when the depth buffer exists and the depth mask is non-zero.
gl.CULL_FACE Don't cull polygons. see cullFace.
gl.POLYGON_OFFSET_FILL Don't add an offset to the depth values of a polygon's fragments.
gl.SCISSOR_TEST Don't discard fragments outside a scissor rectangle.
Turns on a vertex attribute at a specific index position in a vertex attribute array.
All client-side capabilities are disabled by default, including all vertex attribute arrays.
Errors:
gl.INVALID_VALUE If the index is negative or greater than the gl.MAX_VERTEX_ATTRIBS.
Index of the vertex attribute to enable.
Attaches a WebGLRenderbuffer object as a logical buffer to the currently bound WebGLFramebuffer object.
Always use gl.FRAMEBUFFER.
Specifies the attachment point. One of the following:
gl.COLOR_ATTACHMENT0
gl.DEPTH_ATTACHMENT
gl.STENCIL_ATTACHEMENT
gl.DEPTH_STENCIL_ATTACHEMENT
Always use gl.RENDERBUFFER.
The WebGLRenderbuffer object to attach.
Attaches a texture to a WebGLFramebuffer object.
Errors:
gl.INVALID_ENUM If textarget isn't from the listed values, and texture isn't 0.
If target isn't gl.FRAMEBUFFER.
If attachment isn't from the listed values.
gl.INVALID_OPERATION If the default framebuffer object name 0 is bound.
If texture isn't 0 or the name of an existing texture object
Always use gl.FRAMEBUFFER.
Specifies the attachment point. One of the following:
gl.COLOR_ATTACHMENT0
gl.DEPTH_ATTACHMENT
gl.STENCIL_ATTACHEMENT
gl.DEPTH_STENCIL_ATTACHEMENT
The texture target:
gl.TEXTURE_2D Uses a 2D image.
gl.TEXTURE_CUBE_MAP_POSITIVE_X Image for the positive X face of the cube.
gl.TEXTURE_CUBE_MAP_NEGATIVE_X Image for the negative X face of the cube.
gl.TEXTURE_CUBE_MAP_POSITIVE_Y Image for the positive Y face of the cube.
gl.TEXTURE_CUBE_MAP_NEGATIVE_Y Image for the negative Y face of the cube.
gl.TEXTURE_CUBE_MAP_POSITIVE_Z Image for the positive Z face of the cube.
gl.TEXTURE_CUBE_MAP_NEGATIVE_Z Image for the negative Z face of the cube.
WebGLTexture object with image to attach.
The mipmap level of the texture image to attach. Always set to 0.
Sets whether or not polygons are considered front-facing based on their winding direction.
A polygon has a clockwise winding if an imaginary object following a path moves in a clockwise direction from the first vertex, second vertex, and so forth, to the last vertex, and then back to the first vertex. It's counterclockwise winding if it moves in the opposite direction.
To turn rendering of back-facing polygons on or off, call enable or disable using CULL_FACE as the argument.
Errors:
gl.INVALID_ENUM Mode is not CW or CCW.
Sets orientation of front-facing polygons.
gl.CCW Initial value. Counterclockwise winding.
gl.CW Clockwise winding.
Creates a set of textures for a WebGLTexture object with image dimensions from the original size of the image down to a 1x1 image.
A mipmap is used to simulate distance with objects. A high-resolution mipmap image is used for objects that are close to the user. Lower-resolution images are used as the object appears farther away. Using mipmaps improves the quality of rendered textures at the expense of using more memory.
The internal format of a mipmap array is the same as the zero level texture image. Each level is half the resolution of the previous level, until a 1x1 dimension texture image is created.
Errors:
gl.INVALID_ENUM target isn't specified as gl.TEXTURE_2D or gl.TEXTURE_CUBE_MAP.
gl.INVALID_OPERATION If the width or height of the zero level (original texture) array is not a power of two.
The texture target of the active texture unit.
gl.TEXTURE_2D
gl.TEXTURE_CUBE_MAP
Returns an WebGLActiveInfo object containing the size, type, and name of a vertex attribute at a specific index position in a program object.
Errors:
gl.INVALID_VALUE The value of program is not generated by WebGL.
The value of index is greater than or equal to the number of active attribute variables in program.
gl.INVALID_OPERATION The value program is not a valid program object.
The program object containing the vertex attribute of interest.
The index of the attribute. Index is zero based. Passing 0 selects the first attribute, while gl.ACTIVE_ATTRIBUTES - 1 specifies the last attribute.
A WebGLActiveInfo object.
Returns an WebGLActiveInfo object containing the size, type, and name of a uniform attribute at a specific index position in a program object.
Errors:
gl.INVALID_VALUE The value of program is not generated by WebGL.
The value of index is greater than or equal to the number of active uniforms in program.
gl.INVALID_OPERATION The program is not a valid program object.
The program object containing the uniform attribute of interest.
The index of the uniform. The index is zero based. Passing 0 selects the first uniform, while ACTIVE_ATTRIBUTES - 1 specifies the last uniform.
A WebGLActiveInfo object.
Returns a list of WebGLShaders bound to a WebGLProgram.
The WebGLProgram object from which to get list of WebGLShaders
Array of the WebGLShaders that are bound to program.
Returns an index to the location in a program of a named attribute variable.
If name is a matrix variable, index points to the first column of the matrix.
The program object.
The name of the attribute variable.
The location of the attribute variable name if found. Returns a -1 if not.
Returns the type of a parameter for a given buffer.
Errors:
gl.INVALID_ENUM target or value are not acceptable values
gl.INVALID_OPERATION The reserved buffer object name 0 is bound to target.
One of the following: gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER
One of the following: gl.BUFFER_SIZE or gl.BUFFER_USAGE
The type of parameter
Returns an object that describes the attributes set on a context when it was created.
An object that contains the attributes. See WebGLContextAttributes for more info.
Returns a value for the WebGL error flag and clears the flag.
No additional errors are recorded until this method is called. When you call getError, it returns the error code and resets the error flag.
Possible errors:
OUT_OF_MEMORY The command requires more memory than is available. After this error is reported, the state of the WebGL context is undefined except for error flags.
INVALID_ENUM An unacceptable value for an enumerated argument was specified.
INVALID_OPERATION The specified operation isn't allowed for the current state. The command is ignored.
INVALID_FRAMEBUFFER_OPERATION The command is attempting to read or render from a framebuffer that is not framebuffer complete. A call to checkFramebufferStatus doesn't return gl.FRAMEBUFFER_COMPLETE.
INVALID_VALUE A number that was passed is out of range. The unacceptable value is ignored.
CONTEXT_LOST_WEBGL If WebGL context is lost, this error is returned on the first call to getError. Subsequent calls return NO_ERROR until context is restored.
NO_ERROR No error has been recorded. This can occur if getError has been called previously, and continues until the error has been corrected.
Error code.
Enables a passed extension, otherwise returns null.
Returns null if an extension isn't supported.
A case-insensitive name of the extension.
OES_texture_float When enabled, allows 128bits-per-pixel texture components rather than 32bit to be used with texImage2D and texSubImage2D. Call getExtension("gl.OES_texture_float"). When using floating-point textures, linear filtering isn't supported, only nearest filtering.
EXT_texture_filter_anisotropic 0x84FE Call getExtension("gl.EXT_texture_filter_anisotropic") to enable. When enabled provides anisotropic filtering functionality. Anisotropic filtering enhances image quality for textures at oblique viewing angles. For more info, see Anisotropic filtering.
Object that contains any existing constants or functions defined in the extension, or null.
Gets a parameter value for a given target and attachment.
Defines what the target is. Must be the constant gl.FRAMEBUFFER.
One of the following:
gl.COLOR_ATTACHMENT0
gl.DEPTH_ATTACHMENT
gl.STENCIL_ATTACHMENT
gl.DEPTH_STENCIL_ATTACHMENT
The name of the attachment parameter to get.
gl.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
gl.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME
gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL
gl.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE
The parameter value
Returns the natural type value for a constant parameter.
Errors:
gl.INVALID_ENUM If pname isn't an accepted value.
Parameter to look up.
The parameter value
Returns information about the last error that occurred during the failed linking or validation of a WebGL program object.
This method returns the last error that occurred during program linking or validation. WebGL reports one error at a time, and won't return another error until the reported error has been corrected.
Errors:
gl.INVALID_VALUE If program isn't a WebGL object.
gl.INVALID_OPERATION If program isn't a program object.
The program object to get the information for.
The information (error, warning, or informational messages), or an empty string if none. Returns null if an error occurs.
Returns the value of the program parameter that corresponds to a supplied pname for a given program, or null if an error occurs.
Errors:
gl.INVALID_ENUM If pname isn't in the table above.
gl.INVALID_OPERATION If program isn't a program object.
The program object to query for pname.
The parameter constant.
Parameter Returned type
gl.DELETE_STATUS Boolean
gl.LINK_STATUS Boolean
gl.VALIDATE_STATUS Boolean
gl.ATTACHED_SHADERS Number
gl.ACTIVE_ATTRIBUTES Number
gl.ACTIVE_UNIFORMS Number
The value for a parameter associated with pname, or null if an error occurs.
Returns a renderbuffer parameter from the currently bound WebGLRenderbuffer object.
Errors:
gl.INVALID_ENUM If target isn't gl.RENDERBUFFER.
If pname isn't one of the listed constants.
gl.INVALID_OPERATION If no renderbuffer is bound.
Constant, must be gl.RENDERBUFFER.
Values for the image in the currently bound WebGLRenderbuffer object.
Parameter Description Default
gl.RENDERBUFFER_WIDTH The width (in pixels). 0
gl.RENDERBUFFER_HEIGHT The height (in pixels). 0
gl.RENDERBUFFER_INTERNAL_FORMAT The internal format for the image. RGBA4
gl.RENDERBUFFER_GREEN_SIZE The resolution size (in bits) for the green component. 0
gl.RENDERBUFFER_BLUE_SIZE The resolution size (in bits) for the blue component. 0
gl.RENDERBUFFER_RED_SIZE The resolution size (in bits) for the red component. 0
gl.RENDERBUFFER_ALPHA_SIZE The resolution size (in bits) for the alpha component. 0
gl.RENDERBUFFER_DEPTH_SIZE The resolution size (in bits) for the depth component. 0
gl.RENDERBUFFER_STENCIL_SIZE The resolution size (in bits) for the stencil component. 0
Returns the value of the parameter specified by pname, or null if an error.
Returns errors which occur when compiling a shader.
Shader compilation errors are written to the shader's info log.
To get compile status, call gl.getShaderParameter(myShader,gl.COMPILE_STATUS) to check for a failed compile. On a failed compile, call gl.getShaderInfoLog(myShader) to get the error information. This method only returns the info log, but doesn't clear the log like getError does.
The shader object.
The information log.
Returns the value of the parameter associated with pname for a shader object.
The shader object to query.
The parameter to look up.
Parameter Returned type
gl.SHADER_TYPE Number
gl.DELETE_STATUS Boolean
gl.COMPILE_STATUS Boolean
Value of pname.
Returns the precision and range of the supplied numeric format for a given shader type.
Errors:
gl.INVALID_ENUM If either shaderType or precisionType aren't accepted values.
gl.INVALID_OPERATION If the shader compiler isn't supported.
Type of shader. One of the following: gl.VERTEX_SHADER, gl.FRAGMENT_SHADER
The numeric format to query for range and precision. One of the following:
gl.LOW_FLOAT
gl.MEDIUM_FLOAT
gl.HIGH_FLOAT
gl.LOW_INT
gl.MEDIUM_INT
gl.HIGH_INT
Precision and range of numeric format.
Returns source code string associated with a shader object.
Errors:
gl.INVALID_VALUE If shader is not valid.
gl.INVALID_OPERATION If shader is not a shader object.
The shader object to query.
The shader source code string. Returns null if an error occurred.
Returns an array of supported extension strings.
Array of supported extension strings, or an empty array object if there are none.
Returns the value for a parameter on an active texture unit.
Errors:
gl.INVALID_ENUM pname is not one of the listed constants.
The target texture of the active texture unit. Must be gl.TEXTURE_2D and gl.TEXTURE_CUBE_MAP.
Parameter:
gl.TEXTURE_MAG_FILTER
gl.TEXTURE_MIN_FILTER
gl.TEXTURE_WRAP_S
gl.TEXTURE_WRAP_T
The texture parameter type. See table below. Returns null if a WebGL error occurs.
Gets the uniform value for a specific location in a program.
Errors:
gl.INVALID_VALUE If program is not generated by WebGL.
gl.INVALID_OPERATION If location isn't a valid uniform variable location for program
If program is not a program object.
if program isn't successfully linked.
The program to query.
The location of the uniform variable.
The uniform value or null if a WebGL error is generated.
Returns a WebGLUniformLocation object for the location of a uniform variable within a WebGLProgram object.
Errors:
gl.INVALID_VALUE If program is not generated by WebGL.
gl.INVALID_OPERATION If program is not a program object.
if program isn't successfully linked.
The program object to query.
A string containing the name of the uniform variable.
The WebGLUniformLocation for the name. Returns null if a WebGL error occurs or if name starts with a reserved WebGL prefix.
Returns data for a particular characteristic of a vertex attribute at an index in a vertex attribute array.
The following table shows the return value for a given pName.
Parameter Returned type Description
gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING WebGLBuffer The name of the currently bound buffer object. Returns 0 if no buffer is bound.
gl.VERTEX_ATTRIB_ARRAY_ENABLED Boolean Returns true if the vertex attribute at index is enabled, otherwise false. Initial value is false.
gl.VERTEX_ATTRIB_ARRAY_SIZE Number Returns the size (1,2,3,or 4) for an element of the vertex array. Initial value is 4.
gl.VERTEX_ATTRIB_ARRAY_STRIDE Number Returns the number of bytes between successive elements in the array. The value 0 means the elements are sequential in memory. Initial value is 0.
gl.VERTEX_ATTRIB_ARRAY_TYPE GLenum Returns a constant representing the array type. Possible values are: gl.BYTE, gl.UNSIGNED_BYTE, gl.SHORT, gl.UNSIGNED_SHORT, gl.FIXED, gl.FLOAT. The initial value is gl.FLOAT.
gl.VERTEX_ATTRIB_ARRAY_NORMALIZED Boolean Returns true if fixed-point data types for the vertex attribute array at index are normalized when converted to floating point. Otherwise false is returned. Initial value is false.
gl.CURRENT_VERTEX_ATTRIB Float32Array Returns four values that currently represent the value of the vertex attribute at index. Initial value is 0,0,0,1.
(with 4 elements)
Errors:
gl.INVALID_ENUM If pname isn't an accepted value.
gl.INVALID_VALUE If index is greater than or equal to gl.MAX_VERTEX_ATTRIBS.
The index of the vertex attribute to query.
The symbolic name for the attribute parameter to look up. See remarks for acceptable values.
The data specified by pname for the vertex attribute at index. Returns null if an error condition occurs, such as an invalid pname.
Returns the address of a specified vertex attribute.
Errors:
gl.INVALID_ENUM pname isn't the constant gl.VERTEX_ATTRIB_ARRAY_POINTER
gl.INVALID_VALUE index is greater than or equal to gl.MAX_VERTEX_ATTRIBS
The index of the vertex attribute to query.
Must be gl.VERTEX_ATTRIB_ARRAY_POINTER
The address of the vertex attribute. Returns a null if an error is generated. Returns 0 if the context lost flag is set.
Gets state of WebGLBuffer. Returns true if buffer is valid, false otherwise.
The buffer to query.
Returns true if buffer is valid, false otherwise.
Returns whether the WebGL context has been lost.
Returns true if context lost flag is set, false otherwise.
Returns whether or not a WebGL capability is enabled for this context.
One of the following:
gl.BLEND Don't blend computed fragment color values with color buffer values.
gl.DEPTH_TEST Don't update the depth buffer, including when the depth buffer exists and the depth mask is non-zero.
gl.CULL_FACE Don't cull polygons. see cullFace.
gl.POLYGON_OFFSET_FILL Don't add an offset to the depth values of a polygon's fragments.
gl.SCISSOR_TEST Don't discard fragments outside a scissor rectangle.
Returns true if supported, otherwise false.
Returns false if the context lost flag is set.
Returns false if the value for capability is invalid.
Returns undefined rather than false when function is called with an unsupported capability value.
Gets state of framebuffer. Returns true if buffer is valid, false otherwise.
The framebuffer to query.
True if framebuffer is valid, false otherwise.
Gets state of WebGL program object. Returns true if program object is valid, false otherwise.
The program object to query.
Returns true if program is valid, false otherwise.
Gets state of WebGL renderbuffer. Returns true if buffer is valid, false otherwise.
Renderbuffer to query.
Returns true if renderbuffer is valid, false otherwise.
Gets state of WebGL shader. Returns true if shader is valid, false otherwise.
Shader to query.
Returns true if shader is valid, false otherwise.
Gets state of WebGL texture. Returns true if texture is valid, false otherwise.
Texture to query.
Returns true of texture is valid, false otherwise.
Sets the width of lines in WebGL.
Width of lines.
Links an attached vertex shader and an attached fragment shader to a program so it can be used by the graphics processing unit (GPU).
If a link operation fails, any info associated with a previous link operation of program is lost.
Errors:
gl.INVALID_VALUE If program isn't a WebGL object type.
gl.INVALID_OPERATION If program isn't a program object.
The program object to link.
Sets pixel storage modes for readPixels and unpacking of textures with texImage2D and texSubImage2D .
The symbolic parameter name. One of the following:
gl.PACK_ALIGNMENT Affects packing of pixel data into memory. The initial param value is 4, but it can be set to 1,2,4, or 8.
gl.UNPACK_ALIGNMENT Affects unpacking of pixel data from memory. The initial param value is 4, but can be set to 1,2,4, or 8.
gl.UNPACK_FLIP_Y_WEBGL Flips the source data along its vertical axis when texImage2D or texSubImage2D are called when param is true. The initial value for param is false.
gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL Multiplies the alpha channel, if it exists, into the other color channels during the data transfer when texImage2D or texSubImage2D are called when param is true. The initial value for param is false.
gl.UNPACK_COLORSPACE_CONVERSION_WEBGL The browser's default colorspace conversion is applied when texImage2D or texSubImage2D are called with an HTMLImageElement texture data source. The initial value for param is BROWSER_DEFAULT_WEBGL. No colorspace conversion is applied when set to NONE.
Values depend on value of pname.
Sets pixel storage modes for readPixels and unpacking of textures with texImage2D and texSubImage2D .
The symbolic parameter name. One of the following:
gl.PACK_ALIGNMENT Affects packing of pixel data into memory. The initial param value is 4, but it can be set to 1,2,4, or 8.
gl.UNPACK_ALIGNMENT Affects unpacking of pixel data from memory. The initial param value is 4, but can be set to 1,2,4, or 8.
gl.UNPACK_FLIP_Y_WEBGL Flips the source data along its vertical axis when texImage2D or texSubImage2D are called when param is true. The initial value for param is false.
gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL Multiplies the alpha channel, if it exists, into the other color channels during the data transfer when texImage2D or texSubImage2D are called when param is true. The initial value for param is false.
gl.UNPACK_COLORSPACE_CONVERSION_WEBGL The browser's default colorspace conversion is applied when texImage2D or texSubImage2D are called with an HTMLImageElement texture data source. The initial value for param is BROWSER_DEFAULT_WEBGL. No colorspace conversion is applied when set to NONE.
Values depend on value of pname.
Sets the implementation-specific units and scale factor used to calculate fragment depth values.
The scale factor. Initial value is 0.
Number that's multiplied by an implementation-specific value to get a constant depth offset. Initial value is 0.
Reads pixel data into an ArrayBufferView object from a rectangular area in the color buffer of the active frame buffer.
If an error is generated, no change is made to data object referenced by the pixels parameter.
Errors:
gl.INVALID_ENUM If format or type aren't accepted values.
gl.INVALID_VALUE If height or width are negative numbers.
If pixels is null.
gl.INVALID_OPERATION If format isn't gl.RGBA and type isn't
gl.UNSIGNED_BYTE If pixels isn't large enough for the pixel data.
gl.INVALID_FRAMEBUFFER_OPERATION If the currently bound frame buffer isn't complete or the render frame buffer is invalid.
Horizontal coordinate of the first pixel to read in the lower left corner of rectangle.
Vertical coordinate of the first pixel to read in the lower left corner of rectangle.
Width of the rectangle.
Height of the rectangle.
Format of the pixel data. For example, gl.RGBA.
Describes the type of data being read:
gl.UNSIGNED_BYTE
gl.FLOAT Call getExtension("gl.OES_texture_float") first to enable. This creates 128bit-per-pixel textures instead of 32bit-per-pixel for the image.
Object to read data into. One of the following types:
Uint8Array when used without extensions.
Float32Array when using the OES_texture_float extension .
Reads pixel data into an ArrayBufferView object from a rectangular area in the color buffer of the active frame buffer.
If an error is generated, no change is made to data object referenced by the pixels parameter.
Errors:
gl.INVALID_ENUM If format or type aren't accepted values.
gl.INVALID_VALUE If height or width are negative numbers.
If pixels is null.
gl.INVALID_OPERATION If format isn't gl.RGBA and type isn't
gl.UNSIGNED_BYTE If pixels isn't large enough for the pixel data.
gl.INVALID_FRAMEBUFFER_OPERATION If the currently bound frame buffer isn't complete or the render frame buffer is invalid.
Horizontal coordinate of the first pixel to read in the lower left corner of rectangle.
Vertical coordinate of the first pixel to read in the lower left corner of rectangle.
Width of the rectangle.
Height of the rectangle.
Format of the pixel data. For example, gl.RGBA.
Describes the type of data being read:
gl.UNSIGNED_BYTE
gl.FLOAT Call getExtension("gl.OES_texture_float") first to enable. This creates 128bit-per-pixel textures instead of 32bit-per-pixel for the image.
Object to read data into. One of the following types:
Uint8Array when used without extensions.
Float32Array when using the OES_texture_float extension .
Creates or replaces the data store for the currently bound WebGLRenderbuffer object.
Errors:
gl.INVALID_ENUM If target is not gl.RENDERBUFFER.
If internal format is not one of the listed formats.
gl.INVALID_VALUE If width and height are greater than gl.MAX_RENDERBUFFER_SIZE or less than zero.
gl.INVALID_OPERATION The renderbuffer object isn't bound to a gl.RENDERBUFFER object.
gl.OUT_OF_MEMORY The data store couldn't be generated with the supplied width and height.
Target must be the constant gl.RENDERBUFFER.
One of the following values:
gl.RGBA4 RGBA with 4 bits per channel
gl.RGB565 RGB value with 5 bits red, 6 bits green, and 5 bits blue respectively.
gl.RGB5_A1 RGBA value with 5 bits for RGB and 1 bit for Alpha.
gl.DEPTH_COMPONENT16 16 bit Depth component.
Width of the render buffer in pixels.
Height of the render buffer in pixels.
Sets multi-sample coverage parameters for antialiasing.
If no multi-sample buffers exist or multi-sampling is disabled, then final RGB colors are computed with a single sample.
A floating point number between 0 and 1 that determines sample coverage. Used to temporarily create a mask to determine which samples are used for the final fragment color.
True if the coverage mask bits are inverted and a bitwise and is used, false otherwise.
Sets the dimensions of the scissor box.
Errors:
gl.INVALID_VALUE Either width or height is a negative value.
The horizontal coordinate for the lower left corner of the box. Initially 0.
The vertical coordinate for the lower left corner of the box. Initially 0.
The width of the scissor box. For a WebGL context attached to a canvas, this value is the width of the canvas.
The height of the scissor box. For a WebGL context attached to a canvas, this value is the height of the canvas.
Sets and replaces shader source code in a shader object.
Errors:
gl.INVALID_VALUE If shader isn't a WebGL object or value.
gl.INVALID_OPERATION If shader isn't a WebGLShader object.
The shader object to set the source code on.
GLSL source code.
Sets the front and back function and reference value for stencil testing.
Any parameter values set via stencilFunc are set on both the front and back-facing stencil buffers.
The reference and mask values are stored in integer format and any float portion of the values are truncated.
Only the least significant n bits of the mask value are stored (where n is the size of the stencil buffer in bits).
The stencilFunc parameters (that is, STENCIL_FUNC and STENCIL_REF) can be set when the stencil test is disabled or a stencil buffer is not available, but will have no impact during rendering.
Calling stencilFunc with an invalid stencilFunc enumeration value generates the INVALID_ENUM error but doesn’t affect any previously-set parameter value.
Specifies the test function. The stencil functions for the front and back-facing stencil buffers (whose parameter names are STENCIL_FUNC and STENCIL_BACK_FUNC, respectively) default to ALWAYS.
Specifies the reference value for the stencil test. ref is clamped to the range [0, 2(n - 1)], where n is the number of stencil bits for both the front and back-facing stencil bits. The stencil reference values for the front and back-facing stencil buffers (respectively STENCIL_REF and STENCIL_BACK_REF) default to 0.
Specifies a mask that is bit-wise ANDed with both the reference value and the stored stencil value when the test is done. The initial stencil value masks for the front and back-facing stencil buffers (respectively STENCIL_VALUE_MASK and STENCIL_BACK_VALUE_MASK) default to an unsigned integer which has the n least significant bits set all to 1s (where n is the size of the stencil buffer in bits).
Sets the front and/or back function and reference value for stencil testing.
Write operations on the front-facing stencil buffer do not affect the contents of the back-facing stencil buffer (and vice-versa).
You can set the same stencil function on both the front and back-facing stencil buffers by calling stencilFuncSeparate with face set to FRONT_AND_BACK.
Calling stencilFuncSeparate with an invalid face enumeration value generates the INVALID_ENUM error code.
Calling stencilFuncSeparate with an invalid func enumeration value generates the INVALID_ENUMerror code and doesn’t affect any previously set parameter value on either the front or back-facing stencil buffers.
Different stencil reference and mask values can be set on the front and back-facing stencil buffers without generating an error, but attempting to render generates the INVALID_OPERATION error and does not affect the contents of the WebGL viewport.
Specifies whether front and/or back stencil state is updated.
Specifies the test function. The initial value is ALWAYS
Specifies the reference value for the stencil test. ref is clamped to the range [0, 2(n - 1)], where n is the number of stencil bits for both the front and back-facing stencil bits. The stencil reference values for the front and back-facing stencil buffers (respectively STENCIL_REF and STENCIL_BACK_REF) default to 0.
Specifies a mask that is bit-wise ANDed with both the reference value and the stored stencil value when the test is done. The initial value is composed entirely of 1's.
Controls the front and back writing of individual bits in the stencil planes.
The stencil write mask can be used to control writing to the stencil buffer during both rendering and clear operations.
Only the n least significant bits of the mask parameter value are saved (where n is the size of the stencil buffer in bits).
The write mask value is set on both the front and back stencil buffers.
The write mask value can be set when the stencil test is disabled or a stencil buffer is unavailable.
The write mask defaults to an integer which has the n least significant bits set to all 1s on both the front and back-facing stencil buffers.
Specifies a bit mask to enable and disable writing of individual bits in the stencil planes. Initially, this mask composed entirely of 1's.
Controls the front and/or back writing of individual bits in the stencil planes.
Different write masks can be set on the front and back-facing stencil buffers, but attempting to render will generate the INVALID_OPERATION error and does not affect the contents of the WebGL viewport.
Stencil buffer boundary regions can be written to (that is, corner areas).
The stencil buffer isn’t modified when a rendering error occurs.
Stencil buffer values are clamped to the range [0, 2(n - 1)], where n is the size of the stencil buffer (in bits).
Specifies whether the front and/or back stencil write mask is updated.
Specifies a bit mask to enable and disable writing of individual bits in the stencil planes. Initially, the mask is composed entirely of 1's.
Sets front and back stencil test actions.
The parameters set via stencilOp are set on both the front and back-facing stencil buffers.
The parameters set via stencilOp default to KEEP for both the front and back-facing stencil buffers.
The stencilOp parameters can be set when the stencil test is disabled or a stencil buffer is unavailable.
Specifies the action to take when the stencil test fails.
Specifies the stencil action when the stencil test passes, but the depth test fails. This parameter is ignored when the depth buffer or depth test are disabled.
Specifies the stencil action when both the stencil test and the depth test pass, or when the stencil test passes and either there is no depth buffer or depth testing is not enabled.
Sets front and/or back stencil test actions.
Specifies whether front and/or back stencil state is updated.
Specifies the action to take when the stencil test fails.
Specifies the stencil action when the stencil test passes, but the depth test fails. This parameter is ignored when the depth buffer or depth test are disabled.
Specifies the stencil action when both the stencil test and the depth test pass, or when the stencil test passes and either there is no depth buffer or depth testing is not enabled.
Loads the supplied pixel data into a texture.
When using an ArrayBufferView for pixels and gl.FLOAT for type, the array must be a Float32Array rather than a UInt8Array.
Images that are used as textures are not allowed if the origin of the image isn't the same as the origin of the canvas element. Images are also blocked if they are from a canvas whose origin-clean flag set to false.
Errors:
gl.SECURITY_ERR Occurs if an image or canvas is supplied as the pixel data source and isn't the same origin (same domain) of the canvas associated with the WebGLRenderingContext.
gl.INVALID_OPERATION If the ArrayBufferView doesn't have enough data to fill the specified rectangle.
If format and internalformat don't match.
No texture is bound to target.
If type is gl.UNSIGNED_SHORT_5_6_5 and format isn't gl.RGB.
If type is gl.UNSIGNED_SHORT_4_4_4_4 or gl.UNSIGNED_SHORT_5_5_5_1 and the format isn't gl.RGBA
gl.INVALID_VALUE target is a cube map target and width and height aren't equal.
If pixels is null for any of the non-ArrayBuffer overloads.
The incoming ArrayBufferView or image is bigger than max texture size. Max texture can be retrieved by calling getParameter and using the gl.MAX_CUBE_MAP_TEXTURE_SIZE and gl.MAX_TEXTURE_SIZE enums.
If level, width, or height is a negative value.
If level is greater than log 2(max), where max is the value of gl.MAX_TEXTURE_SIZE when target is gl.TEXTURE_2D.
If width or height are greater than the value of gl.MAX_TEXTURE_SIZE when target is gl.TEXTURE_2D.
If level is greater than log 2(max), where max is the value of gl.MAX_CUBE_MAP_TEXTURE_SIZE when target is not gl.TEXTURE_2D.
If width or height are greater than the value of gl.MAX_CUBE_MAP_TEXTURE_SIZE when target is not a cube map texture target.
gl.INVALID_ENUM If target, format, internalformat, or type aren't one of the listed values.
The target texture of the active texture unit. Must be one of the following:
gl.TEXTURE_2D Uses a 2D image.
gl.TEXTURE_CUBE_MAP_POSITIVE_X Image for the positive X face of the cube map.
gl.TEXTURE_CUBE_MAP_NEGATIVE_X Image for the negative X face of the cube map.
gl.TEXTURE_CUBE_MAP_POSITIVE_Y Image for the positive Y face of the cube map.
gl.TEXTURE_CUBE_MAP_NEGATIVE_Y Image for the negative Y face of the cube map.
gl.TEXTURE_CUBE_MAP_POSITIVE_Z Image for the positive Z face of the cube map.
gl.TEXTURE_CUBE_MAP_NEGATIVE_Z Image for the negative Z face of the cube map.
The level of detail value.
gl.ALPHA Each element is a single alpha component. The system converts it to floating point, clamped to the range [0, 1], and assembles it into an RGBA element by placing attaching 0.0 to the red, green and blue channels.
gl.LUMINANCE Each element is a single luminance component. The system converts it to floating point value, clamped to the range [0, 1], and assembles it into an RGBA element by placing the luminance value in the red, green and blue channels, and attaching 1.0 to the alpha channel.
gl.LUMINANCE_ALPHA Each element is an luminance/alpha double. The systems converts each component to floating point, clamped to the range [0, 1], and assembles them into an RGBA element by placing the luminance value in the red, green and blue channels.
gl.RGB Red, green, and blue channels.
gl.RGBA Red, green, blue, and alpha (transparency) channels.
Width of texture image. Value used only when UInt8Array or Float32Array for pixels is specified.
Height of texture image. Value used only when UInt8Array or Float32Array for pixels is specified.
Specifies the width of the border. Must be 0. Border value used only when UInt8Array or Float32Array for pixels is specified.
Contains the format for the source pixel data. Must match internalformat.
The type of texture data.
gl.UNSIGNED_BYTE Provides 8 bits per channel for gl.RGBA.
gl.FLOAT Call getExtension("gl.OES_texture_float") first to enable. This creates 128 bit-per-pixel textures instead of 32 bit-per-pixel for the image.
gl.UNSIGNED_SHORT_5_6_5 Represents colors in a Uint16Array where red = 5 bits, green=6 bits, and blue=5 bits.
gl.UNSIGNED_SHORT_4_4_4_4 Represents colors in a Uint16Array where red = 4 bits, green=4 bits, blue=4 bits, and alpha=4 bits.
gl.UNSIGNED_SHORT_5_5_5_1 Represents colors in a Uint16Array where red = 5 bits, green=5 bits, blue=5 bits and alpha=1 bit.
The ArrayBufferView to use as a data source for the texture. A buffer of sufficient size is automatically allocated and its contents is initialized to 0 if pixels is null.
Loads the supplied pixel data into a texture.
Images that are used as textures are not allowed if the origin of the image isn't the same as the origin of the canvas element. Images are also blocked if they are from a canvas whose origin-clean flag set to false.
Errors:
gl.SECURITY_ERR Occurs if an image or canvas is supplied as the pixel data source and isn't the same origin (same domain) of the canvas associated with the WebGLRenderingContext.
gl.INVALID_OPERATION If the ArrayBufferView doesn't have enough data to fill the specified rectangle.
If format and internalformat don't match.
No texture is bound to target.
If type is gl.UNSIGNED_SHORT_5_6_5 and format isn't gl.RGB.
If type is gl.UNSIGNED_SHORT_4_4_4_4 or gl.UNSIGNED_SHORT_5_5_5_1 and the format isn't gl.RGBA
gl.INVALID_VALUE target is a cube map target and width and height aren't equal.
If pixels is null for any of the non-ArrayBuffer overloads.
The incoming ArrayBufferView or image is bigger than max texture size. Max texture can be retrieved by calling getParameter and using the gl.MAX_CUBE_MAP_TEXTURE_SIZE and gl.MAX_TEXTURE_SIZE enums.
If level, width, or height is a negative value.
If level is greater than log 2(max), where max is the value of gl.MAX_TEXTURE_SIZE when target is gl.TEXTURE_2D.
If width or height are greater than the value of gl.MAX_TEXTURE_SIZE when target is gl.TEXTURE_2D.
If level is greater than log 2(max), where max is the value of gl.MAX_CUBE_MAP_TEXTURE_SIZE when target is not gl.TEXTURE_2D.
If width or height are greater than the value of gl.MAX_CUBE_MAP_TEXTURE_SIZE when target is not a cube map texture target.
gl.INVALID_ENUM If target, format, internalformat, or type aren't one of the listed values.
The target texture of the active texture unit. Must be one of the following:
gl.TEXTURE_2D Uses a 2D image.
gl.TEXTURE_CUBE_MAP_POSITIVE_X Image for the positive X face of the cube map.
gl.TEXTURE_CUBE_MAP_NEGATIVE_X Image for the negative X face of the cube map.
gl.TEXTURE_CUBE_MAP_POSITIVE_Y Image for the positive Y face of the cube map.
gl.TEXTURE_CUBE_MAP_NEGATIVE_Y Image for the negative Y face of the cube map.
gl.TEXTURE_CUBE_MAP_POSITIVE_Z Image for the positive Z face of the cube map.
gl.TEXTURE_CUBE_MAP_NEGATIVE_Z Image for the negative Z face of the cube map.
The level of detail value.
gl.ALPHA Each element is a single alpha component. The system converts it to floating point, clamped to the range [0, 1], and assembles it into an RGBA element by placing attaching 0.0 to the red, green and blue channels.
gl.LUMINANCE Each element is a single luminance component. The system converts it to floating point value, clamped to the range [0, 1], and assembles it into an RGBA element by placing the luminance value in the red, green and blue channels, and attaching 1.0 to the alpha channel.
gl.LUMINANCE_ALPHA Each element is an luminance/alpha double. The systems converts each component to floating point, clamped to the range [0, 1], and assembles them into an RGBA element by placing the luminance value in the red, green and blue channels.
gl.RGB Red, green, and blue channels.
gl.RGBA Red, green, blue, and alpha (transparency) channels.
Contains the format for the source pixel data. Must match internalformat.
The type of texture data.
gl.UNSIGNED_BYTE Provides 8 bits per channel for gl.RGBA.
gl.FLOAT Call getExtension("gl.OES_texture_float") first to enable. This creates 128 bit-per-pixel textures instead of 32 bit-per-pixel for the image.
gl.UNSIGNED_SHORT_5_6_5 Represents colors in a Uint16Array where red = 5 bits, green=6 bits, and blue=5 bits.
gl.UNSIGNED_SHORT_4_4_4_4 Represents colors in a Uint16Array where red = 4 bits, green=4 bits, blue=4 bits, and alpha=4 bits.
gl.UNSIGNED_SHORT_5_5_5_1 Represents colors in a Uint16Array where red = 5 bits, green=5 bits, blue=5 bits and alpha=1 bit.
The CanvasElement to use as a data source for the texture. A buffer of sufficient size is automatically allocated and its contents is initialized to 0 if pixels is null.
Loads the supplied pixel data into a texture.
Images that are used as textures are not allowed if the origin of the image isn't the same as the origin of the canvas element. Images are also blocked if they are from a canvas whose origin-clean flag set to false.
Errors:
gl.SECURITY_ERR Occurs if an image or canvas is supplied as the pixel data source and isn't the same origin (same domain) of the canvas associated with the WebGLRenderingContext.
gl.INVALID_OPERATION If the ArrayBufferView doesn't have enough data to fill the specified rectangle.
If format and internalformat don't match.
No texture is bound to target.
If type is gl.UNSIGNED_SHORT_5_6_5 and format isn't gl.RGB.
If type is gl.UNSIGNED_SHORT_4_4_4_4 or gl.UNSIGNED_SHORT_5_5_5_1 and the format isn't gl.RGBA
gl.INVALID_VALUE target is a cube map target and width and height aren't equal.
If pixels is null for any of the non-ArrayBuffer overloads.
The incoming ArrayBufferView or image is bigger than max texture size. Max texture can be retrieved by calling getParameter and using the gl.MAX_CUBE_MAP_TEXTURE_SIZE and gl.MAX_TEXTURE_SIZE enums.
If level, width, or height is a negative value.
If level is greater than log 2(max), where max is the value of gl.MAX_TEXTURE_SIZE when target is gl.TEXTURE_2D.
If width or height are greater than the value of gl.MAX_TEXTURE_SIZE when target is gl.TEXTURE_2D.
If level is greater than log 2(max), where max is the value of gl.MAX_CUBE_MAP_TEXTURE_SIZE when target is not gl.TEXTURE_2D.
If width or height are greater than the value of gl.MAX_CUBE_MAP_TEXTURE_SIZE when target is not a cube map texture target.
gl.INVALID_ENUM If target, format, internalformat, or type aren't one of the listed values.
The target texture of the active texture unit. Must be one of the following:
gl.TEXTURE_2D Uses a 2D image.
gl.TEXTURE_CUBE_MAP_POSITIVE_X Image for the positive X face of the cube map.
gl.TEXTURE_CUBE_MAP_NEGATIVE_X Image for the negative X face of the cube map.
gl.TEXTURE_CUBE_MAP_POSITIVE_Y Image for the positive Y face of the cube map.
gl.TEXTURE_CUBE_MAP_NEGATIVE_Y Image for the negative Y face of the cube map.
gl.TEXTURE_CUBE_MAP_POSITIVE_Z Image for the positive Z face of the cube map.
gl.TEXTURE_CUBE_MAP_NEGATIVE_Z Image for the negative Z face of the cube map.
The level of detail value.
gl.ALPHA Each element is a single alpha component. The system converts it to floating point, clamped to the range [0, 1], and assembles it into an RGBA element by placing attaching 0.0 to the red, green and blue channels.
gl.LUMINANCE Each element is a single luminance component. The system converts it to floating point value, clamped to the range [0, 1], and assembles it into an RGBA element by placing the luminance value in the red, green and blue channels, and attaching 1.0 to the alpha channel.
gl.LUMINANCE_ALPHA Each element is an luminance/alpha double. The systems converts each component to floating point, clamped to the range [0, 1], and assembles them into an RGBA element by placing the luminance value in the red, green and blue channels.
gl.RGB Red, green, and blue channels.
gl.RGBA Red, green, blue, and alpha (transparency) channels.
Contains the format for the source pixel data. Must match internalformat.
The type of texture data.
gl.UNSIGNED_BYTE Provides 8 bits per channel for gl.RGBA.
gl.FLOAT Call getExtension("gl.OES_texture_float") first to enable. This creates 128 bit-per-pixel textures instead of 32 bit-per-pixel for the image.
gl.UNSIGNED_SHORT_5_6_5 Represents colors in a Uint16Array where red = 5 bits, green=6 bits, and blue=5 bits.
gl.UNSIGNED_SHORT_4_4_4_4 Represents colors in a Uint16Array where red = 4 bits, green=4 bits, blue=4 bits, and alpha=4 bits.
gl.UNSIGNED_SHORT_5_5_5_1 Represents colors in a Uint16Array where red = 5 bits, green=5 bits, blue=5 bits and alpha=1 bit.
The ImageElement to use as a data source for the texture. A buffer of sufficient size is automatically allocated and its contents is initialized to 0 if pixels is null.
Loads the supplied pixel data into a texture.
Images that are used as textures are not allowed if the origin of the image isn't the same as the origin of the canvas element. Images are also blocked if they are from a canvas whose origin-clean flag set to false.
Errors:
gl.SECURITY_ERR Occurs if an image or canvas is supplied as the pixel data source and isn't the same origin (same domain) of the canvas associated with the WebGLRenderingContext.
gl.INVALID_OPERATION If the ArrayBufferView doesn't have enough data to fill the specified rectangle.
If format and internalformat don't match.
No texture is bound to target.
If type is gl.UNSIGNED_SHORT_5_6_5 and format isn't gl.RGB.
If type is gl.UNSIGNED_SHORT_4_4_4_4 or gl.UNSIGNED_SHORT_5_5_5_1 and the format isn't gl.RGBA
gl.INVALID_VALUE target is a cube map target and width and height aren't equal.
If pixels is null for any of the non-ArrayBuffer overloads.
The incoming ArrayBufferView or image is bigger than max texture size. Max texture can be retrieved by calling getParameter and using the gl.MAX_CUBE_MAP_TEXTURE_SIZE and gl.MAX_TEXTURE_SIZE enums.
If level, width, or height is a negative value.
If level is greater than log 2(max), where max is the value of gl.MAX_TEXTURE_SIZE when target is gl.TEXTURE_2D.
If width or height are greater than the value of gl.MAX_TEXTURE_SIZE when target is gl.TEXTURE_2D.
If level is greater than log 2(max), where max is the value of gl.MAX_CUBE_MAP_TEXTURE_SIZE when target is not gl.TEXTURE_2D.
If width or height are greater than the value of gl.MAX_CUBE_MAP_TEXTURE_SIZE when target is not a cube map texture target.
gl.INVALID_ENUM If target, format, internalformat, or type aren't one of the listed values.
The target texture of the active texture unit. Must be one of the following:
gl.TEXTURE_2D Uses a 2D image.
gl.TEXTURE_CUBE_MAP_POSITIVE_X Image for the positive X face of the cube map.
gl.TEXTURE_CUBE_MAP_NEGATIVE_X Image for the negative X face of the cube map.
gl.TEXTURE_CUBE_MAP_POSITIVE_Y Image for the positive Y face of the cube map.
gl.TEXTURE_CUBE_MAP_NEGATIVE_Y Image for the negative Y face of the cube map.
gl.TEXTURE_CUBE_MAP_POSITIVE_Z Image for the positive Z face of the cube map.
gl.TEXTURE_CUBE_MAP_NEGATIVE_Z Image for the negative Z face of the cube map.
The level of detail value.
gl.ALPHA Each element is a single alpha component. The system converts it to floating point, clamped to the range [0, 1], and assembles it into an RGBA element by placing attaching 0.0 to the red, green and blue channels.
gl.LUMINANCE Each element is a single luminance component. The system converts it to floating point value, clamped to the range [0, 1], and assembles it into an RGBA element by placing the luminance value in the red, green and blue channels, and attaching 1.0 to the alpha channel.
gl.LUMINANCE_ALPHA Each element is an luminance/alpha double. The systems converts each component to floating point, clamped to the range [0, 1], and assembles them into an RGBA element by placing the luminance value in the red, green and blue channels.
gl.RGB Red, green, and blue channels.
gl.RGBA Red, green, blue, and alpha (transparency) channels.
Contains the format for the source pixel data. Must match internalformat.
The type of texture data.
gl.UNSIGNED_BYTE Provides 8 bits per channel for gl.RGBA.
gl.FLOAT Call getExtension("gl.OES_texture_float") first to enable. This creates 128 bit-per-pixel textures instead of 32 bit-per-pixel for the image.
gl.UNSIGNED_SHORT_5_6_5 Represents colors in a Uint16Array where red = 5 bits, green=6 bits, and blue=5 bits.
gl.UNSIGNED_SHORT_4_4_4_4 Represents colors in a Uint16Array where red = 4 bits, green=4 bits, blue=4 bits, and alpha=4 bits.
gl.UNSIGNED_SHORT_5_5_5_1 Represents colors in a Uint16Array where red = 5 bits, green=5 bits, blue=5 bits and alpha=1 bit.
The ImageData array to use as a data source for the texture. A buffer of sufficient size is automatically allocated and its contents is initialized to 0 if pixels is null.
Sets texture parameters for the current texture unit.
Errors:
gl.INVALID_OPERATION If no texture is bound.
gl.INVALID_ENUM If target, pname, or param values are invalid.
The target texture for the current texture unit. Must be one of the following:
gl.TEXTURE_2D Represents a 2D image.
gl.TEXTURE_CUBE_MAP The texture is composed of six 2D images, one for each face of a cube.
The name of the texture parameter. Use one of the following:
gl.TEXTURE_MIN_FILTER A texture filter constant to use when a surface is rendered smaller than the corresponding texture bitmap (such as for distant objects). Initial value is gl.NEAREST_MIPMAP_LINEAR.
gl.TEXTURE_MAG_FILTER A texture filter constant to use when a surface is rendered larger than the corresponding texture bitmap (such as for close-up objects). Initial value is gl.LINEAR.
gl.TEXTURE_WRAP_S Sets the wrap parameter for texture coordinate s to either gl.CLAMP or gl.REPEAT. gl.CLAMP causes s coordinates to be clamped to the range [0,1] and is useful for preventing wrapping artifacts when mapping a single image onto an object. gl.REPEAT causes the integer part of the s coordinate to be ignored; WebGL uses only the fractional part, thereby creating a repeating pattern. Border texture elements are accessed only if wrapping is set to gl.CLAMP. Initially, gl.TEXTURE_WRAP_S is set to gl.REPEAT.
gl.TEXTURE_WRAP_T Sets the wrap parameter for texture coordinate t to either gl.CLAMP or gl.REPEAT. Initial value is gl.REPEAT.
gl.TEXTURE_MAX_ANISOTROPY_EXT Use anisotropic filtering. You must call getExtension("gl.TEXTURE_MAX_ANISOTROPY_EXT") first to enable. For more info, see Anisotropic filtering.
The value of pname. The value of param depends on the value of pname.
When using floating-point textures, only gl.NEAREST is supported. The following shows possible calling values:
texParameterf(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR)
texParameterf(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST)
texParameterf(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST)
texParameterf(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR)
texParameterf(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_LINEAR)
texParameterf(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST_MIPMAP_NEAREST)
texParameterf(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST_MIPMAP_LINEAR)
texParameterf(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_NEAREST)
texParameterf(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE)
texParameterf(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT)
texParameterf(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.MIRRORED_REPEAT)
texParameterf(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE)
texParameterf(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT)
texParameterf(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.MIRRORED_REPEAT)
Sets texture parameters for the current texture unit.
Errors:
gl.INVALID_OPERATION If no texture is bound.
gl.INVALID_ENUM If target, pname, or param values are invalid.
The target texture for the current texture unit. Must be one of the following:
gl.TEXTURE_2D Represents a 2D image.
gl.TEXTURE_CUBE_MAP The texture is composed of six 2D images, one for each face of a cube.
The name of the texture parameter. Use one of the following:
gl.TEXTURE_MIN_FILTER A texture filter constant to use when a surface is rendered smaller than the corresponding texture bitmap (such as for distant objects). Initial value is gl.NEAREST_MIPMAP_LINEAR.
gl.TEXTURE_MAG_FILTER A texture filter constant to use when a surface is rendered larger than the corresponding texture bitmap (such as for close-up objects). Initial value is gl.LINEAR.
gl.TEXTURE_WRAP_S Sets the wrap parameter for texture coordinate s to either gl.CLAMP or gl.REPEAT. gl.CLAMP causes s coordinates to be clamped to the range [0,1] and is useful for preventing wrapping artifacts when mapping a single image onto an object. gl.REPEAT causes the integer part of the s coordinate to be ignored; WebGL uses only the fractional part, thereby creating a repeating pattern. Border texture elements are accessed only if wrapping is set to gl.CLAMP. Initially, gl.TEXTURE_WRAP_S is set to gl.REPEAT.
gl.TEXTURE_WRAP_T Sets the wrap parameter for texture coordinate t to either gl.CLAMP or gl.REPEAT. Initial value is gl.REPEAT.
gl.TEXTURE_MAX_ANISOTROPY_EXT Use anisotropic filtering. You must call getExtension("gl.TEXTURE_MAX_ANISOTROPY_EXT") first to enable. For more info, see Anisotropic filtering.
The value of pname. The value of param depends on the value of pname.
When using floating-point textures, only gl.NEAREST is supported. The following shows possible calling values:
texParameterf(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR)
texParameterf(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST)
texParameterf(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST)
texParameterf(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR)
texParameterf(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_LINEAR)
texParameterf(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST_MIPMAP_NEAREST)
texParameterf(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST_MIPMAP_LINEAR)
texParameterf(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_NEAREST)
texParameterf(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE)
texParameterf(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT)
texParameterf(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.MIRRORED_REPEAT)
texParameterf(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE)
texParameterf(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT)
texParameterf(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.MIRRORED_REPEAT)
Replaces a portion of an existing 2D texture image with all of another image.
When using an ArrayBufferView for pixels and gl.FLOAT for type, the array must be a Float32Array rather than a UInt8Array.
Errors:
gl.SECURITY_ERR Occurs if an image or canvas is supplied and doesn't have the same origin of the canvas associated with the WebGLRenderingContext.
gl.INVALID_VALUE If pixels is null.
If level is < 0, or greater than maximum allowable value.
If xoffset is greater than the width of the texture image.
If yoffset is greater than the height of the texture image.
gl.INVALID_OPERATION If called without a currently bound texture.
The type doesn't match the type originally defined for the texture.
If type and format aren't compatible values.
gl.INVALID_ENUM If target, format, or type aren't one of the listed values.
The target texture of the active texture unit. Must be one of the following:
gl.TEXTURE_2D Uses a 2D image.
gl.TEXTURE_CUBE_MAP_POSITIVE_X Image for the positive X face of the cube map.
gl.TEXTURE_CUBE_MAP_NEGATIVE_X Image for the negative X face of the cube map.
gl.TEXTURE_CUBE_MAP_POSITIVE_Y Image for the positive Y face of the cube map.
gl.TEXTURE_CUBE_MAP_NEGATIVE_Y Image for the negative Y face of the cube map.
gl.TEXTURE_CUBE_MAP_POSITIVE_Z Image for the positive Z face of the cube map.
gl.TEXTURE_CUBE_MAP_NEGATIVE_Z Image for the negative Z face of the cube map.
The level of detail to use with the texture.
The x (horizontal) offset within the texture image.
The y (vertical) offset within the texture image.
Width of texture sub-image. Value used only when UInt8Array or Float32Array for pixels is specified.
Height of texture sub-image. Value used only when UInt8Array or Float32Array for pixels is specified.
The format of the source pixel data.
gl.ALPHA Each element is a single alpha component. The system converts it to floating point, clamped to the range [0, 1], and assembles it into an RGBA element by placing attaching 0.0 to the red, green and blue channels.
gl.LUMINANCE Each element is a single luminance component. The system converts it to floating point value, clamped to the range [0, 1], and assembles it into an RGBA element by placing the luminance value in the red, green and blue channels, and attaching 1.0 to the alpha channel.
gl.LUMINANCE_ALPHA Each element is an luminance/alpha double. The systems converts each component to floating point, clamped to the range [0, 1], and assembles them into an RGBA element by placing the luminance value in the red, green and blue channels.
gl.RGB Red, green, and blue channels.
gl.RGBA Red, green, blue, and alpha (transparency) channels.
The data type of the pixel data.
gl.UNSIGNED_BYTE
gl.FLOAT Call getExtension("gl.OES_texture_float") first to enable. This creates 128bit-per-pixel textures instead of 32bit-per-pixel for the image.
The ArrayBufferView to use for the texture.
Replaces a portion of an existing 2D texture image with all of another image.
Errors:
gl.SECURITY_ERR Occurs if an image or canvas is supplied and doesn't have the same origin of the canvas associated with the WebGLRenderingContext.
gl.INVALID_VALUE If pixels is null.
If level is < 0, or greater than maximum allowable value.
If xoffset is greater than the width of the texture image.
If yoffset is greater than the height of the texture image.
gl.INVALID_OPERATION If called without a currently bound texture.
The type doesn't match the type originally defined for the texture.
If type and format aren't compatible values.
gl.INVALID_ENUM If target, format, or type aren't one of the listed values.
The target texture of the active texture unit. Must be one of the following:
gl.TEXTURE_2D Uses a 2D image.
gl.TEXTURE_CUBE_MAP_POSITIVE_X Image for the positive X face of the cube map.
gl.TEXTURE_CUBE_MAP_NEGATIVE_X Image for the negative X face of the cube map.
gl.TEXTURE_CUBE_MAP_POSITIVE_Y Image for the positive Y face of the cube map.
gl.TEXTURE_CUBE_MAP_NEGATIVE_Y Image for the negative Y face of the cube map.
gl.TEXTURE_CUBE_MAP_POSITIVE_Z Image for the positive Z face of the cube map.
gl.TEXTURE_CUBE_MAP_NEGATIVE_Z Image for the negative Z face of the cube map.
The level of detail to use with the texture.
The x (horizontal) offset within the texture image.
The y (vertical) offset within the texture image.
Width of texture sub-image. Value used only when UInt8Array or Float32Array for pixels is specified.
Height of texture sub-image. Value used only when UInt8Array or Float32Array for pixels is specified.
The format of the source pixel data.
gl.ALPHA Each element is a single alpha component. The system converts it to floating point, clamped to the range [0, 1], and assembles it into an RGBA element by placing attaching 0.0 to the red, green and blue channels.
gl.LUMINANCE Each element is a single luminance component. The system converts it to floating point value, clamped to the range [0, 1], and assembles it into an RGBA element by placing the luminance value in the red, green and blue channels, and attaching 1.0 to the alpha channel.
gl.LUMINANCE_ALPHA Each element is an luminance/alpha double. The systems converts each component to floating point, clamped to the range [0, 1], and assembles them into an RGBA element by placing the luminance value in the red, green and blue channels.
gl.RGB Red, green, and blue channels.
gl.RGBA Red, green, blue, and alpha (transparency) channels.
The data type of the pixel data.
gl.UNSIGNED_BYTE
gl.FLOAT Call getExtension("gl.OES_texture_float") first to enable. This creates 128bit-per-pixel textures instead of 32bit-per-pixel for the image.
The CanvasElement to use for the texture.
Replaces a portion of an existing 2D texture image with all of another image.
Errors:
gl.SECURITY_ERR Occurs if an image or canvas is supplied and doesn't have the same origin of the canvas associated with the WebGLRenderingContext.
gl.INVALID_VALUE If pixels is null.
If level is < 0, or greater than maximum allowable value.
If xoffset is greater than the width of the texture image.
If yoffset is greater than the height of the texture image.
gl.INVALID_OPERATION If called without a currently bound texture.
The type doesn't match the type originally defined for the texture.
If type and format aren't compatible values.
gl.INVALID_ENUM If target, format, or type aren't one of the listed values.
The target texture of the active texture unit. Must be one of the following:
gl.TEXTURE_2D Uses a 2D image.
gl.TEXTURE_CUBE_MAP_POSITIVE_X Image for the positive X face of the cube map.
gl.TEXTURE_CUBE_MAP_NEGATIVE_X Image for the negative X face of the cube map.
gl.TEXTURE_CUBE_MAP_POSITIVE_Y Image for the positive Y face of the cube map.
gl.TEXTURE_CUBE_MAP_NEGATIVE_Y Image for the negative Y face of the cube map.
gl.TEXTURE_CUBE_MAP_POSITIVE_Z Image for the positive Z face of the cube map.
gl.TEXTURE_CUBE_MAP_NEGATIVE_Z Image for the negative Z face of the cube map.
The level of detail to use with the texture.
The x (horizontal) offset within the texture image.
The y (vertical) offset within the texture image.
Width of texture sub-image. Value used only when UInt8Array or Float32Array for pixels is specified.
Height of texture sub-image. Value used only when UInt8Array or Float32Array for pixels is specified.
The format of the source pixel data.
gl.ALPHA Each element is a single alpha component. The system converts it to floating point, clamped to the range [0, 1], and assembles it into an RGBA element by placing attaching 0.0 to the red, green and blue channels.
gl.LUMINANCE Each element is a single luminance component. The system converts it to floating point value, clamped to the range [0, 1], and assembles it into an RGBA element by placing the luminance value in the red, green and blue channels, and attaching 1.0 to the alpha channel.
gl.LUMINANCE_ALPHA Each element is an luminance/alpha double. The systems converts each component to floating point, clamped to the range [0, 1], and assembles them into an RGBA element by placing the luminance value in the red, green and blue channels.
gl.RGB Red, green, and blue channels.
gl.RGBA Red, green, blue, and alpha (transparency) channels.
The data type of the pixel data.
gl.UNSIGNED_BYTE
gl.FLOAT Call getExtension("gl.OES_texture_float") first to enable. This creates 128bit-per-pixel textures instead of 32bit-per-pixel for the image.
The ImageElement to use for the texture.
Replaces a portion of an existing 2D texture image with all of another image.
Errors:
gl.SECURITY_ERR Occurs if an image or canvas is supplied and doesn't have the same origin of the canvas associated with the WebGLRenderingContext.
gl.INVALID_VALUE If pixels is null.
If level is < 0, or greater than maximum allowable value.
If xoffset is greater than the width of the texture image.
If yoffset is greater than the height of the texture image.
gl.INVALID_OPERATION If called without a currently bound texture.
The type doesn't match the type originally defined for the texture.
If type and format aren't compatible values.
gl.INVALID_ENUM If target, format, or type aren't one of the listed values.
The target texture of the active texture unit. Must be one of the following:
gl.TEXTURE_2D Uses a 2D image.
gl.TEXTURE_CUBE_MAP_POSITIVE_X Image for the positive X face of the cube map.
gl.TEXTURE_CUBE_MAP_NEGATIVE_X Image for the negative X face of the cube map.
gl.TEXTURE_CUBE_MAP_POSITIVE_Y Image for the positive Y face of the cube map.
gl.TEXTURE_CUBE_MAP_NEGATIVE_Y Image for the negative Y face of the cube map.
gl.TEXTURE_CUBE_MAP_POSITIVE_Z Image for the positive Z face of the cube map.
gl.TEXTURE_CUBE_MAP_NEGATIVE_Z Image for the negative Z face of the cube map.
The level of detail to use with the texture.
The x (horizontal) offset within the texture image.
The y (vertical) offset within the texture image.
Width of texture sub-image. Value used only when UInt8Array or Float32Array for pixels is specified.
Height of texture sub-image. Value used only when UInt8Array or Float32Array for pixels is specified.
The format of the source pixel data.
gl.ALPHA Each element is a single alpha component. The system converts it to floating point, clamped to the range [0, 1], and assembles it into an RGBA element by placing attaching 0.0 to the red, green and blue channels.
gl.LUMINANCE Each element is a single luminance component. The system converts it to floating point value, clamped to the range [0, 1], and assembles it into an RGBA element by placing the luminance value in the red, green and blue channels, and attaching 1.0 to the alpha channel.
gl.LUMINANCE_ALPHA Each element is an luminance/alpha double. The systems converts each component to floating point, clamped to the range [0, 1], and assembles them into an RGBA element by placing the luminance value in the red, green and blue channels.
gl.RGB Red, green, and blue channels.
gl.RGBA Red, green, blue, and alpha (transparency) channels.
The data type of the pixel data.
gl.UNSIGNED_BYTE
gl.FLOAT Call getExtension("gl.OES_texture_float") first to enable. This creates 128bit-per-pixel textures instead of 32bit-per-pixel for the image.
The ImageData array to use for the texture.
Assigns a floating point value to a uniform variable for the current program object.
Errors:
gl.INVALID_OPERATION There's no active program object.
The size and type of the uniform variable doesn't match the size and type of the value loaded.
The location:
null Data passed will fail silently, no uniform variables will be changed.
location Specifies the location of the uniform to modify. WebGLUniformLocation instance returned by getUniformLocation.
The new floating point value for the uniform variable.
Assigns a floating point vector array to a uniform vector variable for the current program object.
If the location is null, no uniforms are updated and no error code is generated.
The expected behavior when the uniform being updated is an array, the length of 'values' is a multiple of the number of required vector components, and the length of 'values' is either greater than or less than the number of elements in the uniform array (the elements in the uniform array which contain corresponding elements in the 'value' array are updated and no error is generated)
Errors:
gl.INVALID_OPERATION The location doesn't belong to the current program.
There is no active program.
Length of the value array is greater than 1 and the uniform pointed to by location isn't a uniform array.
value references a typed array instance other than Float32Array.
Uniform specified by location isn't a float type.
gl.INVALID_VALUE The length of value array isn't a multiple of the number of required components.
The location:
null Data passed will fail silently, no uniform variables will be changed.
string Location of uniform variable to be changed.
The new floating point vector array for the uniform variable.
Assigns an integer value to a uniform variable for the current program object.
Uniform1i can be used to set texture samplers. If location is a texture sampler, then value refers to an offset into the array of active textures.
Errors:
gl.INVALID_OPERATION The location doesn't belong to the current program.
There is no current program object.
If location is an invalid location for the current program object and location isn't equal to -1.
Specifies the location of the uniform to modify.
The new value for the uniform variable.
Assigns a boolean value to a uniform variable for the current program object.
Uniform1i can be used to set texture samplers. If location is a texture sampler, then value refers to an offset into the array of active textures.
Errors:
gl.INVALID_OPERATION The location doesn't belong to the current program.
There is no current program object.
If location is an invalid location for the current program object and location isn't equal to -1.
Specifies the location of the uniform to modify.
The new value for the uniform variable.
Assigns an integer vector array value to a uniform variable for the current program object.
Errors:
gl.INVALID_OPERATION The location doesn't belong to the current program.
There is no current program object.
If location is an invalid location for the current program object and location isn't equal to -1.
The location of the uniform to modify.
An Integer array of data for the uniform.
Assigns two dimensional floating point values to a uniform variable for the current program object.
Errors:
gl.INVALID_OPERATION The location doesn't belong to the current program.
There is no current program object.
If location is an invalid location for the current program object and location isn't equal to -1.
The location of the uniform variable to be updated.
Horizontal value to assign.
Vertical value to assign.
Assigns two dimensional floating point vector array to a uniform variable for the current program object.
If the location is null, no uniforms are updated and no error code is generated.
Errors:
gl.INVALID_OPERATION The location doesn't belong to the current program.
There is no active program.
value references a typed array instance other than Float32Array.
Uniform specified by location isn't a float type.
gl.INVALID_VALUE The length of value array isn't a multiple of the number of required components.
The location of the uniform variable to be updated.
Two dimensional floating point array to assign.
Assigns two dimensional integer value to a uniform variable for the current program object.
If the location is null, no uniforms are updated and no error code is generated.
Errors:
gl.INVALID_OPERATION The location doesn't belong to the current program.
There is no current program object.
If location is an invalid location for the current program object and location isn't equal to -1.
The location of the uniform variable to be updated.
Horizontal value to assign.
Vertical value to assign.
Assigns two dimensional integer vector array values to a uniform variable for the current program object.
If the location is null, no uniforms are updated and no error code is generated.
Errors:
gl.INVALID_OPERATION The location doesn't belong to the current program.
There is no current program object.
If location is an invalid location for the current program object and location isn't equal to -1.
value references a typed array instance other than Float32Array.
Uniform specified by location isn't a float type.
The location of the uniform variable to be updated.
Two dimensional ingeter array to assign.
Assigns three dimensional floating point values to a uniform variable for the current program object.
If the location is null, no uniforms are updated and no error code is generated.
Errors:
gl.INVALID_OPERATION The location doesn't belong to the current program.
There is no active program.
Uniform specified by location isn't a float type.
The location of the uniform variable to be updated.
Horizontal value to assign.
Vertical value to assign.
Depth value to assign.
Assigns three dimensional floating point vector array values to a uniform variable for the current program object.
If the location is null, no uniforms are updated and no error code is generated.
Errors:
gl.INVALID_OPERATION The location doesn't belong to the current program.
There is no active program.
value references a typed array instance other than Float32Array.
Uniform specified by location isn't a float type.
gl.INVALID_VALUE The length of value array isn't a multiple of the number of required components.
The location of the uniform variable to be updated.
Three dimensional floating point array to assign.
Assigns three dimensional integer values to a uniform variable for the current program object.
If the location is null, no uniforms are updated and no error code is generated.
Errors:
gl.INVALID_OPERATION The location doesn't belong to the current program.
There is no active program.
Uniform specified by location isn't an integer type.
The location of the uniform variable to be updated.
Horizontal value to assign.
Vertical value to assign.
Depth value to assign.
Assigns three dimensional integer vector array values to a uniform variable for the current program object.
If the location is null, no uniforms are updated and no error code is generated.
Errors:
gl.INVALID_OPERATION The location doesn't belong to the current program.
There is no active program.
value references a typed array instance other than Int32Array
Uniform specified by location isn't an in type.
gl.INVALID_VALUE The length of value array isn't a multiple of the number of required components.
The location of the uniform variable to be updated.
Three dimensional integer array to assign.
Assigns four dimensional floating point values to a uniform variable for the current program object.
If the location is null, no uniforms are updated and no error code is generated.
Errors:
gl.INVALID_OPERATION The location doesn't belong to the current program.
There is no active program.
Uniform specified by location isn't a float type.
The location of the uniform variable to be updated.
Horizontal value to assign.
Vertical value to assign.
Depth value to assign.
Scaling value to assign.
Assigns four dimensional floating point vector array values to a uniform variable for the current program object.
If the location is null, no uniforms are updated and no error code is generated.
Errors:
gl.INVALID_OPERATION The location doesn't belong to the current program.
There is no active program.
value references a typed array instance other than Float32Array.
Uniform specified by location isn't a float type.
gl.INVALID_VALUE The length of value array isn't a multiple of the number of required components.
The location of the uniform variable to be updated.
Four dimensional floating point array to assign.
Assigns four dimensional integer values to a uniform variable for the current program object.
If the location is null, no uniforms are updated and no error code is generated.
Errors:
gl.INVALID_OPERATION The location doesn't belong to the current program.
There is no active program.
Uniform specified by location isn't an integer type.
The location of the uniform variable to be updated.
Horizontal value to assign.
Vertical value to assign.
Depth value to assign.
Scaling value to assign.
Assigns four dimensional integer vector array values to a uniform variable for the current program object.
If the location is null, no uniforms are updated and no error code is generated.
Errors:
gl.INVALID_OPERATION The location doesn't belong to the current program.
There is no active program.
value references a typed array instance other than Int32Array.
Uniform specified by location isn't an integer type.
gl.INVALID_VALUE The length of value array isn't a multiple of the number of required components.
The location of the uniform variable to be updated.
Four dimensional integer array to assign.
Sets values for a 2x2 floating point vector matrix into a uniform location as a matrix or a matrix array.
If the location is null, no uniforms are updated and no error code is generated.
Errors:
gl.INVALID_OPERATION The location doesn't belong to the current program.
There is no active program.
The passed in uniform location isn't a matrix of the required dimensions.
gl.INVALID_VALUE The length of value array isn't a multiple of the required matrix element count.
If transpose equals gl.TRUE.
The location of uniform variable to be updated. Locate set by getUniformLocation.
Sets whether to transpose the matrix as the values are loaded into the uniform variable. Must be set to gl.FALSE.
An array of float values representing one or more 2x2 matrices.
Sets values for a 3x3 floating point vector matrix into a uniform location as a matrix or a matrix array.
If the location is null, no uniforms are updated and no error code is generated.
Errors:
gl.INVALID_OPERATION The location doesn't belong to the current program.
There is no active program.
The passed in uniform location isn't a matrix of the required dimensions.
gl.INVALID_VALUE The length of value array isn't a multiple of the required matrix element count.
If transpose equals gl.TRUE.
The location of uniform variable to be updated. Locate set by getUniformLocation.
Sets whether to transpose the matrix as the values are loaded into the uniform variable. Must be set to gl.FALSE.
An array of float values representing one or more 3x3 matrices.
Sets values for a 4x4 floating point vector matrix into a uniform location as a matrix or a matrix array.
If the location is null, no uniforms are updated and no error code is generated.
Errors:
gl.INVALID_OPERATION The location doesn't belong to the current program.
There is no active program.
The passed in uniform location isn't a matrix of the required dimensions.
gl.INVALID_VALUE The length of value array isn't a multiple of the required matrix element count.
If transpose equals gl.TRUE.
The location of uniform variable to be updated. Locate set by getUniformLocation.
Sets whether to transpose the matrix as the values are loaded into the uniform variable. Must be set to gl.FALSE.
An array of float values representing one or more 3x3 matrices.
Set the program object to use for rendering.
Program objects can be used for multiple rendering contexts.
Errors:
gl.INVALID_OPERATION If program hasn't been linked.
If program isn't a WebGLProgram object, but is a WebGL generated object.
gl.INVALID_VALUE If program isn't a WebGL generated object.
The program object.
Returns whether a given program can run in the current WebGL state.
A program is considered invalid if it hasn't successfully linked, or any two active samplers in the program are different types, but refer to the same texture image unit.
This method is used in conjunction with getProgramParameter called with gl.VALIDATE_STATUS to test for a valid program.
The program to validate.
Specifies the data formats and locations of attributes in a vertex attributes array.
The method can specify UNSIGNED_BYTE, BYTE, SHORT and UNSIGNED_SHORT for both normalized and un-normalized formats (all component types, 1 through 4, are supported) in Internet Explorer 11 using WebGL renderer version 0.93 and later.
Errors:
gl.INVALID_VALUE If size isn't between 1 and 4.
If stride is negative.
If offset is negative.
gl.INVALID_OPERATION If stride or offset are not a multiple of type.
If no WebGL array buffer is bound.
gl.INVALID_ENUM If type isn't an accepted value.
Index of target attribute in the buffer bound to gl.ARRAY_BUFFER.
The number of components per attribute. Must be 1,2,3,or 4. Default is 4.
Specifies the data type of each component in the array. Use one of the following values: gl.FLOAT (default), gl.FIXED
false - values are converted to fixed point values when accessed.
true - values are normalized when accessed.
Specifies the offset in bytes between the beginning of consecutive vertex attributes. Default value is 0, maximum is 255. Must be a multiple of type.
Specifies an offset in bytes of the first component of the first vertex attribute in the array. Default is 0 which means that vertex attributes are tightly packed. Must be a multiple of type.
Represents a rectangular viewable area that contains the rendering results of the drawing buffer.
Errors:
gl.INVALID_VALUE If the width or height is negative.
The horizontal component of the viewport origin. Default is 0.
The vertical component of the viewport origin. Default is 0.
The width of the viewport. Default equals the width of the parent canvas.
The height of the viewport. Default equals the height of the parent canvas.
The Canvas element associated with this context. May be null!
Width of the current drawing buffer. Should match the width of the canvas element associated with this context.
Height of the current drawing buffer. Should match the height of the canvas element associated with this context.
The object that specifies what and how content is to be drawn to the screen.
The WebGLShader object does not define any members.
Shaders are created using createShader.
The texture object.
Corresponds to the location of a uniform variable in a shader program.
The WebGLUniformLocation object does not define any members.