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

+10 -3
View File
@@ -1,6 +1,7 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import { globeMapEngine as engine } from './globeEngine.js';
import { KEYLESS_TERRAIN_URL } from './keylessTerrain.js';
import { mapEngineFor, provideMapEngine } from './engine.js';
import { bindRenderer } from '../render/rendererOf.js';
import { provideApplicationHooks } from '../render/applicationHooks.js';
@@ -69,8 +70,8 @@ test('the globe is shown and hidden through the port, read back without globe vi
assert.equal(engine.globeShown(visible.host), false);
});
test('terrain is the port’s world terrain, or the ellipsoid without a token', async () => {
const { host, renderer } = scene();
test('terrain is the port’s world terrain, or the keyless quantized mesh without a token', async () => {
const { host, renderer } = scene(['terrain']);
await assert.rejects(engine.terrain.world(''), /ion token/);
const world = await engine.terrain.world('token');
engine.applyTerrain(host, world);
@@ -79,7 +80,7 @@ test('terrain is the port’s world terrain, or the ellipsoid without a token',
]);
engine.applyTerrain(host, await engine.terrain.keyless());
assert.deepEqual(calls(renderer, 'setTerrain').at(-1).args, [
{ kind: 'ellipsoid' },
{ kind: 'quantizedMesh', url: KEYLESS_TERRAIN_URL },
]);
assert.throws(() => engine.imagery.ion(2, ''), /token/);
assert.deepEqual(engine.imagery.ion(3, 'token'), {
@@ -88,6 +89,12 @@ test('terrain is the port’s world terrain, or the ellipsoid without a token',
});
});
test('where the renderer draws no terrain the ellipsoid stays', async () => {
const { host, renderer } = scene([]);
engine.applyTerrain(host, await engine.terrain.keyless());
assert.deepEqual(calls(renderer, 'setTerrain').at(-1).args, [null]);
});
test('photoreal loads through the port, hides and shows, and is released', async () => {
const { host, renderer } = scene(['photoreal']);
const none = await engine.loadPhotoreal(host, {});