mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-10 04:24:36 +00:00
dpr
This commit is contained in:
@@ -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,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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user