twgl.setUniforms() is equivalent to a combo of WebGL functions to bind the texture and set the uniforms. The scheme is:
const tex = gl.createTexture();
//...
// Bind the texture
gl.activeTexture(...);
gl.bindTexture(...);
gl.uniform1i(...); // for the texture
/*
* Set the uniforms -- For each uniform, depending
* on its type, a call of a corresponding function
* from the 'uniform' function group
*/
gl.uniform<...>(...);
//...
A more extensive example of how to translate setUniforms() into native WebGL can be found in the TWGL documentation of setUniforms(). An overview of all WebGL functions, including the uniform variants, can be found in the official WebGL 2.0 API Quick Reference Guide.
twgl.setUniforms()
is equivalent to a combo of WebGL functions to bind the texture and set the uniforms. The scheme is:A more extensive example of how to translate
setUniforms()
into native WebGL can be found in the TWGL documentation of setUniforms(). An overview of all WebGL functions, including theuniform
variants, can be found in the official WebGL 2.0 API Quick Reference Guide.