Hide billboards behind hills

dear cesium team,
can you tell me please how to make billboards hidden if they are behind the hills of the terrain??

1 Like

The disableDepthTestDistance property of billboard may be helpful here.

Try setting disableDepthTestDistance to Number.POSITIVE_INFINITY as suggested in the documentation.

thank you but it is not working, i tried it.
is there another property that i have to set it?

Actually, I double-checked and billboards are hidden by default if they are behind hills.

Can you link a Sandcastle with the problem reproduced?

sandcastle link

and this is a video showing what is going on.

my code is in the first function : addBillboard();

Great thank you for sharing the Sandcastle. Can you try setting viewer.scene.globe.depthTestAgainstTerrain = true ?

You can also remove the disableDepthTestDistance property on billboard.

Here is the doc explaining terrain depth test.

viewer.scene.globe.depthTestAgainstTerrain = true

this makes the billboard and the label drown in the terrain.

my case is very simple:
i want to put some billboards in many locations, with labels.
i want them to be clamped to ground, and when i turn the globe, if any billboard is behind the hill i want it to be hidden.
what is the best way to do it?
right now, billboards and labels are drowning in the terrain if i use depthTestAgainstTerrain = true.
YES “depthTestAgainstTerrain” makes them hidden if they are behind hills, but this property "depthTestAgainstTerrain " makes them drown too.
any solutions please?
Thank you very much for supporting me.

1 Like

Hi Marto,

I just confirmed with our team about the billboard depth test. Unfortunately, if you want the billboards to be hidden behind hills when you are close to them, you’ll need to turn depthTestAgainstTerrain = true, which will in turn cause the parts of the billboards to “drown” when they are far away from the camera.

This is a tradeoff we made for speed. This issue in Github may be helpful to read more about.

Thank you very much for your efforts.
Best Regards.

I’m also facing same type issue, i’m drawing an ellipse on globe without terrain on then it’s appears properly but when i open the terrain it vanished somewhere i don’t know where. Please give any idea how to make it visible.
Thanks in Advance

1 Like