Billboard "always on top" - possible?

Is it possible to have a billboard never be obscured by other entities, even if the billboard’s altitude is below other entities? I’d like the billboard to always take precedence over lines, walls, etc, regardless of altitude.

That is, in the following sandcastle, I’d like the line to never obscure the image. Is it possible, or am I expecting too much?

var viewer = new Cesium.Viewer(‘cesiumContainer’);

viewer.entities.add({

position : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883, 10),

billboard :{

image : ‘…/images/Cesium_Logo_overlay.png’

}

});

var positions = [ -65.59777, 40.03883, 10000, -75.59777, 40.03883, 10000, -85.59777, 40.03883, 10000 ];

viewer.entities.add({

polyline: {

positions: Cesium.Cartesian3.fromDegreesArrayHeights( positions ),

width: 10

}

});

viewer.zoomTo( viewer.entities );

Hi,

Try setting the billboard’s z eye offset: https://github.com/AnalyticalGraphicsInc/cesium/blob/1.10/Source/Scene/Billboard.js#L439

Patrick

You guys always have the answers. That worked, of course. Thank you!

Can you share how exactly you made this work?

There is an example of the eyeOffset in the Billboards Sandcastle Demo. Let me know of that helps.

I just played with the eyeOffset value a lot until it was working. Set the stuff you want *below* the billboard with a *high* eyeOffset value (new Cesium.Cartesian3( 100000 ) ), and set the billboard itself with a low eyeOffset. It can disappear when the camera gets close, so I listen to the camera.moveEnd event and set the eyeOffset of the billboard to new Cesium.Cartesian3( 0, 0, -( camera.positionCartographic.height - 10000 ) ), so the eyeOffset of the billboard is dependent on the camera position. Notice the negative sign in front. I don't totally understand how it works, but this worked for me. My suggestion is to just play with the eyeOffset values of what you want below and above until you get a working scenario.