Three.js

back to table of contents

Lights

Three.js provides several classes to add light to your scene, based on the abstract classes Light or LightProbe

Light vs LightProbe

Light probes are an alternative way of adding light to 3D scenes. In contrast to Light, a LightProbe doesn't emit light directly and is usually generated by environment maps.

AmbientLight

AmbientLight globally illuminates all objects in the scene equally.

  • No direction, cannot be used to cast shadows
  • also available as LightProbe: AmbientLightProbe

DirectionalLight

Light that gets emitted in a specific direction. It will behave as it is infinitely far away. Light rays are all cast in parallel. This is like the sun.

This light can cast shadows, see DirectionalLightShadow for details.

HemisphereLight

HemisphereLight is a light source positioned directly above the scene.

  • light is fading from a skyColor to groundColor
  • no direction
  • cannot be used to cast shadows
  • also available as LightProbe class: HemisphereLightProbe

PointLight

PointLight emits light from a single point in all directions.

SpotLight

SpotLight emits from a single point alonng a cone.

RectAreaLight

RectAreaLight emits light across the face a rectangular plane.

  • can be used to simulate light sources such as bright windows
  • no shadow support
  • only MeshStandardMaterial and MeshPhysicalMaterial are supported
  • additional include needed: ReactAreaLightUniformsLib