Class LightingVolume
Constructors
constructor
-
new LightingVolume(
name: string,
scene: Scene,
shadowGenerator?: any,
tesselation?: number,
): LightingVolumeCreates a new LightingVolume.
Parameters
- name: string
The name of the lighting volume.
- scene: Scene
The scene the lighting volume belongs to.
OptionalshadowGenerator: anyThe shadow generator used to create the lighting volume. This is optional in the constructor, but must be set before calling updateMesh.
- tesselation: number = 64
The tesselation level of the lighting volume (default: 64).
Returns LightingVolume
- name: string
Accessors
first Update
-
get firstUpdate(): boolean
Indicates whether this is the first update of the lighting volume. If true, the volume has not yet been updated for the first time.
Returns boolean
frequency
-
get frequency(): number
The frequency (in number of times you call updateMesh) at which the lighting volume is updated.
Returns number
-
set frequency(value: number): void
Parameters
- value: number
Returns void
mesh
-
get mesh(): Mesh
The mesh used as a support for the lighting volume. Note that this mesh is not automatically added to the scene's mesh array. If you want to render it, you need to add it manually.
Returns Mesh
name
-
get name(): string
The name of the lighting volume.
Returns string
-
set name(name: string): void
Parameters
- name: string
Returns void
shadow Generator
-
get shadowGenerator(): ShadowGenerator
The shadow generator used to create the lighting volume.
Returns ShadowGenerator
-
set shadowGenerator(sg: ShadowGenerator): void
Parameters
- sg: ShadowGenerator
Returns void
tesselation
-
get tesselation(): number
The tesselation level of the lighting volume.
Returns number
-
set tesselation(n: number): void
Parameters
- n: number
Returns void
Methods
dispose
-
Disposes the lighting volume and associated resources.
Returns void
is Ready
-
Checks if the lighting volume is ready to be updated.
Returns any
True if the volume is ready to be updated.
update
-
Updates the lighting volume mesh.
Parameters
- forceUpdate: boolean = false
If true, forces the update even if the frequency condition is not met.
Returns void
- forceUpdate: boolean = false
Class used to create a lighting volume from a directional light's shadow generator.