Skip to content

WasmGPU.createLight

Summary

WasmGPU.createLight is the light factory facade. It creates ambient, directional, point, and spot lights for scene lighting; returned lights are plain scene resources and are not added to a scene automatically.

Syntax

const sun = wgpu.createLight.directional({ direction: [-1, -2, -1] });
scene.addLight(sun);

Available APIs

See Also