Earlier, I asked about the performance impacts of point lights. At the time, it seemed that things would be OK, but since then I have discovered a number of issues that I don’t know how to solve.
The biggest issue is the impact of point lights and portals - it’s really slow.
Rendering portals entails doing a second render pass before the main render, to generate texture maps which contain the view as seen through the portal. When I first wrote the portal implementation, I discovered that portal rendering slows down the frame rate a lot, unless both scenes (the main scene and the portal view) have identical global parameters, such as the number of clipping planes or whether there is a global environment map. If, for example, the portal view has clipping planes but the main view does not, three.js will recompile the shaders every frame - because the number of clipping planes is a defined constant in the shader code.
I’m guessing that the number of point lights in the scene has a similar effect, although I’m not sure. All I know is that when point lights are enabled, then any time a portal comes into view, the framerate drops to about 1/3 of what it was before; but if I don’t put any point lights in the scene, then there’s only a slight drop in framerate when a portal comes into view.
Note that in my game world, the number of point lights isn’t fixed. Because my engine, like Minecraft, supports world of arbitrary size, pieces of the terrain (which I call “precincts”) are constantly being loaded, cached, and unloaded as the player moves around the world. Precincts can contain light sources, so the number of light sources will change based on the player’s position. However, precincts are fairly large (64 x 64 meters) so this doesn’t happen very often, and the delay only lasts a single frame, so the player doesn’t notice it. But with the two (or more) render passes needed for portals, it happens every frame.
Another issue that was raised earlier is the issue of shadows. As mentioned, enabling shadows for point lights doesn’t work very well if you have more than half a dozen point lights, because each point light generates 6 shadow maps. I figured I could get away with enabling shadows for the directional light only, since there’s only one of those. This looks mostly OK, even at night. The lack of shadows from the point lights is fairly subtle, especially given the limited radius of the point lights.
Night time view:
Where I run into trouble is the case of something like a candleholder or a torch attached to a wall. This looks fine when you look at the wall from the same side as the light source. But when you look at the back side of the wall, this is where it gets weird - you can see the light reflecting off of the ground and the pillars that make up the wall, which should be in shadow.
Note that because this world is partly procedurally generated, pre-baked lightmaps would be hard to do.