Lines disappears on zooming in

Here is the viewer change

var viewer = new Cesium.Viewer(“cesiumContainer”, {

shouldAnimate: true,

terrainProvider : Cesium.createWorldTerrain()

});

Zoom all the way in and out …

Hi Sam,

@micelic

Thank you for sharing your sandcastle demo with the community. It looks like sections of the KML are being hidden as I zoom towards the terrain.

image

This error might be related to multi-frustum artifacts. Thus, it may be fixed by enabling log depth. Please try setting

scene.logarithmicDepthBuffer = true;
scene.camera.frustum.near = 0.1;
scene.camera.frustum.far = 10000000000.0;

-Sam

Hi Sam.

I see the same issue. This is what I did on your sandcastle.

var viewer = new Cesium.Viewer(“cesiumContainer”,{terrainProvider : Cesium.createWorldTerrain()});
viewer.scene.logarithmicDepthBuffer = true;
viewer.scene.camera.frustum.near = 0.1;
viewer.scene.camera.frustum.far = 10000000000.0;

Let me know if this is what you were asking.

Thanks,

Carlo

Hi Sam

Here is another sandcastle example

@micelic

Are you still seeing the same issue even when you update your project to include the following code?

scene.logarithmicDepthBuffer = true;
scene.camera.frustum.near = 0.1;
scene.camera.frustum.far = 10000000000.0;

-Sam

I have some code with the same bug. Adding those 3 lines didn’t fix it. If I find a solution I’ll post it here. It vanishes if I zoom in and generally looks strange as I pan and tilt the view. The same code works perfectly with other data in a different location!

const redLine = viewer.entities.add({
name: “Route”, polyline: {
positions: Cesium.Cartesian3.fromDegreesArray(posns),
width: 15,
material: Cesium.Color.RED,
clampToGround: true, },
});

Hi everyone,

Has there been a solution to this issue? I am also facing a similar challenge with icons and even labels. When zooming in, they dissapear.

Hi @elolelo,

I would recommend setting the disableDepthTestDistance property for billboards and labels in this case.