THREE.JS / SOURCE CONTRACT 352
One block. Many lights.
A GLSL3 UniformsGroup packs position and color arrays into one std140 LightingData block. Every specimen reads the same array while the active light count and motion change on the CPU.
- backend
- —
- std140 block
- —
- active / max
- —
- sample avg / p95
- —
- draw calls
- —
- radius
- —
Initializing UBO arraysGLSL3 / WebGL2
Allocating position and color arrays in one shared block…
This route covers native WebGL2 array-valued UniformsGroup entries, a runtime light-count value, shared GLSL3 std140 reads, mutation, and teardown. It does not claim the official 300-light field, exact random layout, Stats/GUI presentation, driver buffer inspection, or whole-example fidelity.
The shader loops only to the active count; the maximum array size stays fixed so material rebuilds are independent of count changes.
Open official UBO arrays example ↗LAB 352 / UBO ARRAYS