Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

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