Renderer · interface
InstancedOptions
How a batch made by createInstanced behaves.
Explained in Hello world.
interface InstancedOptionsimport type { InstancedOptions } from '@driftengine/core';Properties
| Name | Type | Description |
|---|---|---|
cullreadonlyoptional | boolean | Cull the camera draw: the whole batch skipped when its instances' sphere is out of view or behind
the declared occluders, and otherwise each instance kept only where its sphere meets the view —
on the CPU on WebGL2, as compute into an indirect draw on WebGPU — once the batch is large enough
to repay that (cullsInstances); a smaller one is drawn whole. Shadow, mirror-free motion and
blended draws still see every instance. Off by default, because a batch small enough to draw whole
pays for nothing it would save.MoreFor a batch spread over space — a prop across a region, a crowd, traffic. A batch in one place gains only the whole-batch test, which it could as well do itself. |
animationreadonlyoptional | BoneAnimationHandle | A bone animation every instance plays (createBoneAnimation): each vertex follows the bone its
mesh's second coordinates name, at the instance's own moment of the clip (MeshInstances.clocks
and the clock setAnimationTime sets), in the colour pass and in every shadow. The mesh must
carry second coordinates. See boneAnimation.ts.MoreAn animated batch is culled whole, never instance by instance: its instances read their clocks by index, which a cull that compacts the survivors would reorder. And its bounds are the rest pose's, so a clip that carries vertices far from it wants a mesh whose bounds hold them. What it gives up: under reconstruction or the temporal resolve, a crowd's own movement is not in the frame's motion — the motion pass places a batch by its matrices, not by its clip — so its moving parts are reprojected as though still, which softens a fast clip a little; and a glass batch's coloured shadow is cast from rest. What would make the first wrong is a clip fast enough at the size it is seen to smear, which is then the motion pass's to learn. |