Create a point light, that is emitted from a point to all directions with an attenuation. A common use case for this type of light is to replicate the light emitted from a bare light bulb.

This light can cast PointShadow.

Example

// assuming 'renderer' is a valid Camera renderer

// this point light will not cast any shadows
const pointLight = new PointLight(renderer, {
color: new Vec3(1),
intensity: 1,
position: new Vec3(5, 2, 3),
})

// this point light will cast shadows
const pointLightWithShadows = new PointLight(renderer, {
color: new Vec3(1),
intensity: 10,
range: 3,
position: new Vec3(-10, 10, -5),
shadow: {
intensity: 1
},
})

// this point light will ALSO cast shadows!
const anotherPointLightWithShadows = new PointLight(renderer, {
color: new Vec3(1),
intensity: 5,
range: 100,
position: new Vec3(12, 0.5, 5),
shadow: {}, // that's enough to start casting shadows
})

// this point light will cast shadows as well...
const lastPointLightWithShadows = new PointLight(renderer, {
color: new Vec3(1),
intensity: 1,
position: new Vec3(10),
})

// ... because we're telling it here to start casting shadows
lastPointLightWithShadows.shadow.cast()

Hierarchy (view full)

Constructors

Properties

type: string
uuid: string

The universal unique id of this Light

index: number

Index of this Light, i.e. the number of time a Light of this type has been created.

renderer: CameraRenderer

CameraRenderer used by this Light

color: Vec3

Current color of this Light.

#intensityColor: Vec3

A Vec3 holding the Light color multiplied by its intensity.

rendererBinding: BufferBinding

CameraRenderer corresponding BufferBinding that holds all the bindings to send to the shaders.

Options used to create this PointLight.

shadow: PointShadow

PointShadow associated with this PointLight.

transforms: Object3DTransforms
children: Object3D[]

Children Object3D in the scene graph, used to compute their own world matrix

object3DIndex: number

Index (order of creation) of this Object3D. Used in the parent / children relation.

matricesNeedUpdate: boolean

Whether at least one of this Object3D matrix needs an update.

Accessors

Methods