Note: This feature is available in Web Workers.
The WebGL2RenderingContext.getUniformIndices() method of the WebGL 2 API retrieves the indices of a number of uniforms within a WebGLProgram.
getUniformIndices(program, uniformNames)programA WebGLProgram containing uniforms whose indices to query.
uniformNamesAn Array of string specifying the names of the uniforms to query.
An Array of GLuint containing the uniform indices.
const uniformIndices = gl.getUniformIndices(program, [
"UBORed",
"UBOGreen",
"UBOBlue",
]);