You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am creating a PointPrimitive (not an Entity) like so:
var point = points.add( {
position: Cesium.Cartesian3.fromDegrees( -60, 0, 0, viewer.scene.globe.ellipsoid ),
pixelSize: 20,
color: new Cesium.Color( 1, 0, 1, 1 ),
heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
disableDepthTestDistance: Number.POSITIVE_INFINITY
} );
When the page first loads, the point is sometimes visible, sometimes not. In either case, if I rotate the globe for a few seconds (no particular direction -- just back and forth, up and down), the point flickers badly. Sometimes it disappears entirely, and stays invisible for tens of seconds. Sometimes it seems like the direction I drag matters (e.g. the point stays visible if I drag upward, but disappears if I drag to the left), but that could just be my imagination.
If I set disableDepthTestDistance to zero, the problem does not occur. However, in my application that causes other problems -- I have other primitives on the ellipsoid surface, whose vertices stick up a little bit, and the point can end up partially behind those vertices. Disabling the depth test seems like the right way to solve that problem ... but when the depth test is disabled, I encounter the problem described above.
I spent a while digging in the Cesium code, but I can't even figure out the general category of what's going on. The point doesn't seem to be occluded -- sometimes the issue is apparent even before the ellipsoid gets drawn ... nothing is being rendered but the point and the starry background, yet the point still flickers.
Browser: Firefox, Chromium
Operating System: Linux
The text was updated successfully, but these errors were encountered:
Thanks for reporting this @stacktracer . This seems to be an issue with the way the PointPrimitiveCollectionVS disables depth distance when logarithmic depth buffer is on. If you turn off log depth viewer.scene.logarithmicDepthBuffer = false; it should stop the flickering.
This is the piece of code where the depth test is disabled:
@OmarShehata -- awesome! Disabling log-depth does indeed avoid the flickering issue.
I guess the log call introduces some precision error, which sometimes puts the point on the wrong side of the near clip plane?
I'm still catching up on the relevant concepts (logarithmic depth buffer is clever!) ... but naively it seems like the precision error could be avoided by checking for gl_Position.z == gl_Position.w, and setting the logged-depth to be right on the near plane. Although not sure how that behaves when there are multiple frustums ... still thinking ....
I am creating a
PointPrimitive
(not an Entity) like so:When the page first loads, the point is sometimes visible, sometimes not. In either case, if I rotate the globe for a few seconds (no particular direction -- just back and forth, up and down), the point flickers badly. Sometimes it disappears entirely, and stays invisible for tens of seconds. Sometimes it seems like the direction I drag matters (e.g. the point stays visible if I drag upward, but disappears if I drag to the left), but that could just be my imagination.
Sandcastle example: LINK
If I set
disableDepthTestDistance
to zero, the problem does not occur. However, in my application that causes other problems -- I have other primitives on the ellipsoid surface, whose vertices stick up a little bit, and the point can end up partially behind those vertices. Disabling the depth test seems like the right way to solve that problem ... but when the depth test is disabled, I encounter the problem described above.I spent a while digging in the Cesium code, but I can't even figure out the general category of what's going on. The point doesn't seem to be occluded -- sometimes the issue is apparent even before the ellipsoid gets drawn ... nothing is being rendered but the point and the starry background, yet the point still flickers.
Browser: Firefox, Chromium
Operating System: Linux
The text was updated successfully, but these errors were encountered: