mapbox-unity-sdk icon indicating copy to clipboard operation
mapbox-unity-sdk copied to clipboard

CameraBounds TileProvider vs. viewing angle: overflow issue

Open Markovicho opened this issue 3 years ago • 3 comments

  • Mapbox SDK version: 2.1.1

Feature: Camerabound Extent / TileProvider

image

Best Case (Camera 1): Camera Bound TileProvider is working nicely if you are facing straight downwards the y axis onto the map ("2D View"). This is not producing too many tiles to be loaded in any case. Worst case (Camera 2): In the case of an 3D game with flat camera viewing angles (looking to the horizon / infinity) this tileprovider fails due to an missing threshold like "max-loadable-extent". The provider is trying to load an huge amount of tiles to get all tiles possibly visible in the view-frustum of the camera. This will freeze the application for a long time or lead to an memory-overflow. Approach: Camera-Bound-Tileprovider should define an limit of maximum loadable tiles to avoid this scenario.

Markovicho avatar Jul 26 '21 09:07 Markovicho

@Markovicho I added a very simple check for this in one of the latest commits (in performance branch). but that's not a proper solution for obvious reasons. I'm hoping that we'll switch to a proper quad tree solution at some point and that'll be the ultimate fix.

brnkhy avatar Aug 03 '21 13:08 brnkhy

@brnkhy was this resolved? and how?

RomanAtBrief avatar Aug 29 '21 15:08 RomanAtBrief

@TheBriefTeam It's not and it'll be a part of our medium/long term goal; switching to proper quad tree implementation. I'll definitely let you know when that happens as it'll probably be a big-ish change.

brnkhy avatar Oct 08 '21 12:10 brnkhy