1. A concise explanation of the problem you’re experiencing.
Stacking graphics on an entity using the eyeOffset doesn’t seem to be working with disable depth test distance set to the max.
2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.
I’m trying to get the label in front of the point, like this.
//jshint asi:true, quotmark:single
var viewer = new Cesium.Viewer(‘cesiumContainer’)
var ds = new Cesium.CustomDataSource()
//viewer.scene.globe.depthTestAgainstTerrain = true
viewer.dataSources.add(ds)
var ppa = ds.entities.add({
position : Cesium.Cartesian3.fromDegrees(-75.1641667, 39.9522222),
point: {
pixelSize: 30,
color: Cesium.Color.CORNFLOWERBLUE,
outlineColor: Cesium.Color.BLUEVIOLET,
outlineWidth: 3,
//disableDepthTestDistance: Number.POSITIVE_INFINITY
},
label: {
text : ‘Philadelphia’,
fillColor: Cesium.Color.DEEPPINK ,
eyeOffset: new Cesium.Cartesian3(0, 0, -1000),
//disableDepthTestDistance: Number.POSITIVE_INFINITY
}
})
``
Looks great! Now, can we do this with depth testing turned on? Let’s try:
//jshint asi:true, quotmark:single
var viewer = new Cesium.Viewer(‘cesiumContainer’)
var ds = new Cesium.CustomDataSource()
viewer.scene.globe.depthTestAgainstTerrain = true
viewer.dataSources.add(ds)
var ppa = ds.entities.add({
position : Cesium.Cartesian3.fromDegrees(-75.1641667, 39.9522222),
point: {
pixelSize: 30,
color: Cesium.Color.CORNFLOWERBLUE,
outlineColor: Cesium.Color.BLUEVIOLET,
outlineWidth: 3,
disableDepthTestDistance: Number.POSITIVE_INFINITY
},
label: {
text : ‘Philadelphia’,
fillColor: Cesium.Color.DEEPPINK ,
eyeOffset: new Cesium.Cartesian3(0, 0, -1000),
disableDepthTestDistance: Number.POSITIVE_INFINITY
}
})
``
Oh no! We haven’t gotten the text in front of the point. Is there any way to do this?
3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
I’m trying to achieve the above result of label text in front of point/billboard with depth testing turned on (for other entities, but not these).
4. The Cesium version you’re using, your operating system and browser.
Cesium 1.37, Window, FF 58 and Chrome 62