Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Collapse the table of content
Expand the table of content

uniformMatrix4fv method

Sets values for a 4x4 floating point vector matrix into a uniform location as a matrix or a matrix array.




WebGLRenderingContext.uniformMatrix4fv(location, transpose, value);


location [in]

Type: WebGLUniformLocation

The location of uniform variable to be updated. Locate set by getUniformLocation.

transpose [in]

Type: boolean

Sets whether to transpose the matrix as the values are loaded into the uniform variable. Must be set to gl.FALSE.

value [in]

Type: Float32Array

An array of float values representing one or more 4x4 matrices.

Return value

This method does not return a value.


WebGL errorDescription
  • 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.
  • The length of value array isn't a multople of the required matrix element count.
  • If transpose equals gl.TRUE.


If the location is null, no uniforms are updated and no error code is generated.

See also




© 2015 Microsoft