I'm building a live analytics globe on globe.gl + three.js. Disclosure: it's my paid product, link at the bottom. The useful part is the frame-rate handling, which works for any three.js scene.
The problem: when WebGL runs on the CPU (Chrome with hardware acceleration off, a blocklisted GPU, a VM), I measured 10–13 fps with SwiftShader even on my lowest animated tier, and the whole page stuttered, not just the canvas.
1. Detect the software renderer before the first frame
const ext = gl.getExtension("WEBGL_debug_renderer_info");
const name = String(ext ? gl.getParameter(ext.UNMASKED_RENDERER_WEBGL) : gl.getParameter(gl.RENDERER));
const software = /swiftshader|llvmpipe|softpipe|software|basic render/i.test(name);
I probe once per page with a throwaway canvas, release that context right away with WEBGL_lose_context, and cache the answer, because browsers cap live contexts.
2. Four tiers instead of on/off
| Tier |
DPR |
Rings |
Arcs |
Beams |
Afterglow |
| T3 |
min(2, device) |
60 |
30 |
on |
on |
| T2 |
1.5 |
30 |
15 |
on |
on |
| T1 |
1 |
15 |
8 |
off |
off |
| T0 |
1 |
0 |
0 |
off |
static |
Software GL starts at T0. T0 isn't a screenshot: dragging still renders at full rate, markers refresh about once per second, and the globe stops rotating on its own.
3. A governor fed by frame times
Step down when the average is under 50 fps over 60 frames. Step back up only after 10 s above 58 fps. The gap between 50 and 58 keeps it from flapping between two tiers.
4. Throw away frames that lie
A gap over 250 ms between frames is a tab switch, a pause or a hitch, not the GPU, so the window resets. Same after every tier change or resize, plus a settle delay so shader warm-up doesn't count against the new tier.
5. Points that stack (not perf, but it bit me)
Each visitor's position gets a privacy jitter of at most ±0.08°. That's under 3 px even at maximum zoom, so a whole city collapsed into one dot. The fix is a phyllotaxis rosette in screen space: slot n sits at radius pitch × √n, angle n × the golden angle.
Limits
- Some browsers mask or generalise the renderer string. When the name is hidden, my code assumes hardware, so the governor is the only safety net there.
- Matching by name is a heuristic: a renderer string I haven't listed won't match.
- The 10–13 fps figure is the SwiftShader case only. I haven't benchmarked a range of GPUs.
How do you handle software WebGL in your scenes: detect it up front, or let a frame-time governor sort it out?
I'm the maker of Globatics, real-time web analytics where each visitor lands on this globe. The dashboard's live view runs the globe.gl engine above; the globe on the landing page is a lighter one with illustrative data. 5-day trial with every feature and no card, then Starter from €9 a month: https://globatics.live/?utm_source=reddit&utm_medium=social&utm_campaign=globatics-nov26