Merge pull request #1835 from bilawalsidhu/fix-icon-near-plane-flicker

Icons drawn over depth no longer flicker
This commit is contained in:
Sameh Khamis authored and GitHub committed 2026-11-18 21:22:21 -08:00
commit b56c019df7
2 files changed
+9 -1

No files matched your search

@@ -0,0 +1,3 @@
- Icons drawn over depth (aircraft, vessels) no longer vanish for a frame now
and then in dense far-away clusters: they sit just past the near plane instead
of exactly on it, where rounding could discard them (samehkhamis, #1835).
+6 -1
View File
@@ -261,7 +261,12 @@ void main() {
if (overDepth && zclip >= -1.0 && zclip <= 1.0) {
gl_Position.z = -gl_Position.w;
#ifdef LOG_DEPTH
v_depthFromNearPlusOne = 1.0;
// Just past the near plane, not on it: czm_writeLogDepth discards a
// fragment at or below 0.9999999, and 1.0 interpolated across the quad
// can arrive a rounding step or two under that, dropping the icon for a
// frame as it moves (flicker). 1e-4 m past the near plane is still in
// front of everything the scene draws.
v_depthFromNearPlusOne = 1.0001;
#endif
}