mirror of
https://github.com/visgl/luma.gl.git
synced 2025-12-08 17:36:19 +00:00
1.1 KiB
1.1 KiB
PointLight
Create a point light source which emits from a point in all directions.Point lights attenuation is not available. At most 5 directional lights can be supported.
Usage
Create a point light source with color, intensity and position.
const pointLight= new PointLight({
color: [128, 128, 0],
intensity: 2.0,
position: [0, 0, 200]
});
Methods
constructor
The constructor for the PointLight class. Use this to create a new PointLight.
const pointLight = new PointLight({color, intensity, position});
Parameters
color- (array,) RGB color of point light source, default value is[255, 255, 255].intensity- (number) Strength of point light source, default value is1.0.position- (array,) Location of point light source, default value is[0, 0, 1].attenuation- (array,) Attenuation of point light source based on distance. In order of Constant, Linear, Exponential components. For details see this tutorial. Use[1, 0, 0]for no attenuation. Default value is[0, 0, 1].