EventDispatcherObject3DLight

SunLight

A sun-like light that gets emitted in a specific direction, with rays that are all parallel, and casts cascaded shadow maps via SunLightShadow, suited for lighting large scenes.

Unlike DirectionalLight, the light has no target: like HemisphereLight, its direction is defined by its position. The light shines from its position towards the origin and points straight down by default.

const sun = new SunLight( 0xfff2e3, 3 );
sun.position.set( 1, 1, 1 );
sun.castShadow = true;
scene.add( sun );

When used with WebGPURenderer, the light must be registered with the renderer's node library first:

renderer.library.addLight( SunLightNode, SunLight );

Import

SunLight is an addon, and must be imported explicitly, see Installation#Addons.

import { SunLight } from 'three/addons/lights/SunLight.js';

Constructor

new SunLight( color : number | Color | string, intensity : number )

Constructs a new sun light.

color

The light's color.

Default is 0xffffff.

intensity

The light's strength/intensity.

Default is 1.

Properties

.isSunLight : boolean (readonly)

This flag can be used for type testing.

Default is true.

.shadow : SunLightShadow

This property holds the light's shadow configuration.

Source

examples/jsm/lights/SunLight.js