The documentation on pickPosition (https://cesiumjs.org/Cesium/Build/Documentation/Scene.html#pickPosition) states that it uses the depth buffer to compute the picked position. Disabling depth testing against terrain causes the globe to no longer write to the depth buffer (so it no longer occludes objects) but that means it will also no longer be picked up in the pickPosition pass.
The polyline on terrain looks the same regardless of whether terrain depth test is on or off (except then picking doesn’t work correctly when it’s off).
If you can describe your use case in more detail and how having more control over the depth test will be useful to you, it can help get support for this feature. Feel free to share this here in this thread or in the GitHub issue.
It looks like the disappearing parts are fixed by setting clampToGround: true on the polyline.
Another thing you could do is disable depth test on that one individual polyline. You can effectively do this by using a depthFailMaterial that has the same material as the regular polyline. One more way to fix it is to give the polyline points a height a little above the ground (about 1000 seemed to work well in this demo).
when depthTestAgainstTerrain= false ,line also have problem。link another question : Comparisons with polyline ,the point don’t have option clamptoGround 。
If you want to clamp a point to the ground you can set the height reference to be either relative to ground (and set a height 0) or make the height reference CLAMP_TO_GROUND.