Constructor
A directional light
Part of scene graph
Inherits from Light() Object3D()
Affects MeshLambertMaterial() and MeshPhongMaterial()
Arguments: |
|
---|
Attributes
Light intensity
default 1.0
Direction of the light is normalized vector from position to (0,0,0).
Modulating directional light by distance not implemented in WebGLRenderer()
Shadow attributes
If set to true light will cast dynamic shadows
Warning: this is expensive and requires tweaking to get shadows looking right.
default false
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
Object3D() target used for shadow camera orientation
Orthographic shadow camera frustum parameter
default 50
Orthographic shadow camera frustum parameter
default 5000
Orthographic shadow camera frustum parameter
default -500
Orthographic shadow camera frustum parameter
default 500
Orthographic shadow camera frustum parameter
default 500
Orthographic shadow camera frustum parameter
default -500
Show debug shadow camera frustum
default false
Shadow map bias
default 0
Darkness of shadow casted by this light (float from 0 to 1)
default 0.5
Shadow map texture width in pixels
default 512
Shadow map texture height in pixels
default 512
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 );