Skip to main content

PointLightElement

Represents a point light source emitting light uniformly in all directions from a single point. Supports color, intensity, range, and shadow casting with adjustable parameters.

Creating a new Point Light:

const pointLight = new PointLightElement();
pointLight.color = '#ffffff';
pointLight.intensity = 1.5;
pointLight.range = 30;
scene.add(pointLight);

color: THREE.Color | string

The color of the point light. Can be specified as a THREE.Color instance or a CSS color string (e.g., "#ffddaa").

Example:

pointLight.color = '#ffddaa';

intensity: number

The brightness or intensity of the light. Numeric value where 1 is the default intensity.

Example:

pointLight.intensity = 2;

range: number

The maximum distance from the light source at which light intensity is effective. Beyond this range, the light has no effect.

Example:

pointLight.range = 50;

shadowMapResolution: number

Resolution of the shadow map texture used for rendering shadows cast by this light. Higher resolutions improve shadow quality but increase performance cost.

Example:

pointLight.shadowMapResolution = 1024;

shadowBias: number

Bias applied to shadow depth calculations to reduce shadow acne artifacts. Small floating-point number fine-tuning shadow precision.

Example:

pointLight.shadowBias = 0.005;

shadowRadius: number

Controls the softness of shadow edges by blurring. Larger values produce softer, more diffused shadows.

Example:

pointLight.shadowRadius = 2;