Skip to content

Commit 01ff174

Browse files
rdhyeeclaude
andauthored
explorer: bounded disableDepthTestDistance to make dots visible over terrain (closes #185) (#198)
Cluster and sample point primitives are placed at altitude=0 (the WGS84 ellipsoid surface). With Cesium world terrain enabled, terrain mesh in hilly regions (Troodos in Cyprus, hill country around Birmingham AL, etc.) rises hundreds to thousands of meters above ellipsoid — so points at altitude=0 are physically *underground* in those regions and get depth-culled by Cesium's standard per-pixel depth test. The fix is one new property at each of the three .add() call sites: disableDepthTestDistance: POINT_DEPTH_TEST_DISTANCE // 2.0e6 = 2,000 km Bypass scope: only when the camera is closer than 2,000 km, which covers every realistic interactive altitude (point mode <120 km, res8 cluster up to ~300 km, res6 up to ~3,000 km — the upper end is technically outside the bypass but at that altitude dots are tiny anyway). Why bounded (2.0e6) and not POSITIVE_INFINITY: PR #181 used Infinity and caused back-side-of-globe primitive bleed-through plus broke pickability (was reverted via #183). A 2,000 km bound preserves globe-ellipsoid occlusion at long range while bypassing terrain occlusion at every interactive zoom. Hypothesis source: Codex review of #185 identified sea-level placement as the most likely root cause. Confirmed experimentally by runtime- patching the live deploy: T0 baseline (no fix) Cyprus interior: ~0 dots T1 swap to EllipsoidTerrainProvider minor improvement T2 raise primitives to height=5000m significant improvement T3 disableDepthTestDistance: 2.0e6 (this PR) significant, equivalent to T2, no back-side bleed Closes #185. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 976715b commit 01ff174

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

explorer.qmd

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,27 @@ function sourceFilterSQL(col) {
417417
SOURCE_VALUES = ['SESAR', 'OPENCONTEXT', 'GEOME', 'SMITHSONIAN']
418418
DEFAULT_POINT_BUDGET = 5000
419419
420+
// Disable per-primitive depth test below this camera distance (meters).
421+
// All cluster and sample point primitives are placed at altitude=0 (ellipsoid
422+
// surface). With Cesium world terrain enabled, terrain mesh in hilly regions
423+
// (e.g. Troodos mountains in Cyprus, Birmingham AL hills) rises hundreds to
424+
// thousands of meters above ellipsoid — making sea-level primitives
425+
// physically underground and depth-culled by the standard per-pixel depth
426+
// test (issue #185).
427+
//
428+
// Bypass scope: only when the camera is closer than 2,000 km, which covers
429+
// every realistic interactive altitude (point mode <120 km, res8 cluster
430+
// mode up to ~300 km, res6 up to ~3,000 km — the upper range is technically
431+
// outside the bypass but at that altitude dots are tiny anyway, so this is
432+
// where the existing pre-issue behavior is preserved).
433+
//
434+
// Why bounded (2.0e6) and not POSITIVE_INFINITY: PR #181 used Infinity and
435+
// caused back-side-of-globe primitive bleed-through (the depth test was the
436+
// only thing keeping points on the FAR hemisphere from rendering through
437+
// the Earth). A 2,000 km bound preserves globe-ellipsoid occlusion at
438+
// long range while bypassing terrain occlusion at every interactive zoom.
439+
POINT_DEPTH_TEST_DISTANCE = 2.0e6
440+
420441
function csvParamValues(params, key) {
421442
if (!params.has(key)) return null;
422443
const raw = params.get(key) || '';
@@ -1034,6 +1055,7 @@ phase1 = {
10341055
outlineColor: Cesium.Color.WHITE,
10351056
outlineWidth: 1.5,
10361057
scaleByDistance: scalar,
1058+
disableDepthTestDistance: POINT_DEPTH_TEST_DISTANCE, // issue #185
10371059
});
10381060
}
10391061
@@ -1395,6 +1417,7 @@ zoomWatcher = {
13951417
outlineColor: Cesium.Color.WHITE,
13961418
outlineWidth: 1.5,
13971419
scaleByDistance: scalar,
1420+
disableDepthTestDistance: POINT_DEPTH_TEST_DISTANCE, // issue #185
13981421
});
13991422
}
14001423
@@ -1566,6 +1589,7 @@ zoomWatcher = {
15661589
outlineColor: Cesium.Color.WHITE,
15671590
outlineWidth: 1.5,
15681591
scaleByDistance: scalar,
1592+
disableDepthTestDistance: POINT_DEPTH_TEST_DISTANCE, // issue #185
15691593
});
15701594
}
15711595
}

0 commit comments

Comments
 (0)