Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

InstancedModelBaseProps

What every <InstancedModel> takes beside its cull.

Property Type Default value Description
cameraCollision? boolean the plants taller than the knee Whether the follow camera’s eye stops in front of the copies, as at a solid, rather than passing through them, by the cards of the nearest model whole, their cut-out texels too. No body collides with them for it: collider says what does. A copy the eye’s sweep starts inside, such as a bush the character stands in, lets the eye through. Only copies in a Landscape stop it, as the eye’s sweep reads the Landscape’s ground. Left out, the copies of a defineFoliage material taller than the knee, 0.5 m, and none of any other.
castShadow? boolean true Whether the copies cast the sun’s shadow; a level may say otherwise for its own. They receive it either way. Off for small plants on a low quality level saves the shadow pass most of its triangles.
collider? ModelCollider the model's own collider What of each copy the character and every body collide with, in the room and on every page: the collider the model’s manifest baked, its trunk for a tree and its hull for a rock, when left out; one of the game’s own, as a manifest writes one; or false for copies nothing meets, such as grass, litter or a backdrop past the map’s edge. A batch inside <Views> is drawn only, as every view is, and takes no collider but false. The copies stand with the obstacles of the Landscape round the batch, which the navmesh cuts out; outside a Landscape no ground stands them, and they are drawn only.
detailLevels? DetailLevel[] undefined Cheaper models each copy swaps to as the camera draws away, in any order: a copy draws the level with the largest distance it is past, and model nearer than all of them, measured from the camera that draws it. A copy changes level as the camera moves, so build the levels’ models to the same size and foot, and set fadeWidth to cross-fade them. Left out, every copy draws model at every distance. three’s LOD calls these levels; the longer name keeps them apart from a game’s levels and the quality levels.
fadeWidth? number 0, a switch with no fade Metres over which a copy cross-fades into each level, ending at the level’s distance, and fades out before cullDistance, so a tree does not pop as the camera walks. A dither over the screen, so a copy stays opaque, writes depth and casts its fading shadow. No wider than the room before any switch. Unity’s LOD group calls this fadeTransitionWidth, a share of a level’s range; ours is metres, since the levels switch by distance. The cull’s band takes cullFadeWidth where it is given.
idleMotion? IdleMotionAttributes undefined Moves every copy as <IdleMotion> moves what it holds: a float or a sway, the map’s idleMotion shape, its pivot in a copy’s own metres from its foot. Each copy starts its cycle from its spot unless the motion names a seed, and a float rides the sea it rests on. Only the drawing moves, and every bound a copy is culled by grows by as far as it swings. The far shadow map keeps each copy at rest. Left out, the copies stand still.
material? ModelMaterial undefined What every copy wears in place of each of the file’s materials, handed the one the file gave the mesh: the material the model registered with when left out. Asked once for each of the file’s materials, so define it once, outside the component. The material it returns is the game’s to dispose.
model string undefined A name given to registerModel, or a path the game serves.
perInstanceFrustumCulled? boolean true Whether a pass leaves out each copy outside its camera’s view, so a copy behind the camera costs no draw. A model with detailLevels, a cullDistance or a fadeWidth measures them from the camera that draws, the view’s for the sun’s shadow, culled or not. Turn it off for a material that moves its vertices past the model’s bounds, such as wind sway: the whole batch then draws while any copy is in view, and a copy past its level’s distance still draws nothing.
placements InstancePlacement[] undefined -
static? boolean true Whether the copies stand still, so the sun’s far shadow map draws them once and keeps them past the cascades, at the coarsest level that casts: the one in detailLevels with the largest distance whose castShadow holds, else model. Turn it off for copies the game moves, which then cast only within the cascades’ shadowDistance. Copies past cullDistance from the camera cast nothing far either. Wind sway is left out of the map. Unity’s word for a GameObject that never moves.