Skip to content

explorer: fix halo cutoff over terrain (disableDepthTestDistance)#181

Merged
rdhyee merged 1 commit intoisamplesorg:mainfrom
rdhyee:explorer-halo-depth-fix
May 9, 2026
Merged

explorer: fix halo cutoff over terrain (disableDepthTestDistance)#181
rdhyee merged 1 commit intoisamplesorg:mainfrom
rdhyee:explorer-halo-depth-fix

Conversation

@rdhyee
Copy link
Copy Markdown
Contributor

@rdhyee rdhyee commented May 9, 2026

Summary

Hotfix for the halo regression introduced in #180.

The white halos exposed a pre-existing Cesium terrain depth-test artifact: PointPrimitives are positioned at altitude=0, so wherever Cesium World Terrain has elevation, the front face of the terrain mesh occludes part of the sprite. Without halos, that truncation read as a slightly smaller dot. With halos, the white ring made the cut glaringly obvious — appearing as crescents — and over higher terrain the sprite vanishes entirely.

Reported view: explorer.html#v=1&lat=33.2706&lng=-86.2375&alt=311435 (Birmingham, AL hill country) — many dots showed only as half-moon halos or were entirely missing.

Fix

Add disableDepthTestDistance: Number.POSITIVE_INFINITY to all three PointPrimitive.add() sites (h3Points x2 cluster-mode + samplePoints x1). This matches the existing pattern already used by pointLabel at line 843 — points render always-on-top regardless of intervening terrain.

Trade-off

With depth test off, points on the far side of the globe could in principle bleed through. In practice at the zoom levels users hit (regional → world), the cluster aggregation hides this, and Cesium's frustum culling still removes truly back-facing primitives. Standard fix per Cesium docs.

Verified locally

quarto render + Playwright at the reported camera (lat=33.27, lng=-86.24, alt=311km):

check result
Dots render as full circles, no crescents
Dots over high terrain that were missing ✓ visible
Halos still present (a11y win preserved)

Test plan

  • Visit https://isamples.org/explorer.html#v=1&lat=33.2706&lng=-86.2375&alt=311435&heading=360.0 and confirm full-circle dots replace the previous crescents
  • Other terrain-heavy regions: any mountainous area at street zoom

🤖 Generated with Claude Code

The white halos added in isamplesorg#180 made a pre-existing terrain depth-test artifact
visible: dots positioned at altitude=0 get partly (or entirely) occluded by
Cesium World Terrain wherever land elevation rises. Without halos, the
truncation read as a smaller dot. With halos, the white ring exposes the cut
as a crescent — and over higher terrain, the whole sprite disappears.

Fix: add `disableDepthTestDistance: Number.POSITIVE_INFINITY` to all three
PointPrimitive add() sites (h3Points x2 + samplePoints), matching the existing
pattern used by `pointLabel` (line 843) — points render always-on-top
regardless of intervening terrain.

Reported view: explorer.html#v=1&lat=33.27&lng=-86.24&alt=311435 (Birmingham
AL hill country). Verified locally — dots render as full circles; previously-
missing dots over higher terrain are visible again.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant