Skip to content

UWAL / Light

Classes

abstract Light

Base class for ambient, directional, point, and spot lights.

Extended by

Properties

Label
ts
Label: string;

Light name.

Constructors

Constructor
ts
new Light(color?, label?): Light;
Parameters
ParameterTypeDefault valueDescription
color?ColorParamundefinedLight color. Defaults to white.
label?string"Light"Light label.
Returns

Light

Methods

Destroy()
ts
Destroy(): void;

Destroy the internal uniform buffer.

Returns

void

SetRenderPipeline()
ts
protected SetRenderPipeline(Pipeline, uniformName): GPUBuffer;

Create and update an internal uniform buffer of this light's color and intensity values.

Parameters
ParameterTypeDescription
PipelineRenderPipelineInstancePipeline using this light.
uniformNamestringUniform buffer name.
Returns

GPUBuffer

Accessors

Color
Get Signature
ts
get Color(): Float32Array<ArrayBufferLike>;
Returns

Float32Array<ArrayBufferLike>

The color of the light.

Set Signature
ts
set Color(color): void;
Parameters
ParameterTypeDescription
colorColorParamLight color.
Returns

void

Intensity
Get Signature
ts
get Intensity(): number;
Returns

number

The intensity of the light.

Set Signature
ts
set Intensity(intensity): void;
Parameters
ParameterTypeDescription
intensitynumberLight intensity.
Returns

void

Released under the MIT License.