Scene.removeLight¶
Summary¶
Scene.removeLight removes a light from the scene if present. Removing a non-member is a no-op, making this safe for idempotent cleanup. The method returns the same scene instance.
Syntax¶
Parameters¶
| Name | Type | Required | Description |
|---|---|---|---|
light |
Light |
Yes | Light instance to remove from the scene lighting list. |
Returns¶
Scene - The same scene instance after removal attempt.
Type Details¶
Example¶
const canvas = document.querySelector("canvas");
const wgpu = await WasmGPU.create(canvas);
const scene = wgpu.createScene();
const light = wgpu.createLight.point({ position: [0, 2, 0], range: 12 });
scene.addLight(light);
scene.removeLight(light);