A DirectionalLight is an Urbject that implements the Light interface and shines in a specified direction in 3D space, taking into account Trigon normal vector orientation when calculating intensity.
A DirectionalLight is similar to the way sunlight works on Earth and shines with the same intensity and direction across the entire Scene. However, since there is no light reflection in Urchin, a DirectionalLight will not light any Trigons that face greater than 90 degrees away from the light. To compensate this, consider adding multiple DirectionalLights that face in different directions, or one AmbientLight to the scene to obtain more "natural" lighting.
See also: Urbject, AmbientLight, Light
Constructors
Variables
Public Variables
| brightness: number |
The brightness of the light. Any value over 1 is considered "overexposed". |
| color: Color |
The color of the light. See also: Color
|
Functions
Static Functions
| DirectionalLight.copy(l: DirectionalLight, options?: { shallow: boolean } ): DirectionalLight |
Returns a copy of the DirectionalLight or a new DirectionalLight from an Object with all of the necessary DirectionalLight and Urbject public attributes. If shallow is true, the children of the Urbject will not be included in the copy. |
| DirectionalLight.getInstance(l: DirectionalLight, camera: Camera): FrameInstance |
Returns the FrameInstance of the given DirectionalLight with its light added. See also: Urbject, FrameInstance
|
| DirectionalLight.intensityOn(l: DirectionalLight, t: Trigon): number |
Returns the intensity of the light on the given Trigon, taking into account the normal orientation of the Trigon. Any Trigons with a normal vector that faces more than 90 degrees away from the light will not be lit. See also: Trigon
|
Home
Copyright © 2020 Trevor Richard