Loading…
Loading…
6 карточек
How do you configure resolution / DPR for mobile without tanking FPS or VRAM?
нажми, чтобы перевернуть
resolution = Math.min(devicePixelRatio, 2) and autoDensity = true. Letting DPR hit 3–4 on modern phones quadruples fillrate and can OOM the GPU on 4k+ atlases.autoDensity adjusts canvas CSS vs actual pixel size. resolution scales all buffers (including RenderTextures and filter intermediates). iPhone Pro Max reports DPR = 3; running the full pipeline at 3x on a 400×800 viewport = 1200×2400 framebuffer per pass, multiplied by every filter. Cap at 2 for games; go 1.5 or 1 for data-viz where crispness matters less than battery. Detect low-memory class and downscale further.
const dpr = Math.min(window.devicePixelRatio || 1, 2)
await app.init({
resolution: dpr,
autoDensity: true,
resizeTo: window,
antialias: dpr < 2, // at 2x, MSAA has diminishing returns
})
// Lower quality on thermally throttled / low-battery devices
const isLowEnd =
(navigator as any).deviceMemory <= 4 ||
(navigator as any).connection?.saveData === true
if (isLowEnd) {
app.renderer.resolution = 1
bloom.resolution = 0.5 // halve filter intermediates
}Когда да
All mobile targets. Editors on tablets. Any app with filters or RenderTextures.
Когда нет
Print-quality / export flows — bump resolution temporarily around the snapshot call, then restore.
Совет на собеседовании
Mobile Safari throttles after a minute of sustained 3x fillrate — FPS halves silently. Always cap DPR and include a 'reduce quality' toggle in-game settings.
Свайп вправо — знаю, влево — не знаю
