Inheritance: Lighting →
A custom lighting implementation based on Forward+ Clustered Shading that overwrites the default lighting system in WebGPURenderer. Suitable for 3D scenes with many point lights and real depth complexity — the view frustum is partitioned into a 3D cluster grid so only the lights actually reaching each fragment are evaluated.
const lighting = new ClusteredLighting();
renderer.lighting = lighting; // set lighting system
ClusteredLighting is an addon, and must be imported explicitly, see Installation#Addons.
import { ClusteredLighting } from 'three/addons/lighting/ClusteredLighting.js';
Constructs a new clustered lighting system.
maxLights
Maximum number of point lights.
Default is 1024.
tileSize
Screen tile size in pixels (cluster XY size).
Default is 32.
zSlices
Number of exponential depth slices.
Default is 24.
maxLightsPerCluster
Per-cluster light-list capacity.
Default is 64.
Creates a new clustered lights node for the given array of lights.
This method is called internally by the renderer and must be overwritten by all custom lighting implementations.
lights
The lights.
Overrides: Lighting#createNode
Returns: The clustered lights node.