Light.type¶
Summary¶
Light.type identifies the concrete light category and is read-only. Values are "ambient", "directional", or "point". Use this for light-type branching in tooling and diagnostics.
Syntax¶
Parameters¶
This property does not take parameters.
Returns¶
"ambient" | "directional" | "point" - Type discriminator for the light instance.
Type Details¶
Example¶
const canvas = document.querySelector("canvas");
const wgpu = await WasmGPU.create(canvas);
const light = wgpu.createLight.ambient({ intensity: 0.2 });
if (light.type === "ambient") {
console.log("ambient baseline enabled");
}