Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface DrawConfig<Uniforms, Attributes, Props, OwnContext, ParentContext>

Type Parameters

  • Uniforms extends {} = {}

  • Attributes extends {} = {}

  • Props extends {} = {}

  • OwnContext extends {} = {}

  • ParentContext extends DefaultContext = DefaultContext

Hierarchy

  • DrawConfig

Index

Properties

attributes?: MaybeDynamicAttributes<Attributes, ParentContext & OwnContext, Props>

Object mapping names of attribute variables to their values.

Related WebGL APIs

  • gl.vertexAttribPointer
  • gl.vertexAttrib
  • gl.getAttribLocation
  • gl.vertexAttibDivisor
  • gl.enableVertexAttribArray, gl.disableVertexAttribArray
blend?: MaybeDynamic<BlendingOptions, ParentContext & OwnContext, Props>

Related WebGL APIs

  • gl.blendEquationSeparate
  • gl.blendFuncSeparate
  • gl.blendColor
colorMask?: MaybeDynamic<BVec4, ParentContext & OwnContext, Props>
context?: UserContext<ParentContext, OwnContext, Props>

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.

count?: MaybeDynamic<number, ParentContext & OwnContext, Props>

Number of vertices to draw. (Default: 0, or inferred from elements)

cull?: MaybeDynamic<CullingOptions, ParentContext & OwnContext, Props>
depth?: MaybeDynamic<DepthTestOptions, ParentContext & OwnContext, Props>

Related WebGL APIs

  • gl.depthFunc
  • gl.depthMask
  • gl.depthRange
dither?: MaybeDynamic<boolean, ParentContext & OwnContext, Props>
elements?: MaybeDynamic<null | ElementsData | Elements | ElementsOptions, ParentContext & OwnContext, Props>

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.

frag?: MaybeDynamic<string, ParentContext & OwnContext, Props>

Source code of fragment shader

framebuffer?: MaybeDynamic<null | Framebuffer, ParentContext & OwnContext, Props>

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

frontFace?: MaybeDynamic<FaceWindingType, ParentContext & OwnContext, Props>
instances?: MaybeDynamic<number, ParentContext & OwnContext, Props>

Number of instances to draw. (Default: 0)

Only applicable if the ANGLE_instanced_arrays extension is present.

lineWidth?: MaybeDynamic<number, ParentContext & OwnContext, Props>
offset?: MaybeDynamic<number, ParentContext & OwnContext, Props>

Offset of primitives to draw. (Default: 0, or inferred from elements)

polygonOffset?: MaybeDynamic<PolygonOffsetOptions, ParentContext & OwnContext, Props>

Related WebGL APIs

  • gl.polygonOffset
primitive?: MaybeDynamic<PrimitiveType, ParentContext & OwnContext, Props>

Sets the primitive type. (Default: 'triangles', or inferred from elements)

profile?: MaybeDynamic<boolean, ParentContext & OwnContext, Props>

If set, turns on profiling for this command. (Default: false) Profiling stats can be accessed via the stats property of the DrawCommand.

sample?: MaybeDynamic<SamplingOptions, ParentContext & OwnContext, Props>
scissor?: MaybeNestedDynamic<ScissorOptions, ParentContext & OwnContext, Props>
stencil?: MaybeDynamic<StencilOptions, ParentContext & OwnContext, Props>

Related WebGL APIs

  • gl.stencilFunc
  • gl.stencilMask
  • gl.stencilOpSeparate
uniforms?: MaybeDynamicUniforms<Uniforms, ParentContext & OwnContext, Props>

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

  • gl.getUniformLocation
  • gl.uniform
vao?: MaybeDynamic<AttributeState[] | VertexArrayObject, ParentContext & OwnContext, Props>

Configuration of vertex array object

vert?: MaybeDynamic<string, ParentContext & OwnContext, Props>

Source code of vertex shader

viewport?: MaybeDynamic<BoundingBox, ParentContext & OwnContext, Props>

Sets gl.viewport. Default: {} Updating viewport will modify the context variables viewportWidth and viewportHeight.

Generated using TypeDoc