3DBAG / 3dbag-viewer

https://3dbag.nl
GNU General Public License v3.0
35 stars 10 forks source link

Terrain-tiles: Elminate white flashes when switching between matrix levels. #26

Closed Ylannl closed 3 years ago

Ylannl commented 3 years ago

This occurs especially when zooming in and out.

Inspiration: https://stackoverflow.com/questions/12666570/how-to-change-the-zorder-of-object-with-threejs

jliempt commented 3 years ago

Fixed this by overlapping tiles from different tileLevel, making use of renderOrder. White tiles are rendered first, then tiles from the old tileLevel, and lastly new tiles. This means that the most relevant tile is rendered last and thus on top. With depthWrite = false you prevent artefacts showing up on overlapping geometries. Tiles from old tileLevel are removed from memory when downloadQueue is empty.