diff --git a/src/Core/Prefab/Globe/GlobeLayer.js b/src/Core/Prefab/Globe/GlobeLayer.js index 95c0be094f..b7d2469938 100644 --- a/src/Core/Prefab/Globe/GlobeLayer.js +++ b/src/Core/Prefab/Globe/GlobeLayer.js @@ -43,8 +43,6 @@ class GlobeLayer extends TiledGeometryLayer { * level for this tiled layer. * @param {number} [config.sseSubdivisionThreshold=1] - Threshold level for * the SSE. - * @param {number} [config.maxDeltaElevationLevel=4] - Maximum delta between - * two elevations tile. * * @throws {Error} `object3d` must be a valid `THREE.Object3d`. */ @@ -67,8 +65,6 @@ class GlobeLayer extends TiledGeometryLayer { this.options.defaultPickingRadius = 5; this.minSubdivisionLevel = this.minSubdivisionLevel == undefined ? 2 : this.minSubdivisionLevel; this.maxSubdivisionLevel = this.maxSubdivisionLevel == undefined ? 19 : this.maxSubdivisionLevel; - this.maxDeltaElevationLevel = this.maxDeltaElevationLevel || 4.0; - this.extent = this.schemeTile[0].clone(); for (let i = 1; i < this.schemeTile.length; i++) { diff --git a/src/Core/Prefab/Planar/PlanarLayer.js b/src/Core/Prefab/Planar/PlanarLayer.js index 7066b9a2da..30a331e8fa 100644 --- a/src/Core/Prefab/Planar/PlanarLayer.js +++ b/src/Core/Prefab/Planar/PlanarLayer.js @@ -31,8 +31,6 @@ class PlanarLayer extends TiledGeometryLayer { * name. * @param {number} [config.maxSubdivisionLevel=5] - Maximum subdivision * level for this tiled layer. - * @param {number} [config.maxDeltaElevationLevel=4] - Maximum delta between - * two elevations tile. * * @throws {Error} `object3d` must be a valid `THREE.Object3d`. */ @@ -49,7 +47,6 @@ class PlanarLayer extends TiledGeometryLayer { this.extent = extent; this.minSubdivisionLevel = this.minSubdivisionLevel == undefined ? 0 : this.minSubdivisionLevel; this.maxSubdivisionLevel = this.maxSubdivisionLevel == undefined ? 5 : this.maxSubdivisionLevel; - this.maxDeltaElevationLevel = this.maxDeltaElevationLevel || 4.0; } } diff --git a/src/Layer/TiledGeometryLayer.js b/src/Layer/TiledGeometryLayer.js index 5e913c3c5a..666d9f3a3c 100644 --- a/src/Layer/TiledGeometryLayer.js +++ b/src/Layer/TiledGeometryLayer.js @@ -85,6 +85,10 @@ class TiledGeometryLayer extends GeometryLayer { throw new Error(`Cannot init tiled layer without builder for layer ${this.id}`); } + if (config.maxDeltaElevationLevel) { + console.warn('Config using maxDeltaElevationLevel is deprecated. The parameter maxDeltaElevationLevel is not longer used'); + } + this.level0Nodes = []; const promises = []; @@ -414,23 +418,6 @@ class TiledGeometryLayer extends GeometryLayer { if (this.maxSubdivisionLevel <= node.level) { return false; } - - // Prevent to subdivise the node if the current elevation level - // we must avoid a tile, with level 20, inherits a level 3 elevation texture. - // The induced geometric error is much too large and distorts the SSE - const nodeLayer = node.material.getElevationLayer(); - if (nodeLayer) { - const currentTexture = nodeLayer.textures[0]; - if (currentTexture && currentTexture.extent) { - const offsetScale = nodeLayer.offsetScales[0]; - const ratio = offsetScale.z; - // ratio is node size / texture size - if (ratio < 1 / 2 ** this.maxDeltaElevationLevel) { - return false; - } - } - } - subdivisionVector.setFromMatrixScale(node.matrixWorld); boundingSphereCenter.copy(node.boundingSphere.center).applyMatrix4(node.matrixWorld); const distance = Math.max(