Methods
The WebGL method reference documentation.
In this section
| Topic | Description |
|---|---|
|
Specifies the active texture unit. | |
|
Attaches a WebGLShader object to a WebGLProgram object. | |
|
Binds a generic vertex index to a user-defined attribute variable. | |
|
Associates a buffer with a buffer target. | |
|
Associates a WebGLFramebuffer object with the gl.FRAMEBUFFER bind target. | |
|
Binds a WebGLRenderbuffer object to be used for rendering. | |
|
Binds a named texture object to a target. | |
|
Specifies the blend color used to calculate source and destination blending. | |
|
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. | |
|
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. | |
|
Sets the blending factors used to combine source and destination pixels. | |
|
Sets the weighting factors that are used by blendEquationSeparate. | |
|
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. | |
|
Used to modify or update some or all of a data store for a bound buffer object. | |
|
Returns whether the currently bound WebGLFramebuffer is complete. If not complete, returns the reason why. | |
|
Sets all pixels in a specific buffer to the same value. | |
|
Specifies color values to use by the clear method to clear the color buffer. | |
|
Clears the depth buffer to a specific value. | |
|
Specifies the clear value to be used by the clear method to clear the stencil buffer. | |
|
Lets you set whether individual colors can be written when drawing or rendering to a framebuffer. | |
|
Compiles the GLSL shader source into binary data used by the WebGLProgram object. | |
|
Specifies a two-dimensional texture image or cube Map image from compressed image data. | |
|
Specifies a two-dimensional texture or cube Map sub-image from compressed image data. | |
|
Copies a rectangle of pixels from the current WebGLFramebuffer into a texture image. | |
|
Replaces a portion of an existing 2D texture image with data from the current framebuffer. | |
|
Creates and initializes a WebGLBuffer. | |
|
Returns a WebGLFramebuffer object. | |
|
Creates an empty WebGLProgram object to which vector and fragment WebGLShader objects can be bound. | |
|
Creates and returns a WebGLRenderbuffer object. | |
|
Returns an empty vertex or fragment shader object based on the type specified. | |
|
Used to generate a WebGLTexture object to which images can be bound. | |
|
Sets whether or not front, back, or both facing facets are able to be culled. | |
|
Delete a specific buffer. | |
|
Deletes a specific WebGLFramebuffer object. | |
|
Flags a specific WebGLProgram object for deletion if currently active. | |
|
Deletes the specified renderbuffer object. | |
|
Deletes a specific shader object. | |
|
Deletes a specific texture object. | |
|
Sets a function to use to compare incoming pixel depth to the current depth buffer value. | |
|
Sets whether or not you can write to the depth buffer. | |
|
Sets the depth range for normalized coordinates to canvas or viewport depth coordinates. | |
|
Detach a shader object from a program object. | |
|
Turns off specific WebGL capabilities for this context. | |
|
Turns off a vertex attribute array at a specific index position. | |
|
Render geometric primitives from bound and enabled vertex data. | |
|
Render geometric primitives from bound and enabled instanced array vertex data. Call gl.getExtension("ANGLE_instanced_arrays") to enable ANGLE_instanced_arrays before using this method. | |
|
Renders geometric primitives indexed by element array data. | |
|
Renders geometric primitives indexed by instanced array element data. Call gl.getExtension("ANGLE_instanced_arrays") to enable ANGLE_instanced_arrays before using this method. | |
|
Turns on specific WebGL capabilities for this context. | |
|
Turns on a vertex attribute at a specific index position in a vertex attribute array. | |
|
Attaches a WebGLRenderbuffer object as a logical buffer to the currently bound WebGLFramebuffer object. | |
|
Attaches a texture to a WebGLFramebuffer object. | |
|
Sets whether or not polygons are considered front-facing based on their winding direction. | |
|
Creates a set of textures for a WebGLTexture object with image dimensions from the original size of the image down to a 1x1 image. | |
|
Returns an WebGLActiveInfo object containing the size, type, and name of a vertex attribute at a specific index position in a program object. | |
|
Returns an WebGLActiveInfo object containing the size, type, and name of a uniform attribute at a specific index position in a program object. | |
|
Returns a list of WebGLShaders bound to a WebGLProgram. | |
|
Returns an index to the location in a program of a named attribute variable. | |
|
Returns the type of a parameter for a given buffer. | |
|
Returns an object that describes the attributes set on a context when it was created. | |
|
Returns a value for the WebGL error flag and clears the flag. | |
|
Enables a passed extension, otherwise returns null. | |
|
Gets a parameter value for a given target and attachment. | |
|
Returns the natural type value for a constant parameter. | |
|
Returns information about the last error that occurred during the failed linking or validation of a WebGL program object. | |
|
Returns the value of the program parameter that corresponds to a supplied pname for a given program, or null if an error occurs. | |
|
Returns a renderbuffer parameter from the currently bound WebGLRenderbuffer object. | |
|
Returns errors which occur when compiling a shader. | |
|
Returns the value of the parameter associated with pname for a shader object. | |
|
Returns the precision and range of the supplied numeric format for a given shader type. | |
|
Returns source code string associated with a shader object. | |
|
Returns an array of supported extension strings. | |
|
Returns the value for a parameter on an active texture unit. | |
|
Gets the uniform value for a specific location in a program. | |
|
Returns a WebGLUniformLocation object for the location of a uniform variable within a WebGLProgram object. | |
|
Returns data for a particular characteristic of a vertex attribute at an index in a vertex attribute array. | |
|
Returns the address of a specified vertex attribute. | |
|
Gets state of WebGLBuffer. Returns true if buffer is valid, false otherwise. | |
|
Returns whether the WebGL context has been lost. | |
|
Returns whether or not a WebGL capability is enabled for this context. | |
|
Gets state of framebuffer. Returns true if buffer is valid, false otherwise. | |
|
Gets state of WebGL program object. Returns true if program object is valid, false otherwise. | |
|
Gets state of WebGL renderbuffer. Returns true if buffer is valid, false otherwise. | |
|
Gets state of WebGL shader. Returns true if shader is valid, false otherwise. | |
|
Gets state of WebGL texture. Returns true if texture is valid, false otherwise. | |
|
Not supported in Internet Explorer 11. Sets the width of lines in WebGL. | |
|
Links an attached vertex shader and an attached fragment shader to a program so it can be used by the graphics processing unit (GPU). | |
|
Sets pixel storage modes for readPixels and unpacking of textures with texImage2D and texSubImage2D . | |
|
Sets the implementation-specific units and scale factor used to calculate fragment depth values. | |
|
Reads pixel data into an ArrayBufferView object from a rectangular area in the color buffer of the active frame buffer. | |
|
Creates or replaces the data store for the currently bound WebGLRenderbuffer object. | |
|
Sets multi-sample coverage parameters for antialiasing. | |
|
Sets the dimensions of the scissor box. | |
|
Sets and replaces shader source code in a shader object. | |
|
Sets the front and back function and reference value for stencil testing. | |
|
Sets the front and/or back function and reference value for stencil testing. | |
|
Controls the front and back writing of individual bits in the stencil planes. | |
|
Controls the front and/or back writing of individual bits in the stencil planes. | |
|
Sets front and back stencil test actions. | |
|
Sets front and/or back stencil test actions. | |
|
Loads the supplied pixel data into a texture. | |
|
Sets texture parameters for the current texture unit. | |
|
Sets texture parameters for the current texture unit. | |
|
Replaces a portion of an existing 2D texture image with all of another image. | |
|
Assigns a floating point value to a uniform variable for the current program object. | |
|
Assigns a floating point vector array to a uniform vector variable for the current program object. | |
|
Assigns an integer value to a uniform variable for the current program object. | |
|
Assigns an integer vector array value to a uniform variable for the current program object. | |
|
Assigns two dimensional floating point values to a uniform variable for the current program object. | |
|
Assigns two dimensional floating point vector array to a uniform variable for the current program object. | |
|
Assigns two dimensional integer value to a uniform variable for the current program object. | |
|
Assigns two dimensional integer vector array values to a uniform variable for the current program object. | |
|
Assigns three dimensional floating point values to a uniform variable for the current program object. | |
|
Assigns three dimensional floating point vector array values to a uniform variable for the current program object. | |
|
Assigns three dimensional integer values to a uniform variable for the current program object. | |
|
Assigns three dimensional integer vector array values to a uniform variable for the current program object. | |
|
Assigns four dimensional floating point values to a uniform variable for the current program object. | |
|
Assigns four dimensional floating point vector array values to a uniform variable for the current program object. | |
|
Assigns four dimensional integer value to a uniform variable for the current program object. | |
|
Assigns four dimensional integer vector array values to a uniform variable for the current program object. | |
|
Sets values for a 2x2 floating point vector matrix into a uniform location as a matrix or a matrix array. | |
|
Sets values for a 3x3 floating point vector matrix into a uniform location as a matrix or a matrix array. | |
|
Sets values for a 4x4 floating point vector matrix into a uniform location as a matrix or a matrix array. | |
|
Set the program object to use for rendering. | |
|
Returns whether a given program can run in the current WebGL state. | |
|
Sets the advance rate for vertex attributes when rendering multiple instances using drawArraysInstancedANGLE or drawElementsInstancedANGLE. This method is enabled using ANGLE_instanced_arrays. | |
|
Specifies the data formats and locations of attributes in a vertex attributes array. | |
|
Represents a rectangular viewable area that contains the rendering results of the drawing buffer. |