Skip to main content

Class: Lighting

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

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:40

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:24

Ambient RGB light.


ambientProbe

ambientProbe: LightProbe

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

Ambient spherical harmonics light.


dirLight

dirLight: DirectionalLight

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

Main Directional light.


simulatorRunning

simulatorRunning: boolean = false

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

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


instance?

static optional instance: Lighting

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

Methods

debugLog()

debugLog(): void

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

Logs current estimate light parameters for debugging.

Returns

void


init()

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

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

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

WebGLRenderer

Main renderer.

scene

Scene

Main scene.

depth?

Depth

Depth manager.

Returns

void


update()

update(): void

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

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

Returns

void