Check a released tileset by height, not by the source label

Cesium labels every scene hit, the globe included, as tiles, so asking
that no answer is labelled tiles after leaving photoreal failed on the
reference engine. The check now asks that no tile geometry answers above
the terrain: a tile-labelled height must match the terrain height.
This commit is contained in:
German Khokhlov committed 2026-11-10 23:39:36 +04:00
1 parent e98bf9c485
commit 697dc91e81
1 file changed
+9 -2
+9 -2
View File
@@ -23,11 +23,18 @@ export function photorealChecks(engine, { settle }) {
].filter(Boolean);
await engine.maps.setPhotorealTiles(null);
await settle();
for (const place of places)
// Cesium labels every scene hit, the globe included, as tiles; what
// matters is that no tile geometry answers above the terrain.
for (const place of places) {
const sampled = engine.surface.sampleHeightDetailed(place);
const terrain = engine.surface.terrainHeight(place);
ensure(
engine.surface.sampleHeightDetailed(place)?.source !== 'tiles',
sampled?.source !== 'tiles' ||
(Number.isFinite(terrain) &&
Math.abs(sampled.height - terrain) <= 1),
'released photoreal tiles still answer surface queries',
);
}
},
],
];