cesium icon indicating copy to clipboard operation
cesium copied to clipboard

Depth test billboards against ellipsoid horizon

Open ggetz opened this issue 4 months ago • 2 comments

Description

This is a follow-up to https://github.com/CesiumGS/cesium/pull/12821#discussion_r2449428957 which applies some basic horizon culling (see Kevin's horizon culling blog post for more info) to the fallback depth test for billboards and labels.

It seems to be working pretty well for mid-level horizon views as well as at the global scale:

main this branch
Image Image
Image Image

And it seems to be working well for 3D Tiles as well, so I went ahead and removed the custom depthTestDistance callbacks in the Moon and Mars example.

Issue number and link

N/A

Testing plan

  1. Test billboard and label properties, particularly the following, with a) the default ellipsoid, b) terrain, and c) Google P3DT (3D Tiles):
  • pixelOffset
  • eyeOffset
  • horizontalOrigin
  • verticalOrigin
  • scale
  • showBackground /backgroundPadding
  1. Verify depth testing behavior of the Moon and Mars sandcastle examplws.

Author checklist

  • [x] I have submitted a Contributor License Agreement
  • [x] I have added my name to CONTRIBUTORS.md
  • [ ] ~I have updated CHANGES.md with a short summary of my change~ I think this falls under the update for https://github.com/CesiumGS/cesium/pull/12821
  • [ ] ~I have added or updated unit tests to ensure consistent code coverage~
  • [ ] ~I have updated the inline documentation, and included code examples where relevant~
  • [x] I have performed a self-review of my code

ggetz avatar Oct 22 '25 15:10 ggetz

Thank you for the pull request, @ggetz!

:white_check_mark: We can confirm we have a CLA on file for you.

github-actions[bot] avatar Oct 22 '25 15:10 github-actions[bot]

On the whole this works nicely, but I'm noticing some odd behavior on Mars and Moon. Sometimes the labels and points flash in and out when they should be visible:

https://github.com/user-attachments/assets/b844ea77-f456-48e2-82e5-15fa0f748921

https://github.com/user-attachments/assets/c0015a1d-26d8-4ac8-8e08-60c76664d816

I haven't noticed that issue on any WGS84 sandcastles, so I thought maybe it was related to some hardcoded uniforms. I stumbled across this issue, but it's already been solved. So I'm not sure what's happening here, but I still think this is an improvement, and if it only slightly affects other ellipsoids, that's not a terrible tradeoff.

mzschwartz5 avatar Oct 22 '25 16:10 mzschwartz5