Keyless terrain reaches the renderer as quantized-mesh terrain

The contract's TerrainSpec gains quantizedMesh terrain: Cesium's tile
format in the folder at its url, heights above the ellipsoid. Without an
ion key the globe-port map engine asks for Re:Earth's keyless terrain as
it, where it asked for the ellipsoid, so the renderer
draws the same ground; without the terrain capability keeps the
ellipsoid. Cesium's globe port draws it through CesiumTerrainProvider with
the keyless terrain's retry policy.
This commit is contained in:
Sameh Khamis committed 2026-11-11 09:20:33 -08:00
1 parent c57e535275
commit 1f307e0735
9 files changed
+101 -17

No files matched your search

+17
View File
@@ -20,6 +20,7 @@ import { provideUnboundGlobe } from '../rendererOf.js';
import { isBaseTileset, markBaseTileset } from '../baseTilesets.js';
import { listenerList, uncaught } from './common.js';
import { createCesiumImagery } from './imagery.js';
import { createTerrainRetryPolicy } from '../../maps/terrainRetry.js';
// The base marks live outside the adapter, so code that is not Cesium's can
// mark a base; they are re-exported here for the code that still is.
@@ -51,6 +52,22 @@ async function terrainProvider(spec, { worldDataToken }) {
requestWaterMask: false,
});
}
if (spec.kind === 'quantizedMesh') {
if (typeof spec.url !== 'string' || !spec.url)
throw new TypeError('Quantized-mesh terrain needs its url');
// Busy hosts are asked again as the keyless terrain is
// (`terrainRetry.js`); every tile's resource inherits the policy.
const policy = createTerrainRetryPolicy();
const resource = new Cesium.Resource({
url: spec.url,
retryCallback: policy.retryCallback,
retryAttempts: policy.retryAttempts,
});
return Cesium.CesiumTerrainProvider.fromUrl(resource, {
requestVertexNormals: spec.requestVertexNormals ?? false,
requestWaterMask: false,
});
}
throw new TypeError(`Unknown terrain kind: ${spec.kind}`);
}