From a5c1356c0017d1b39c80aff7f847b00833116724 Mon Sep 17 00:00:00 2001 From: "Lukas Rieger (Blue)" Date: Sat, 10 Dec 2022 19:32:24 +0100 Subject: [PATCH] Enable depth-testing the highest lowres and the hires-tiles together --- src/MapViewer.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/MapViewer.js b/src/MapViewer.js index 812a5c0..ba6150d 100644 --- a/src/MapViewer.js +++ b/src/MapViewer.js @@ -322,8 +322,15 @@ export class MapViewer { let scenePos = this.map.lowresTileManager[i].scene.position; scenePos.x = -sX; scenePos.z = -sZ; + + if (i === 0) { + this.camera.far = cameraFar; // reset far clipping for the highest lowres lod to make depth-tests possible + this.camera.updateProjectionMatrix(); + } + this.renderer.render(this.map.lowresTileManager[i].sceneParent, this.camera); - this.renderer.clearDepth(); + + if (i !== 0) this.renderer.clearDepth(); // clear depth-buffer for all lowres except the highest } }