Enable depth-testing the highest lowres and the hires-tiles together

This commit is contained in:
Lukas Rieger (Blue) 2022-12-10 19:32:24 +01:00
parent 5bfb775473
commit a5c1356c00
No known key found for this signature in database
GPG Key ID: 2D09EC5ED2687FF2

View File

@ -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
}
}