I would like to show labels on the globe above terrain. Disabling depthTestAgainstTerrain is not an option since it is needed for other features. My problem is that the label ends up under the terrain as I zoom in, likely due to my custom terrain being somewhat inaccurate at lower zoom levels.
I am using HeightReference.RELATIVE_TO_GROUND, and what seems to be occurring is the height is set to the terrain height at a lower zoom level but does not update when zooming in. Is there a way to have Cesium use a different terrain layer to determine the height? Alternatively, I would be happy to simply increase the height relative to the ground, but I have not found a way to do this either.
It sounds like your problem is related to this issue: https://github.com/AnalyticalGraphicsInc/cesium/issues/2694
Unfortunately, I don’t have a good workaround for that if you need depthTestAgainstTerrain enabled. We hope to fix this issue sooner rather than later, but I’m not sure exactly when we’ll be able to get to it.
I’ve linked your forum post for the issue.
Thanks for the information. For now I have solved my problem by using sampleTerrain to determine the required height and added an additional amount before setting the entity position with Cartesian3.fromDegrees(). It is still clipped in a few instances where the point labeled is on a slope, but it serves my current purpose.
The issue #2694 mentioned in this thread has just been closed and may resolve your issue. Look for the change in the next release of Cesium or get it now in the master branch on GitHub https://github.com/AnalyticalGraphicsInc/cesium.