iTowns / itowns

A Three.js-based framework written in Javascript/WebGL for visualizing 3D geospatial data
http://www.itowns-project.org
Other
1.11k stars 300 forks source link

Terrain precision glitching / jumping when using lower resolution terrain with default update strategy #2442

Open airnez opened 5 days ago

airnez commented 5 days ago

Context

Using a lower resolution terrain (world for instance) with the default strategy STRATEGY_MIN_NETWORK_TRAFFIC produces glitching effets by switching from precision levels very far apart from each other.

https://github.com/user-attachments/assets/e29a8923-5637-469b-9296-dcbd30d515dd

Steps to Reproduce

  1. Start from the view_3d_map example.
  2. Modify the range of the view.controls.lookAtCoordinate function to a smaller value like 1000 to zoom closer to ground when searching a place
  3. Remove the Highres France terrain to only use world terrain.
  4. Remove the update strategy in WORLD_DTM.json to use default one
  5. Search for the french city Sète
  6. See how tiles are switching between very far appart levels

Expected Behavior

Even if it makes sense that this strategy tries to request as few tiles as possible, it should not jump between levels too far appart.

Possible Cause/Fix/Solution

When zooming from the whole globe view to a close-up view, only very low-res and high res tiles are loaded, and the startegy switches betweel already loaded tiles.

AnthonyGlt commented 5 days ago

related https://github.com/iTowns/itowns/pull/2344#issuecomment-2360364539