perf(shipwrecks): place markers without a terrain height read each

Each of the 7,958 wreck billboards was ground-clamped, and a clamped
billboard reads the terrain height as it is created. Switching the layer
on after the globe had loaded froze the page for about 3 s in one task.
The markers now sit on the ellipsoid with no height reference; the depth
test is already off and the card already used that position.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
Mazeyar Moeini FeizabadiandClaude Fable 5.2 committed 2026-11-13 14:36:21 +01:00
1 parent 188f0ccd9b
commit 7b6ec7f963
3 files changed
+21 -3

No files matched your search

+14
View File
@@ -163,6 +163,20 @@ test('markers sit on the wreck: no eye offset, bigger toll drawn last', async ()
assert.equal(h.markers.billboards[2].width, markerPixelSize(1500));
});
test('markers are placed without a terrain height read each', async () => {
// A ground-clamped billboard reads the terrain height when it is created;
// for every wreck in one pass that froze the page for seconds.
const h = harness({ snapshots: [snapshot([wreck('a'), wreck('b')])] });
h.layer.enable();
await h.layer.update();
assert.equal(h.markers.billboards.length, 2);
for (const billboard of h.markers.billboards) {
assert.equal(billboard.heightReference, undefined);
const { height } = Cesium.Cartographic.fromCartesian(billboard.position);
assert.equal(Math.abs(height) < 1e-6, true);
}
});
test('an unchanged snapshot does not rebuild the markers', async () => {
const records = [wreck('a')];
const h = harness({