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

# [name]

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

## Example

[example:webgl_interactive_cubes_gpu interactive / cubes / gpu ]
[example:webgl_interactive_draggablecubes interactive / draggablecubes ]
[example:webgl_materials_bumpmap_skin materials / bumpmap / skin ]
[example:webgl_materials_cubemap_dynamic materials / cubemap / dynamic ]
[example:webgl_morphtargets_md2 morphtargets / md2 ]
[example:webgl_shading_physical shading / physical ]
`// 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 );`
[example:webgl_materials_bumpmap materials / bumpmap]
[example:webgl_shading_physical shading / physical]
[example:webgl_shadowmap shadowmap]
[example:webgl_shadowmap_viewer shadowmap / performance]
[example:webgl_shadowmap_viewer shadowmap / viewer]

## Constructor

### [name]([page:Integer hex], [page:Float intensity], [page:Float distance], [page:Radians angle], [page:Float exponent], [page:Float decay])

[page:Integer hex] — Numeric value of the RGB component of the color.
[page:Float intensity] — Numeric value of the light's strength/intensity.
[page:Float distance] -- Maximum distance from origin where light will shine whose intensity is attenuated linearly based on distance from origin.
[page:Radians angle] -- Maximum angle of light dispersion from its direction whose upper bound is Math.PI/2.
[page:Float exponent] -- Rapidity of the falloff of light from its target direction.
[page:Float decay] -- The amount the light dims along the distance of the light.

## Properties

### [property:Object3D target]

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

### [property:Float intensity]

Light's intensity.
Default — *1.0*.

### [property:Float distance]

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

### [property:Float angle]

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

### [property:Float exponent]

Rapidity of the falloff of light from its target direction. A lower value spreads out the light, while a higher focuses it towards the center.
Default — *10.0*.

### [property:Float decay]

The amount the light dims along the distance of the light
Default — *1*.

### [property: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*.

### [property: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*.

### [property:Float shadowCameraNear]

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

### [property:Float shadowCameraFar]

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

### [property:Float shadowCameraFov]

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

### [property:Boolean shadowCameraVisible]

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

### [property:Float shadowBias]

Shadow map bias, how much to add or subtract from the normalized depth when deciding whether a surface is in shadow.
Default — *0*.

### [property:Integer shadowMapWidth]

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

### [property:Integer shadowMapHeight]

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

### [property:Vector2 shadowMapSize]

The shadowMapWidth and shadowMapHeight stored in a [page:Vector2 THREE.Vector2]. Set internally during rendering.

### [property:PerspectiveCamera shadowCamera]

The shadow's view of the world. Computed internally during rendering from the shadowCamera* settings.

### [property:Matrix4 shadowMatrix]

Model to shadow camera space, to compute location and depth in shadow map. Computed internally during rendering.

### [property:WebGLRenderTarget shadowMap]

The depth map generated using the shadowCamera; a location beyond a pixel's depth is in shadow. Computed internally during rendering.

## Methods

### [method:SpotLight clone]()

It returns a clone of SpotLight.

### [method:JSON toJSON]()

Return SpotLight data in JSON format.

## Source

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