Motion SDK

Terrain

Seeded heightfields for ground, hills and mountains, with flat areas for lots and roads.

{"terrain": {...}} is a geometry: a seeded noise heightfield. Put a surface material on it.

A level lot inside rolling hills, and ridged mountains on the horizon.
{
  "camera": { "position": [0, 14, 46], "target": [0, 4, 0], "fov": 45 },
  "lighting": { "rig": "golden_hour" },
  "environment": { "background": { "sky": {} } },
  "materials": {
    "dirt": { "preset": "gravel", "color": "#a77b5a" },
    "rock": { "preset": "rock", "color": "#6d5a7a" }
  },
  "nodes": {
    "ground": {
      "mesh": {
        "geometry": {
          "terrain": {
            "size": [160, 160],
            "height": 4,
            "scale": 25,
            "flat": { "center": [0, 10], "radius": 14, "falloff": 20 }
          }
        },
        "material": "dirt"
      }
    },
    "mountains": {
      "transform": { "position": [0, -2, -60] },
      "mesh": {
        "geometry": {
          "terrain": {
            "size": [400, 200],
            "height": 45,
            "scale": 60,
            "ridged": true,
            "flat": { "center": [0, 60], "radius": 70, "falloff": 50 }
          }
        },
        "material": "rock"
      }
    }
  }
}
A level lot inside rolling hills, and ridged mountains on the horizon. apps/docs/examples/terrain.json · render it with motion-sdk render apps/docs/examples/terrain.json -t 1 -o terrain.png

Shape

  • size: the area in world units.
  • height and scale: how tall the features are and how wide.
  • octaves: detail. ridged: true makes sharp mountain crests.
  • flat: a level region with a center, radius and falloff, for a parking lot, a road or a stage.
  • resolution: grid vertices per side.

Mountains on the Horizon

Use a second, larger terrain far away with ridged: true, a big height, and a large flat radius so it only rises in the distance. Sink it slightly below the ground so the two flat areas don't overlap.

API Reference

Terrain

A noise heightfield on the XZ plane, centred on the node.

PropertyTypeDefaultDescription
flatFlatArea—Keeps a flat area around flat.center and ramps the noise up past radius over falloff: a level lot with hills, or mountains only on the horizon.
heightnumber2Peak height in world units.
octavesinteger5Noise octaves (1..8): more adds finer detail.
resolutioninteger128Grid cells per side (2..512). Higher is smoother and heavier.
ridgedbooleanfalseSharp ridged crests (mountains) instead of rolling hills.
scalenumber20Feature size in world units (distance between hills).
seedinteger0Seed for the height noise.
size[x, y][100,100]Width (x) and depth (z) in world units.

FlatArea

A flat region in a [Terrain].

PropertyTypeDefaultDescription
center[x, y][0,0]Centre [x, z] in the terrain's local space.
falloffnumber10Distance over which the flat area blends back into the hills.
radius*numberrequiredRadius of the flat area.