foliage
Since 0.7
A foliage layer: prototypes (each an instancedMesh child) and how a brush fills them (density, scale, yaw, lean).
The plants are the children's instances; this component only drives the editor's foliage brush.
Use it in a scene entity's components list as { "type": "foliage", … }. The contract writes the fields flat and refuses unknown keys.
Fields
| Field | Type | Required | Default | Allowed values | Description |
|---|---|---|---|---|---|
prototypes | FoliagePrototype[] | yes | The kinds of plant the layer places, 1 to 32, each an instancedMesh child chosen by weight. | ||
density | number | no | 0 | Plants per square metre a full brush leaves. Default 0.04 (one per 25 m²). | |
seed | integer | no | 0 | Seeds where a brush puts plants and which prototype, scale and yaw each gets. Default 0. | |
collisionLayout | InstanceCollisionLayout | no | perInstance | perInstance, cells | How the prototypes' instanced meshes collide when they do not say themselves (see InstanceCollisionLayout). Default "perInstance". |