Skip to content

feat: Add maxPixelRatio to Window.js to allow for limiting of used device pixel ratio#1281

Closed
Sechgulo wants to merge 1 commit intoHeapsIO:masterfrom
HacksawStudios:add-maxpixelratio
Closed

feat: Add maxPixelRatio to Window.js to allow for limiting of used device pixel ratio#1281
Sechgulo wants to merge 1 commit intoHeapsIO:masterfrom
HacksawStudios:add-maxpixelratio

Conversation

@Sechgulo
Copy link
Contributor

@Sechgulo Sechgulo commented Apr 11, 2025

This PR adds a new variable, maxPixelRatio, that acts as an upper limit for the device pixel ratio (devicePixelRatio) used when sizing the WebGL canvas.

On high-DPI devices (such as Retina displays on iOS or high-density Android screens), browsers report a devicePixelRatio that can often be 2–3 or higher. Using this high pixel ratio directly for the WebGL canvas significantly increases GPU memory usage. This is particularly problematic on iOS, which imposes strict memory limits per browser tab, which can lead to frequent tab reloads and instability.

@Sechgulo Sechgulo closed this Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant