Motion SDK

Lighting

Seven tuned light rigs, custom lights, lights that ride on nodes, and soft shadows.

Start from a rig and add lights only where you need them. Up to 8 lights in total, including the rig's.

dramatic_noir dimmed, with a warm shadowed spot and a blue rim light.
{
  "camera": { "position": [0, 3, 8], "target": [0, 0.5, 0], "fov": 40 },
  "lighting": {
    "rig": "dramatic_noir",
    "rig_intensity": 0.4,
    "shadows": { "softness": 1.5, "strength": 0.8 },
    "lights": {
      "key": {
        "spot": {
          "position": [3, 5, 3],
          "target": [0, 0, 0],
          "angle": 30,
          "intensity": 120,
          "color": "#ffd8a8",
          "cast_shadows": true
        }
      },
      "rim": {
        "point": {
          "position": [-3, 2, -2],
          "intensity": 40,
          "color": "#4aa8ff"
        }
      }
    }
  },
  "environment": { "background": { "solid": "#0b0d12" } },
  "materials": { "floor": { "preset": "matte_clay", "color": "#2a2f3a" } },
  "nodes": {
    "floor": {
      "mesh": {
        "geometry": { "plane": { "size": [30, 30] } },
        "material": "floor"
      },
      "transform": { "rotation": [-90, 0, 0] }
    },
    "hero": {
      "transform": { "position": [0, 1, 0] },
      "mesh": {
        "geometry": { "torus_knot": { "radius": 0.8, "tube": 0.26 } },
        "material": "preset:brushed_metal"
      }
    }
  }
}
dramatic_noir dimmed, with a warm shadowed spot and a blue rim light. apps/docs/examples/lighting.json · render it with motion-sdk render apps/docs/examples/lighting.json -t 1 -o lighting.png

Rigs

studio_soft (default), three_point, dramatic_noir, golden_hour, neon_rim, high_key and moonlight. rig_intensity scales the whole rig.

Custom Lights

lights is a map of ambient, directional, point and spot lights. Spots aim at a target with a cone angle and soft penumbra. cast_shadows turns on shadows for directional and spot lights.

Lights on Nodes

Headlights and an amber beacon parented to a moving truck, with fog scattering the beams.
{
  "camera": { "position": [6, 4, 8], "target": [0, 0.5, -4], "fov": 40 },
  "lighting": {
    "rig": "moonlight",
    "rig_intensity": 0.3,
    "lights": {
      "head_l": {
        "spot": {
          "parent": "truck",
          "position": [-0.6, 0.6, -2.1],
          "target": [-1, 0, -14],
          "angle": 22,
          "intensity": 80,
          "color": "#fff1d0"
        }
      },
      "head_r": {
        "spot": {
          "parent": "truck",
          "position": [0.6, 0.6, -2.1],
          "target": [1, 0, -14],
          "angle": 22,
          "intensity": 80,
          "color": "#fff1d0"
        }
      },
      "beacon": {
        "point": {
          "parent": "truck",
          "position": [0, 1.6, 0],
          "intensity": 12,
          "color": "#ffa31a",
          "range": 6
        }
      }
    }
  },
  "environment": {
    "background": { "solid": "#05070c" },
    "fog": { "density": 0.04, "scatter": 1, "color": "#10141c" }
  },
  "materials": {
    "road": { "color": "#1a1c20", "roughness": 0.5 },
    "paint": { "preset": "glossy_plastic", "color": "#e8a317" }
  },
  "nodes": {
    "road": {
      "mesh": {
        "geometry": { "plane": { "size": [12, 60] } },
        "material": "road"
      },
      "transform": { "rotation": [-90, 0, 0] }
    },
    "truck": {
      "transform": { "position": [0, 0.6, 0] },
      "mesh": {
        "geometry": { "box": { "size": [1.8, 1.2, 4] } },
        "material": "paint"
      }
    }
  },
  "timeline": {
    "duration": 4,
    "loop": "loop",
    "tracks": {
      "drive": {
        "target": "truck",
        "property": "position",
        "keyframes": [
          { "t": 0, "value": [0, 0.6, 4], "easing": "linear" },
          { "t": 4, "value": [0, 0.6, -6] }
        ]
      }
    }
  }
}
Headlights and an amber beacon parented to a moving truck, with fog scattering the beams. apps/docs/examples/node-lights.json · render it with motion-sdk render apps/docs/examples/node-lights.json -t 1 -o node-lights.png

Give a point or spot light a parent and its position, and a spot's target, are in that node's space. Headlights, beacons and torches then travel with the node. Nodes face -z.

{ "spot": { "parent": "truck", "position": [0.9, 1.4, -4.4], "target": [1.8, 0, -26], "angle": 24, "intensity": 90 } }

To see the beams, add fog with scatter.

Shadows

lighting.shadows sets softness (PCF blur) and strength. {"softness": 2, "strength": 0.6} gives lighter, blurrier shadows.

Sun shadows use cascades on big scenes. cascades 1 fits one shadow map around everything, which is best for a single subject. 2 to 4 split the view into that many maps, so shadows stay crisp up close and still reach the far end of a street, city or landscape. The default 0 picks for you: cascades once the casters span more than about 50 units. distance caps how far from the camera they reach. The default 0 reaches the farthest caster.

scene.json
{ "lighting": { "rig": "golden_hour", "shadows": { "cascades": 3, "distance": 120, "softness": 1.5 } } }

API Reference

Lighting

Scene lighting: start from a rig and add or override named lights.

PropertyTypeDefaultDescription
lightsmap of Light{}Extra lights keyed by id (patch-friendly: /lighting/lights/<id>).
rigLightRig"studio_soft"Curated multi-light setup. Defaults to studio_soft; null for none (kept as null when serialized, so it doesn't revert to the default on a round trip).
rig_intensitynumber (0 to 10)1Multiplier applied to every rig light.
shadowsShadows{"softness":1,"strength":1}Shadow look for the shadow-casting light.

LightRig

Curated light setups tuned to look good with the material presets.

ValueDescription
"studio_soft"Soft key + fill + rim; flattering product look (default).
"three_point"Classic three-point lighting with crisp shadows.
"dramatic_noir"Hard single key, deep shadows.
"golden_hour"Warm low sun with cool sky fill.
"neon_rim"Magenta/cyan rim lights for neon looks.
"high_key"Bright, even, high-key lighting for slides and UI.
"moonlight"Cool moonlight with a single warm accent.

Light

A single light. Written as {"directional": {...}}, {"point": {...}}, ...

{"ambient": { … }}Uniform fill light.

PropertyTypeDefaultDescription
colorColor"#ffffff"Light colour.
intensitynumber1Brightness.

{"directional": { … }}Sun-like parallel light shining along direction.

PropertyTypeDefaultDescription
cast_shadowsbooleanfalseWhether this light casts shadows.
colorColor"#ffffff"Light colour.
direction[x, y, z][-0.4,-1,-0.6]Direction the light travels.
intensitynumber1Brightness.

{"point": { … }}Omni light at position.

PropertyTypeDefaultDescription
colorColor"#ffffff"Light colour.
intensitynumber1Brightness.
parentstring—Node the light rides on: position is then in that node's space and moves with it (headlights, beacons, a torch).
position*[x, y, z]requiredPosition in world space, or relative to node when it rides one.
rangenumber0Distance where the light fades out (0 = infinite).

{"spot": { … }}Cone light at position aimed at target.

PropertyTypeDefaultDescription
anglenumber30Cone half-angle in degrees.
cast_shadowsbooleanfalseWhether this light casts shadows.
colorColor"#ffffff"Light colour.
intensitynumber1Brightness.
parentstring—Node the light rides on: position and target are then in that node's space and move with it.
penumbranumber0.5Edge softness 0..1.
position*[x, y, z]requiredPosition in world space, or relative to node when it rides one.
target[x, y, z][0,0,0]Point the spot aims at.

Shadows

Shadow softness and darkness.

PropertyTypeDefaultDescription
cascadesinteger (0 to 4)—Sun shadow detail over distance. 1 fits one map around everything (best for one subject); 2 to 4 split the view into that many cascades, crisp up close and still reaching the far end (streets, cities, landscapes). 0 picks: cascades once the casters span more than about 50 units.
distancenumber—How far from the camera cascaded shadows reach, world units (0: to the farthest caster).
softnessnumber (0 to 8)1Blur radius multiplier (1 = default, 0 = hard, up to 8 = very soft; above 2.5 a denser, slower kernel is used).
strengthnumber (0 to 1)1How dark shadows get, 0..1 (1 = fully blocks the light).