[page:Object3D] → [page:Light] →
[name]
Affects objects using [page:MeshLambertMaterial] or [page:MeshPhongMaterial].
Example
// White directional light at half intensity shining from the top.
var directionalLight = new THREE.DirectionalLight( 0xffffff, 0.5 );
directionalLight.position.set( 0, 1, 0 );
scene.add( directionalLight );
Constructor
[name]( [page:Float hex], [page:Float intensity], [page:Float distance] )
Properties
.[page:Vector3 position]
Direction of the light is normalized vector from *position* to *(0,0,0)*.
Default — *new THREE.Vector3()*.
.[page:Object3D target]
Target used for shadow camera orientation.
.[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: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]
Orthographic shadow camera frustum parameter.
Default — *50*.
.[page:Float shadowCameraFar]
Orthographic shadow camera frustum parameter.
Default — *5000*.
.[page:Float shadowCameraLeft]
Orthographic shadow camera frustum parameter.
Default — *-500*.
.[page:Float shadowCameraRight]
Orthographic shadow camera frustum parameter.
Default — *500*.
.[page:Float shadowCameraTop]
Orthographic shadow camera frustum parameter.
Default — *500*.
.[page:Float shadowCameraBottom]
Orthographic shadow camera frustum parameter.
Default — *-500*.
.[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:Boolean shadowCascade]
???
Default — *false*.
.[page:Vector3 shadowCascadeOffset]
???
Default — *Three.Vector3( 0, 0, -1000 )*.
.[page:Integer shadowCascadeCount]
???
Default — *2*.
.[page:Array shadowCascadeBias]
???
Default — [ 0, 0, 0 ].
.[page:Array shadowCascadeWidth]
???
Default — [ 512, 512, 512 ].
.[page:Array shadowCascadeHeight]
???
Default — [ 512, 512, 512 ].
.[page:Array shadowCascadeNearZ]
???
Default — [ -1.000, 0.990, 0.998 ].
.[page:Array shadowCascadeFarZ]
???
Default — [ 0.990, 0.998, 1.000 ].
.[page:Array shadowCascadeArray]
???
Default — [ ].
.[page:RenderTarget shadowMap]
???
Default — *null*.
.[page:Integer shadowMapSize]
???
Default — *null*.
.[page:Camera shadowCamera]
???
Default — *null*.
.[page:Matrix shadowMatrix]
???
Default — *null*.
Source
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]