This commit is contained in:
evanpelle
2026-06-02 20:17:04 -07:00
parent 67312ad599
commit 63c427af3c
2 changed files with 5 additions and 2 deletions
-1
View File
@@ -210,7 +210,6 @@ export class GPURenderer {
alpha: false,
antialias: false,
powerPreference: "high-performance",
desynchronized: true,
});
if (!gl) throw new Error("WebGL2 not supported");
this.gl = gl;
+5 -1
View File
@@ -5,6 +5,10 @@
// or camera ↔ screen coordinate math will desync.
const MAX_RENDER_DPR = 1.5;
// BISECT: sub-native render scale to test whether fill rate is the bottleneck
// on low-end Chromebooks. 0.5 = 1/4 the pixels. Visibly softer.
const RENDER_SCALE = 0.5;
export function getEffectiveDpr(): number {
return Math.min(window.devicePixelRatio || 1, MAX_RENDER_DPR);
return Math.min(window.devicePixelRatio || 1, MAX_RENDER_DPR) * RENDER_SCALE;
}