Skip to main content
Reads <light> elements from the loaded MuJoCo model and creates corresponding Three.js lights.

Usage

With Intensity Multiplier

Props

number
default:"1.0"
Multiplier applied to all light intensities.

Light Mapping

The component reads from the MuJoCo model:
  • model.nlight — number of lights
  • light_pos — position
  • light_dir — direction
  • light_diffuse — color
  • light_castshadow — shadow casting
  • light_attenuation — attenuation coefficients
  • light_cutoff — spotlight cone angle

Hook Alternative

For imperative usage inside your own components, use useSceneLights:

Alternative

You can also enable MJCF lights via the mjcfLights prop on MujocoCanvas:
Or skip both and define your own Three.js lights:

Notes

  • Lights are created once when the model loads and cleaned up on unmount
  • If your MJCF has no <light> elements, this component does nothing
  • The component delegates to useSceneLights internally