Motion SDK

Sky and Environment

Backgrounds, a procedural sky with sun, clouds, haze and horizon glow, and reflections.

environment.background is what's behind the scene: a solid colour, a linear or radial gradient, transparent for web embeds, or a procedural sky.

A sunset sky with drifting clouds and an orange city glow on the horizon.
{
  "camera": { "position": [0, 1.5, 8], "target": [0, 2, -10], "fov": 60 },
  "lighting": { "rig": "golden_hour" },
  "environment": {
    "background": {
      "sky": {
        "sun": { "azimuth": -10, "elevation": 4 },
        "clouds": { "coverage": 0.5 },
        "glow": {
          "color": "#ff8a3d",
          "intensity": 1.4,
          "azimuth": 40,
          "width": 90,
          "height": 6
        }
      }
    }
  },
  "post": { "bloom": 0.6, "tone_mapping": "agx" },
  "materials": { "ground": { "color": "#3b2c3a", "roughness": 0.9 } },
  "nodes": {
    "ground": {
      "mesh": {
        "geometry": { "plane": { "size": [400, 400] } },
        "material": "ground"
      },
      "transform": { "rotation": [-90, 0, 0] }
    }
  },
  "timeline": { "duration": 4, "loop": "loop" }
}
A sunset sky with drifting clouds and an orange city glow on the horizon. apps/docs/examples/sky.json · render it with motion-sdk render apps/docs/examples/sky.json -t 1 -o sky.png

Sky

{"sky": {}} alone is a golden-hour sky. Then adjust:

  • zenith, horizon and ground: the gradient.
  • sun: azimuth (degrees clockwise from -z, the default view direction), elevation, size, intensity and glow. "sun": null turns it off.
  • clouds: coverage, layers, scale, speed, and the warm underlight and shade colours. Clouds drift with speed and are seeded by the scene seed. "clouds": null turns them off.
  • haze: horizon haze.
  • glow: a light hugging the horizon, like a distant city or fire. width is degrees round the horizon (360 all the way) and height how high it climbs. It's HDR, so bloom and mist carry it.

Reflections

environment.reflections picks the environment that shiny materials reflect: studio (default), sunset, city, night or none.

API Reference

Environment

Background, fog and image-based lighting.

PropertyTypeDefaultDescription
backgroundBackground{"solid":"#0b0f1a"}What's behind the scene: a colour, a gradient, a procedural sky or transparent.
fogFog—Distance fog, which can also scatter light into visible beams.
reflectionsEnvironmentMap"studio"Built-in environment map for reflections.

Background

Scene background. {"solid": "#000"}, {"linear_gradient": {...}}, ...

ValueDescription
"transparent"Fully transparent (for web embeds and overlays).

{"solid": Color}A flat colour.

{"linear_gradient": { … }}Vertical-ish gradient from from to to, rotated by angle degrees.

PropertyTypeDefaultDescription
anglenumber0Rotation of the gradient in degrees.
from*ColorrequiredColour at the start of the gradient.
to*ColorrequiredColour at the end of the gradient.

{"radial_gradient": { … }}Radial gradient from the center (inner) to the edges (outer).

PropertyTypeDefaultDescription
inner*ColorrequiredColour at the centre.
outer*ColorrequiredColour at the edges.

{"sky": Sky}Procedural sky dome seen through the camera: gradient, sun disc, sunset scattering, layered clouds and horizon haze.

Sky

Procedural sky. Every field has a sunset-friendly default, so {"sky": {}} is a valid golden-hour sky.

PropertyTypeDefaultDescription
cloudsClouds{"color":"#ffe6d2","coverage":0.45,"layers":2,"scale":1,"shade":"#7a5a8a","speed":0.02,"underlight":"#ff8a4c"}Layered procedural clouds. null for a clear sky.
glowHorizonGlow—A glowing band on the horizon: a city's light dome, a distant fire.
groundColor"#3b2c3a"Colour below the horizon.
hazenumber (0 to 1)0.4Horizon haze, 0..1: a bright band that also softens the clouds.
horizonColor"#ff9e6b"Colour at the horizon.
sunSun{"azimuth":0,"color":"#ffd28a","elevation":6,"glow":0.8,"intensity":6,"size":2.5}Sun disc and the warm scattering around it. null for no sun.
zenithColor"#3a3d8f"Colour straight up.

Sun

The sun on the sky dome.

PropertyTypeDefaultDescription
azimuthnumber0Degrees clockwise from straight ahead (-z, the default view direction): 90 is +x, 180 is behind the camera.
colorColor"#ffd28a"Colour of the disc and its glow.
elevationnumber (-90 to 90)6Degrees above the horizon (negative sets it below).
glownumber (0 to 2)0.8Strength of the warm glow scattered around the sun, 0..2.
intensitynumber (0 to 50)6HDR brightness of the disc (bloom picks it up above ~1).
sizenumber (0 to 20)2.5Disc diameter in degrees.

Clouds

Procedural cloud layers, seeded by the scene seed.

PropertyTypeDefaultDescription
colorColor"#ffe6d2"Lit cloud tops.
coveragenumber (0 to 1)0.45Fraction of the sky covered, 0..1.
layersinteger (1 to 3)2Number of layers, 1..3 (higher layers are thinner and wispier).
scalenumber (0.1 to 10)1Feature size: larger is smaller, busier clouds.
shadeColor"#7a5a8a"Cloud undersides away from the sun.
speednumber (0 to 2)0.02Drift speed (sky units per second).
underlightColor"#ff8a4c"Warm light on the undersides near a low sun.

HorizonGlow

Emissive light hugging the horizon, brightest at azimuth.

PropertyTypeDefaultDescription
azimuthnumber0Degrees clockwise from -z where the glow is centred (like the sun's).
colorColor"#ff9a4a"Colour of the glow.
heightnumber (0.5 to 60)8How high it climbs, in degrees.
intensitynumber (0 to 50)1.5Brightness; above about 1 it blooms.
widthnumber (1 to 360)120How far round the horizon it spreads, in degrees (360: all the way).

EnvironmentMap

Built-in environment maps (no external assets, fully deterministic).

ValueDescription
"none"
"studio"
"sunset"
"city"
"night"