Lighting

May 20, 2026 · View on GitHub

RoboLab uses IsaacLab's light spawners to configure scene lighting. Lighting configs are @configclass objects that add light sources to the simulation and are passed as lighting_cfg during environment registration. These configs can live in your own repository.

Built-in Lighting Configurations

RoboLab ships several lighting presets in robolab/variations/lighting.py:

Sphere Lights

ConfigIntensityColorPositionNotes
SphereLightCfg5,000White(0.0, -0.6, 0.7)Default for most registrations
ExtremelyDimSphereLightCfg50White(0.0, -0.6, 0.7)For testing low-light conditions
RedSphereLightCfg100,000Red(0.0, 0.0, 1.0)Colored light variation
GreenSphereLightCfg100,000Green(0.0, 0.0, 1.0)Colored light variation
BlueSphereLightCfg100,000Blue(0.0, 0.0, 1.0)Colored light variation

Directional Lights

ConfigDirectionIntensityNotes
FrontDirectionalLightCfgFront3,000Facing the robot from the front
BehindDirectionalLightCfgBehind3,000Facing the robot from behind
TopDownDirectionalLightCfgTop-down3,000Overhead lighting
LeftDirectionalLightCfgLeft3,000Side lighting from the left
RightDirectionalLightCfgRight3,000Side lighting from the right

Using a Lighting Config

Import the config and pass it as lighting_cfg in your registration function (see Environment Registration for the full example):

from robolab.variations.lighting import SphereLightCfg

# Inside your register_envs() function:
auto_discover_and_create_cfgs(
    lighting_cfg=SphereLightCfg,
    # ... other registration kwargs
)

Defining Custom Lighting

A lighting config is a @configclass with one or more AssetBaseCfg fields, each spawning a light. It can live in your own repository.

Sphere Light

import isaaclab.sim as sim_utils
from isaaclab.assets import AssetBaseCfg
from isaaclab.utils import configclass


@configclass
class MySphereLightCfg:
    my_light = AssetBaseCfg(
        prim_path="/World/my_sphere_light",
        spawn=sim_utils.SphereLightCfg(
            intensity=8000,
            color=(1.0, 0.95, 0.9),   # Warm white
            radius=0.1,
        ),
        init_state=AssetBaseCfg.InitialStateCfg(pos=(0.0, -0.5, 1.0)),
    )

Directional (Distant) Light

@configclass
class MyDirectionalLightCfg:
    directional_light = AssetBaseCfg(
        prim_path="/World/directional_light",
        spawn=sim_utils.DistantLightCfg(
            intensity=3000,
            angle=0.53,
            exposure=3.0,
        ),
        init_state=AssetBaseCfg.InitialStateCfg(
            pos=(0.0, 0.0, 5.0),
            rot=(0.7071, 0.0, 0.7071, 0.0),  # Front-facing
        ),
    )

Multiple Lights

You can define multiple light fields in one config:

@configclass
class MyStudioLightingCfg:
    key_light = AssetBaseCfg(
        prim_path="/World/key_light",
        spawn=sim_utils.SphereLightCfg(intensity=10000),
        init_state=AssetBaseCfg.InitialStateCfg(pos=(0.5, -0.8, 1.2)),
    )
    fill_light = AssetBaseCfg(
        prim_path="/World/fill_light",
        spawn=sim_utils.SphereLightCfg(intensity=3000),
        init_state=AssetBaseCfg.InitialStateCfg(pos=(-0.5, -0.3, 0.8)),
    )

Available Light Types

IsaacLab provides the following light spawners through isaaclab.sim:

SpawnerDescription
sim_utils.SphereLightCfgPoint light from a sphere; parameters: intensity, color, radius
sim_utils.DistantLightCfgDirectional light (sun-like); parameters: intensity, angle, exposure
sim_utils.DomeLightCfgEnvironment map light (HDR/EXR); used for Backgrounds
sim_utils.DiskLightCfgArea light from a disk
sim_utils.CylinderLightCfgArea light from a cylinder
sim_utils.RectLightCfgArea light from a rectangle

Lighting Variation for Robustness Testing

To evaluate policy robustness under different lighting conditions, register multiple environment variants with different lighting_cfg values. See robolab/registrations/droid/auto_env_registrations_lighting_variations.py for a complete example.

The built-in evaluation script policies/pi0_family/run_lighting.py runs benchmarks across lighting conditions automatically.

See Also