[page:Object3D] → [page:Light] →

[name]

A point light that can cast shadow in one direction.
Affects objects using [page:MeshLambertMaterial] or [page:MeshPhongMaterial].

Example

// white spotlight shining from the side, casting shadow var spotLight = new THREE.SpotLight( 0xffffff ); spotLight.position.set( 100, 1000, 100 ); spotLight.castShadow = true; spotLight.shadowMapWidth = 1024; spotLight.shadowMapHeight = 1024; spotLight.shadowCameraNear = 500; spotLight.shadowCameraFar = 4000; spotLight.shadowCameraFov = 30; scene.add( spotLight );

Constructor

[name]([page:todo hex], [page:todo intensity], [page:todo distance], [page:todo angle], [page:todo exponent])

hex -- todo
intensity -- todo
distance -- todo
angle -- todo
exponent -- todo
todo

Properties

.[page:Object3D target]

Spotlight focus points at target.position.
Default position — *(0,0,0)*.

.[page:Float intensity]

Light's intensity.
Default — *1.0*.

.[page:Float distance]

If non-zero, light will attenuate linearly from maximum intensity at light *position* down to zero at *distance*.
Default — *0.0*.

.[page:Float angle]

Maximum extent of the spotlight, in radians, from its direction. Should be no more than *Math.PI/2*.
Default — *Math.PI/3*.

.[page:Float exponent]

Rapidity of the falloff of light from its target direction.
Default — *10.0*.

.[page:Boolean castShadow]

If set to *true* light will cast dynamic shadows. *Warning*: This is expensive and requires tweaking to get shadows looking right.
Default — *false*.

.[page:Boolean onlyShadow]

If set to *true* light will only cast shadow but not contribute any lighting (as if *intensity* was 0 but cheaper to compute).
Default — *false*.

.[page:Float shadowCameraNear]

Perspective shadow camera frustum near parameter.
Default — *50*.

.[page:Float shadowCameraFar]

Perspective shadow camera frustum far parameter.
Default — *5000*.

.[page:Float shadowCameraFov]

Perspective shadow camera frustum field of view parameter.
Default — *50*.

.[page:Boolean shadowCameraVisible]

Show debug shadow camera frustum.
Default — *false*.

.[page:Float shadowBias]

Shadow map bias.
Default — *0*.

.[page:Float shadowDarkness]

Darkness of shadow casted by this light (from *0* to *1*).
Default — *0.5*.

.[page:Integer shadowMapWidth]

Shadow map texture width in pixels.
Default — *512*.

.[page:Integer shadowMapHeight]

Shadow map texture height in pixels.
Default — *512*.

.[page:Float shadowBias]

Shadow map bias.
Default — *0*.

.[page:Float shadowDarkness]

Darkness of shadow casted by this light (from *0* to *1*).
Default — *0.5*.

.[page:Integer shadowMapWidth]

Shadow map texture width in pixels.
Default — *512*.

.[page:Integer shadowMapHeight]

Shadow map texture height in pixels.
Default — *512*.

.[page:object shadowMatrix]

todo

.[page:object shadowMapSize]

todo

.[page:object shadowCamera]

todo

.[page:object shadowMap]

todo

Methods

Source

[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]