Skip to main content

Class: Lighting

Defined in: src/lighting/Lighting.ts:16

Lighting provides XR lighting capabilities within the XR Blocks framework. It uses webXR to propvide estimated lighting that matches the environment and supports casting shadows from the estimated light.

Constructors​

Constructor​

new Lighting(): Lighting

Defined in: src/lighting/Lighting.ts:41

Lighting is a lightweight manager based on three.js to simply prototyping with Lighting features within the XR Blocks framework.

Returns​

Lighting

Properties​

ambientLight​

ambientLight: Vector3

Defined in: src/lighting/Lighting.ts:25

Ambient RGB light.


ambientProbe​

ambientProbe: LightProbe

Defined in: src/lighting/Lighting.ts:23

Ambient spherical harmonics light.


dirLight​

dirLight: DirectionalLight

Defined in: src/lighting/Lighting.ts:21

Main Directional light.


simulatorRunning​

simulatorRunning: boolean = false

Defined in: src/lighting/Lighting.ts:35

Flag to indicate if simulator is running. Controlled by Core.


instance?​

static optional instance: Lighting

Defined in: src/lighting/Lighting.ts:17

Methods​

debugLog()​

debugLog(): void

Defined in: src/lighting/Lighting.ts:216

Logs current estimate light parameters for debugging.

Returns​

void


dispose()​

dispose(): void

Defined in: src/lighting/Lighting.ts:200

Releases lighting resources and resets the singleton instance.

Returns​

void


init()​

init(lightingOptions, renderer, scene, depth?): void

Defined in: src/lighting/Lighting.ts:56

Initializes the lighting module with the given options. Sets up lights and shadows and adds necessary components to the scene.

Parameters​

lightingOptions​

LightingOptions

Lighting options.

renderer​

SupportedRenderer

Main renderer.

scene​

Scene

Main scene.

depth?​

Depth

Depth manager.

Returns​

void


update()​

update(): void

Defined in: src/lighting/Lighting.ts:122

Updates the lighting and shadow setup used to render. Called every frame in the render loop.

Returns​

void