Billboards are not properly clamping to the ground

1. A concise explanation of the problem you’re experiencing.

Entity with BillboardGraphics defined are not properly clamping to ground(clampToGround). This is not true for all of our billboards( we have a total of just over 900), and billboards that are causing the problems are different each time I run our application. I think something has changed in the last couple of builds. I’ll do a git bisect to check. Has anyone else noticed a change with billboards and clampToGround?

2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.

Selected Object:

id: 2bc4ce30-6729-402a-a713-a84207447048

position: {“x”:4148348.3120467556,“y”:3981164.0971134626,“z”:2753255.82268478}

orientation: {“x”:-0.2085740042263669,“y”:-0.4892534597703206,“z”:-0.7789996326139755,“w”:-0.3320956326889017}

billboard:

image: images/symbols/SFGP/SFGPUS-----D.PNG

show: true

scale: 1

horizontalOrigin: 0

verticalOrigin: 0

eyeOffset: {“x”:0,“y”:0,“z”:0}

pixelOffset: {“x”:0,“y”:0}

rotation: 0

alignedAxis: {“x”:0,“y”:0,“z”:0}

width: 48

height: 48

color: {“red”:1,“green”:1,“blue”:1,“alpha”:1}

heightReference: 1

show: true

Selection Box:

id: 5754b731-4479-4042-8536-9993d1eea3aa

position: {“x”:4148348.3120467556,“y”:3981164.0971134626,“z”:2753255.82268478}

billboard:

image: images/icons/border.png

scale: 1

horizontalOrigin: 0

verticalOrigin: 0

eyeOffset: {“x”:0,“y”:0,“z”:0}

pixelOffset: {“x”:0,“y”:0}

rotation: 0

width: 70

height: 70

color: {“red”:1,“green”:1,“blue”:1,“alpha”:1}

heightReference: 1

Check the images: the info above is from the badSelection.png

3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

I’m trying to show the selected unit, and we had to create our own selection box which looks just like the cesium selection box. We have a lot of stacked units, and we don’t always allow selection, so we had to right our own selection box(a billboard graphic). I can tell from moving the camera that the units that are not working properly are not clamping to the ground(this units move while moving the camera).

4. The Cesium version you’re using, your operating system and browser.

**Cesium 1.41, Windows 10, Chrome **Version 63.0.3239.84 (Official Build) (64-bit)

badSelection.png

correctSelection.png

This ‘Ground Clamping’ demo isn’t working very well. Most of the time the billboard is occluded by the terrain. Some times the billboard is partially occluded, and other times completely occluded.

Is there a bug about this?

I modified the Sandcastle demo, check the results. Shouldn’t the billboards always be rendered on top of the terrain? Our code sets the elevation which helps with the terrain occlusion, but seems to break the ground clamping at a point.

Hi Scott,

I think what we’re seeing here is a combination of this issue where billboards are clamping to ground at an incorrect position (relevant to your first two posts), and an issue with billboard rendering with depthTestAgainstTerrain enabled (relevant to your last two posts). I’ve updated the issues with links to this thread. What terrain format are you using? There’s some workarounds suggested in this issue that may be of use.

Thanks,

Gabby

Yea, there are definitely a couple of issues here. We’re seeing both issues, but the rendering issue I didn’t mention in the first couple of posts. We’re using the STK Terrain server, and I’m not 100% on the format. I just set the url of the terrain provider. :slight_smile: Thanks for the link, I’ll definitely check it out. The incorrect position problem has really stumped me this week, and I would be super happy to find a solution.

We have depthTestAgainstTerrain set to false, and I don’t remember why. We’re still on rare occasions seeing billboards render under the ground.

Thanks, Scott

I believe STK Terrain Server always outputs quantized-mesh. The first issue I linked to seems to only happen when using the heightmap format, so that may be unrelated.

On thing you may want to check out is that I noticed you are using Numbers for the horizontalOrigin and verticalOrigin properties, which should be a HorizontalOrigin type. Since it’s an enum, it’s interpreted as a Number and won’t throw any errors, but make sure you are using the one you expect.

Thanks,

Gabby

Hi all,

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.

Thank!

Gabby

I’ve found a clue! Our application has the ability to log in a particular role. Only the role which shows all of the units has this problem. Cesium is definitely hitting a limit with respect to the number of clamped to ground billboards.