web api instance method
WebGL2RenderingContext: getActiveUniforms() method
Available in workers
The WebGL2RenderingContext.getActiveUniforms() method of
the WebGL 2 API retrieves information about
active uniforms within a WebGLProgram.
Syntax
getActiveUniforms(program, uniformIndices, pname)
Parameters
program- : A
WebGLProgramcontaining the active uniforms.
- : A
uniformIndicespname- : A
GLenumspecifying which information to query. Possible values:gl.UNIFORM_TYPE- : Returns an
ArrayofGLenumindicating the types of the uniforms.
- : Returns an
gl.UNIFORM_SIZEgl.UNIFORM_BLOCK_INDEXgl.UNIFORM_OFFSETgl.UNIFORM_ARRAY_STRIDEgl.UNIFORM_MATRIX_STRIDEgl.UNIFORM_IS_ROW_MAJOR
- : A
Return value
Depends on which information is requested using the pname parameter.
Examples
const uniformIndices = gl.getUniformIndices(program, [
"UBORed",
"UBOGreen",
"UBOBlue",
]);
const uniformOffsets = gl.getActiveUniforms(
program,
uniformIndices,
gl.UNIFORM_OFFSET,
);
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.