lighting
Level lighting and light actors: skylight, shadows, GI, volumetric fog, and lighting builds.
What it's for
This namespace drives how a level is lit. It spawns and configures light actors, sets up a skylight, and controls the renderer-level knobs that decide the mood of a scene: shadows, ambient occlusion, global illumination, auto-exposure, and volumetric fog. When the bake matters, it also kicks off a full lighting build.
Reach for it when you want to light a level or adjust its look through your assistant instead of clicking through the editor. Typical asks: drop a directional light and a skylight into a fresh map, switch global illumination to Lumen, enable volumetric fog for atmosphere, or bake lighting at production quality before a capture. It can also tidy up a scene, for example collapsing duplicate sky lights down to a single one.
Keep the split in mind: use lighting for scene illumination and the lighting build
itself, and use environment.control for the legacy sun and skylight-intensity controls
grouped under environment. For a persistent global-illumination write into
DefaultEngine.ini, pair the live lighting.setup_global_illumination call
with rendering.set_dynamic_gi_method. Typed atmosphere, volumetric cloud, and
reflection-capture spawns that pair with light actors live in environment.
Examples
Light a fresh level with a sun and a sky
Spawn a directional light for the sun and a sky light for ambient fill.
You: Add a directional sun light and a sky light to this level.
call("lighting.spawn_light", {lightType:"directional", name:"Sun",
rotation:{pitch:-45, yaw:30, roll:0}, properties:{intensity:8}})
→ {ok:true, actor:"Sun"}
call("lighting.spawn_sky_light", {name:"SkyLight"})
→ {ok:true, actor:"SkyLight"}
Done. Level lit with a directional sun and a sky light.
Switch to Lumen GI and enable volumetric fog
Set the global illumination method, then turn on volumetric fog for atmosphere.
You: Use Lumen global illumination and add some volumetric fog.
call("lighting.setup_global_illumination", {method:"LumenGI"})
→ {ok:true, method:"LumenGI"}
call("lighting.setup_volumetric_fog", {viewDistance:6000})
→ {ok:true}
Done. Lumen GI enabled and volumetric fog switched on.
Bake lighting at production quality
Kick off a full lighting build for the current level before a capture.
You: Bake the lighting at production quality.
call("lighting.build_lighting", {quality:"production"})
→ {ok:true, quality:"production"}
Done. Lighting build finished at production quality.