Motion SDK

Scatter

Thousands of rocks, bushes or trees on a terrain in one instanced draw.

A child mesh of a terrain node with "instances": {"on_terrain": {...}} scatters copies on the terrain's surface.

600 rocks and 900 bushes: two draw calls.
{
  "camera": { "position": [0, 6, 24], "target": [0, 1, 0], "fov": 45 },
  "lighting": { "rig": "golden_hour" },
  "environment": { "background": { "sky": {} } },
  "materials": {
    "dirt": { "preset": "gravel", "color": "#9c7656" },
    "stone": { "preset": "rock" },
    "brush": { "color": "#7a7a3a", "shading": "flat" }
  },
  "nodes": {
    "ground": {
      "mesh": {
        "geometry": {
          "terrain": { "size": [120, 120], "height": 3, "scale": 20 }
        },
        "material": "dirt"
      }
    },
    "rocks": {
      "parent": "ground",
      "mesh": {
        "geometry": { "icosahedron": { "radius": 0.5 } },
        "material": "stone",
        "instances": {
          "on_terrain": {
            "terrain": "ground",
            "count": 600,
            "scale": [0.3, 1.2],
            "squash": 0.4,
            "tilt": 15,
            "sink": 0.1,
            "clump": 0.5,
            "exclude": [{ "center": [0, 12], "radius": 5 }],
            "colors": ["#8a7060", "#6a5a50"]
          }
        }
      }
    },
    "bushes": {
      "parent": "ground",
      "mesh": {
        "geometry": { "cone": { "radius": 0.4, "height": 0.9, "segments": 6 } },
        "material": "brush",
        "instances": {
          "on_terrain": {
            "terrain": "ground",
            "count": 900,
            "scale": [0.6, 1.4],
            "max_slope": 30,
            "clump": 0.7
          }
        }
      }
    }
  }
}
600 rocks and 900 bushes: two draw calls. apps/docs/examples/scatter.json · render it with motion-sdk render apps/docs/examples/scatter.json -t 1 -o scatter.png

Controls

  • count, scale (a [min, max] range) and seed.
  • clump: 0 is even, 1 grows in patches.
  • squash, tilt and sink vary the shape and how it sits in the ground. align tilts copies to the slope.
  • max_slope: degrees. Nothing grows on steeper ground.
  • exclude: circles that stay empty, like a parking lot.
  • area: limit scattering to part of the terrain.
  • colors: per-copy tints.

API Reference

TerrainScatter

Seeded scatter on a terrain node (see [Instances::OnTerrain]).

PropertyTypeDefaultDescription
alignbooleanfalseLean copies along the ground's slope.
area[x, y]—[width, depth] of the area to fill, centred on the terrain. Defaults to the whole terrain.
clumpnumber0Clumping 0..1: copies gather in noise-driven patches instead of spreading evenly.
colorsColor[]—Random per-copy tint, picked from this list.
count*integerrequiredCopies to place (fewer when masks reject spots).
excludeExclusion[]—Keep-out circles (the road, the lot, the building).
max_slopenumber90Skip spots steeper than this many degrees.
scale[x, y][0.7,1.3]Uniform scale range [min, max].
seedinteger—Overrides the scene seed.
sinknumber0Push copies this far into the ground (half-buried rocks).
squashnumber0Extra random vertical squash/stretch, 0..1 (flat pebbles, tall brush).
terrain*stringrequiredId of a node whose mesh geometry is a terrain.
tiltnumber0Random tilt in degrees (rocks lean, brush sways).

Exclusion

A circle on the ground ([x, z] in the terrain's local space).

PropertyTypeDefaultDescription
center*[x, y]requiredCentre [x, z] in the terrain's local space.
radius*numberrequiredRadius of the circle that stays empty.