I fixed the lighting by deleting the lanterns. It lasted 15 minutes.
Every lantern in Shadow of the Crimson Gate carries a real light, and real lights have a price in WebGL. The obvious fix made the world worse, so I undid it.
From building Shadow of the Crimson Gate
Lanterns line the paths in Shadow of the Crimson Gate, and each one used to be a prefab with a real point light inside it. It's what made the world glow at night:
const pointLight = new THREE.PointLight(0xffaa44, 1, 8);
pointLight.position.set(0, 2.5, 0);
prefab.add(pointLight);Why that gets expensive
That 8 is how far the light reaches, not how far its cost reaches. Three.js doesn't cull lights per object in its standard renderer, so lit materials are compiled to account for every point light in the scene, including the ones a kilometre away. Each light takes up uniforms, and a GPU only has so many. Add enough lanterns and you run into the limit.
The fix, at 01:01
So at one in the morning on 22 August, I took the direct route: two lanterns in the whole world, and none in the arena.
const numLanterns = 0; // Disabled to avoid max point light shader limits
const lanternCount = 2; // Reduced drastically to avoid shader light limitsThe undo, at 01:16
It solved the problem and removed the reason to walk those paths at night. Fifteen minutes later they were back, in a commit whose message simply says it's for environment density.
const numLanterns = 8;
const lanternCount = 20; // Increased for expanded worldThe real fix, in November
I chose the look and owed the fix for almost three months. It finally landed in the game's visual overhaul: a small pool of real lights, from two to six depending on the graphics setting, that moves to the lanterns nearest the player. The rest glow through their own materials and sprites, so the world stays lit and the shader only ever pays for a few lights.
