threlte logo
@threlte/extras

<Instance>

webgl <Instance> works with WebGL and is available from the @threlte/extras export. webgpu <Instance> works with WebGPU and is available from the @threlte/extras/webgpu export.

Every <Instance> component nested in an <InstancedMesh> component resembles one instance. An <Instance> can therefore only be used as a child component to a <InstancedMesh> component. The <Instance> component can be transformed and colorized individually:

<InstancedMesh>
  <T.BoxGeometry />
  <T.MeshStandardMaterial />

  <Instance
    position.x={5}
    scale={1}
  />
  <Instance
    position.z={2}
    scale={2}
    color="red"
  />
</InstancedMesh>

Component Signature

<Instance> extends < T . PositionalMesh > and supports all its props, snippets, bindings and events.

Props

name
type
required
default
description

color
ColorRepresentation
no
'white'
The color of this instance.

id
string
no
the id provided by <InstancedMeshes>, otherwise 'default'
The id of the <InstancedMesh> this instance belongs to.