Hello, I am currently developing a procedurally generated game. Houses and terrain are all procedurally generated. I am looking forward to add lights to the scene but if I add a large number of lights (30+) the frame drops or the scene stops to render entirely.
I have tried to use the
LOD class to enable or disable lights that are far from the viewer but whenever I start moving and a new light is enabled or disabled, I got a huge framedrop (maybe the shaders needs recompiling? I don’t really know)
const lod = new LOD(); lod.addLevel(new PointLight(), 0); lod.addLevel(new Object3D(), 50); this.add(lod)
Question: How can I handle a large number of lights? For example, I would like to have at least one or two
SpotLight for each house. What approach do you recomend?
Images for ilustration purposes: