Skip to content
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

"Add a 3D model" example - Setting custom pixelRatio breaks model placement #13314

Open
axekan opened this issue Nov 3, 2024 · 0 comments
Open

Comments

@axekan
Copy link

axekan commented Nov 3, 2024

Possibly related to #1953.

I'm having some major performance issues on iOS devices when running mapbox + three.js like the official example. Safari is often crashing on loading the map, displaying "A problem repeatedly occurred.." due to excessive vram usage.

Newer iPhones have a devicePixelRatio of 3, and limiting it to 1 in WebGLRenderer immediately fixes the crash. However this messes up the scene, as can be seen in the jsfiddle below. This also occurs in the threebox library which exists as an alternative example to this one.

Inspelning.2024-11-03.170439.mp4

mapbox-gl-js version: 3.7.0

browser: Chrome 130

Steps to Trigger Behavior

  1. Add a three.js model following example in Mapbox docs
  2. set pixel ratio of the WebGLRenderer to something other than the default (like 0.75)
  3. See how model position becomes distorted and disconnected from the map.

Link to Demonstration

Rotate/pan camera to see issue with model:
https://jsfiddle.net/z3rgafcw/8/

Expected Behavior

It should handle a different pixelRatio and render at a lower resolution

Actual Behavior

Scene breaks, becomes distorted and disconnected from the map.

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

No branches or pull requests

1 participant