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

[name]

Affects objects using [page:MeshLambertMaterial] or [page:MeshPhongMaterial].

Example

[example:canvas_morphtargets_horse morphtargets / horse ]
[example:misc_controls_fly controls / fly ]
[example:misc_lights_test lights / test ]
[example:vr_cubes cubes ]
[example:webgl_effects_parallaxbarrier effects / parallaxbarrier ]
[example:webgl_effects_stereo effects / stereo ]
[example:webgl_geometry_extrude_splines geometry / extrude / splines ]
[example:webgl_materials_bumpmap materials / bumpmap ]
[example:webgl_materials_cubemap_balls_reflection materials / cubemap / balls / reflection ]
// 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:Integer hex], [page:Float intensity] )

[page:Integer hex] -- Numeric value of the RGB component of the color.
[page:Float intensity] -- Numeric value of the light's strength/intensity.
Creates a light that shines from a specific direction not from a specific position. This light will behave as though it is infinitely far away and the rays produced from it are all parallel. The best analogy would be a light source that acts like the sun: the sun is so far away that all sunlight hitting objects comes from the same angle.

Properties

See the base [page:Light Light] class for common properties.

[property:Object3D target]

Target used for shadow camera orientation.

[property:DirectionalLightShadow shadow]

This property stores all relevant information for rendering the shadow of the light.

[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*.

Methods

See the base [page:Light Light] class for common methods.

[method:DirectionalLight copy]( [page:DirectionalLight source] )


Copies value of *source* to this DirectionalLight object.

Source

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