Related WebGL APIs
Object mapping user-defined keys to user-defined values to be accessed via DynamicVariables
or DynamicVariableFns elsewhere in the DrawConfig or in scoped DrawCommands.
Context variables in regl are computed before any other parameters and can also be passed
from a scoped command to any sub-commands.
Both DynamicVariables and DynamicVariableFns can be used as values in the context object,
making it possible to define new context properties derived from existing context properties
or from props.
Number of vertices to draw. (Default: 0, or inferred from elements)
Related WebGL APIs
Element array buffer. (Default: null)
Elements must be either an instance of REGL.Elements or else the arguments to REGL.Elements.
If elements is specified while primitive, count and offset are not,
then these values may be inferred from the state of the element array buffer.
Source code of fragment shader
A framebuffer to be used as a target for drawing. (Default: null)
Passing null sets the framebuffer to the drawing buffer.
Updating the render target will modify the viewport.
Related WebGL APIs
Number of instances to draw. (Default: 0)
Only applicable if the ANGLE_instanced_arrays extension is present.
Offset of primitives to draw. (Default: 0, or inferred from elements)
Related WebGL APIs
Sets the primitive type. (Default: 'triangles', or inferred from elements)
If set, turns on profiling for this command. (Default: false)
Profiling stats can be accessed via the stats property of the DrawCommand.
Related WebGL APIs
Object mapping names of uniform variables to their values.
To specify uniforms in GLSL structs use the fully qualified path with dot notation.
example: 'nested.value': 5.3
To specify uniforms in GLSL arrays use the fully qualified path with bracket notation.
example: 'colors[0]': [0, 1, 0, 1]
Related WebGL APIs
Configuration of vertex array object
Source code of vertex shader
Sets gl.viewport. Default: {}
Updating viewport will modify the context variables viewportWidth and viewportHeight.
Generated using TypeDoc
Object mapping names of attribute variables to their values.
Related WebGL APIs