RectAreaLight
RectAreaLight emits light uniformly across the face a rectangular plane. This light type can be used to simulate light sources such as bright windows or strip lighting.
Important Notes:
- There is no shadow support.
- Only MeshStandardMaterial and MeshPhysicalMaterial are supported.
- You have to include RectAreaLightUniformsLib into your scene and call
init().
Code Example
const width = 10;const height = 10;const intensity = 1;const rectLight = new
THREE.RectAreaLight( 0xffffff, intensity, width, height
);rectLight.position.set( 5, 5, 0 );rectLight.lookAt( 0, 0, 0 );scene.add(
rectLight )const rectLightHelper = new RectAreaLightHelper( rectLight
);rectLight.add( rectLightHelper );
Examples
[example:webgl_lights_rectarealight WebGL / rectarealight ]
Constructor
RectAreaLight
function RectAreaLight( color: Integer, intensity: Float, width: Float,
height: Float ): void;
color - (optional) hexadecimal color of the light. Default is 0xffffff
(white).
intensity - (optional) the light's intensity, or brightness. Default is
1.
width - (optional) width of the light. Default is 10.
height - (optional) height of the light. Default is 10.
Creates a new RectAreaLight.
Properties
See the base Light class for common properties.
height
height: Float;
The height of the light.
intensity
intensity: Float;
The light's intensity. Default is 1.
When legacy lighting mode is disabled, intensity is the luminance
(brightness) of the light measured in nits (cd/m^2).
Changing the intensity will also change the light's power.
isRectAreaLight
isRectAreaLight: Boolean;
Read-only flag to check if a given object is of type RectAreaLight.
power
power: Float;
The light's power.
When legacy lighting mode is disabled, power is the luminous power of the
light measured in lumens (lm).
Changing the power will also change the light's intensity.
width
width: Float;
The width of the light.
Methods
See the base Light class for common methods.
copy
function copy( source: RectAreaLight ): this;
Copies value of all the properties from the source to this RectAreaLight.
src/lights/RectAreaLight.js