explorer: fix halo terrain occlusion via scene.globe.depthTestAgainstTerrain (v2)#184
Closed
rdhyee wants to merge 1 commit intoisamplesorg:mainfrom
Closed
explorer: fix halo terrain occlusion via scene.globe.depthTestAgainstTerrain (v2)#184rdhyee wants to merge 1 commit intoisamplesorg:mainfrom
rdhyee wants to merge 1 commit intoisamplesorg:mainfrom
Conversation
Replaces the reverted PR isamplesorg#181 fix. The earlier attempt set `disableDepthTestDistance: Number.POSITIVE_INFINITY` on every PointPrimitive, which disables depth-test entirely — including against the globe ellipsoid. That caused back-side-of-globe primitives to bleed through the planet AND broke pickability (hover labels and click-routing went to wrong primitives), both worse than the original crescent halos it was trying to fix. Codex review of d681758 identified the correct Cesium API: scene-level `globe.depthTestAgainstTerrain = false`. This tells the globe to draw primitives over terrain (fixes crescents and disappearing dots over hills) while preserving the ellipsoid's normal back-face occlusion and pick correctness. One line, applied right after Viewer construction. No per-primitive changes; the halos from isamplesorg#180 stay. Verified locally: - Birmingham AL hilly view (the reported repro): full-circle halos, no crescents, dots over higher terrain visible. - World view (Africa-centered): globe occlusion intact, no back-side primitive bleed-through. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Closing as no-op per Codex review: The original PR #180 halo crescents must therefore have a different root cause. Re-investigating before opening another fix attempt. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Second attempt at the PR #180 halo terrain-occlusion bug. Replaces the reverted #181.
Why #181 was wrong (Codex review of
d681758):Setting
disableDepthTestDistance: Number.POSITIVE_INFINITYon everyPointPrimitivedisables depth-test entirely, including against the globe ellipsoid. That caused two regressions worse than the original crescent halos:The correct fix (one line, scene-level):
Applied immediately after
Viewerconstruction. This is the documented Cesium switch for "primitives at altitude=0 should draw over terrain elevation, but still respect ellipsoid back-face occlusion." It fixes the original crescent / disappearing-dots-over-hills problem without the d681758 regressions because:add()sites.The halos from #180 are untouched.
Verified locally
quarto render+ Playwright at two cameras:lat=33.27, lng=-86.24, alt=311km(Birmingham AL hill country)Diff
8 lines — 1 line of actual code + 7 lines of comment explaining the Cesium-API choice and why per-primitive
disableDepthTestDistancewas wrong.Test plan
https://isamples.org/explorer.html#v=1&lat=33.2706&lng=-86.2375&alt=311435&heading=360.0— full-circle halosRefs #180, #181 (reverted), #183 (revert PR). Codex-reviewed.
🤖 Generated with Claude Code