Not that clever, actually
These days I used a uniform with an array of positions of lights. Which is the bottleneck.
Nowadays I would use a texture for that purpose. Processing it the way, like in this demo: Newton's Cradle + glowing spheres
1 Like