mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 09:42:21 +00:00
fix(render): icons drawn over depth no longer flicker
An icon drawn over depth set its log depth to exactly the near plane (1.0). Interpolated across the quad, that value can arrive a rounding step or two under czm_writeLogDepth's 0.9999999 cut, which discards the fragment, so a moving icon vanished for a frame now and then, most visibly far away in dense clusters. It now sits 1e-4 m past the near plane, still in front of everything.
This commit is contained in:
1 parent
d2dac41668
commit
6a86102336
1 file changed
+6
-1
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user