gltf, depthTestAgainstTerrain, and kml billboards, polylines, etc.

I am using version 1.44. I need globe.depthTestAgainstTerrain set to true for my gltf model to not render under the globe. Doing this causes numerous rendering issues (clipping with globe) with labels, polylines, and billboards (described in KML documents) close to the surface. I understand this is still in progress as described here:

Is there any way to get this working in 1.44? Is there a way to depthTestAgainstTerrain only for gltf models? If not, is that something realistic that I could add (even if only in a local branch of the code)?


I am currently trying to add a clipping plane to the model where the clipping place is roughly the surface of the earth. I'm not quite able to get the correct plane just yet.

For the billboards, labels, etc which you don’t want depth testing to be used, you can set the disableDepthTestDistance property to Number.POSITIVE_INFINITY to disable it.

If you still want to go the clipping plane route, I would try setting the ClippingPlaneCollection.modelMatrix property to the current entity model matrix, which will orient the plane in the same coordinate system as the model:

entity.model.clippingPlanes = new Cesium.ClippingPlaneCollection({

planes : clippingPlanes,

modelMatrix : entity.computeModelMatrix(viewer.clock.currentTime, result)




Regarding disableDepthTestDistance, how do I pass this to the KML data source so it applies to everything?

After the dataSource is loaded, you can iterate through all the entities and set any properties on them. See the Cesium Workshop tutorial section on Loading and Styling Entities.