Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing terrain provider moves billboard to incorrect location #8006

Open
OmarShehata opened this issue Jul 16, 2019 · 3 comments
Open

Changing terrain provider moves billboard to incorrect location #8006

OmarShehata opened this issue Jul 16, 2019 · 3 comments

Comments

@OmarShehata
Copy link
Contributor

This came up on the forum. Here's a Sandcastle example. To reproduce:

  1. Zoom in close enough to the billboards and tilt the camera until you see them curve

billboard1

  1. Select "delete billboards"
  2. Select "change terrain provider"
  3. Select "add billboards"
  4. Select "change terrain provider"
  5. Observe that they're now in a different position:

billboards2

This may be just another manifestation of #4776 but I couldn't dig deep enough to figure out what the underlying issue was.

@raycrummey
Copy link

One detail that may be relevant. If there weren't different pixel offsets for each billboard in this sandcastle, the billboards would render on top of other billboards in the set.

So they end up rendering on top of each other when this issue happens.

@bn-dignitas
Copy link
Contributor

So many billboard tickets out there, but I think this is the most relevant to what I'm seeing and I wanted to add my observations. So here it goes...

Stationary billboards do not clamp correctly when entities are removed just before terrain is reloaded and entities are added while terrain is still loading.

Note that in the example code(see link below), all entities are removed, but even if one or more entities are removed and new ones are added you can see the issue.

Observations

  • calling removeAll seems to work better vs individually removing entities
    • we don't have the option to call removeAll in our use case
  • This does not happen when disabling the reuse of "unused" billboards in EntityCluster
    • I modified code so that new billboards are always created and deleted on removal
    • Though this makes the problem go away, I do not think this is the exact underlying cause since it just prevents updateHeight callbacks on reused billboard objects

It looks like the QuadtreePrimitive customData list keeps growing and some stale height callbacks are being made with old coordinates. This seems to be in agreement with @lilleyse comment in #8650

For my case I can delay loading of entities (by timer or wait until all tiles are loaded), but it really isn't optimal.

Note that we have been seeing this issue since at least 1.57, even possibly as far back as 1.51, but have not had time to debug.

Middle click will reload terrain and demonstrate issue
https://sandcastle.cesium.com/#c=jVVtb+M2DP4rRIABys6nuC06oE1SrGuKtU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jz3OrQ9b+mNUTNhj5D/BQ

@bn-dignitas
Copy link
Contributor

Note that the delay in loading entities does not always help and also I noticed that the customData length continues to grow each terrain reload so that is a bit worrisome.

bn-dignitas added a commit to bn-dignitas/cesium that referenced this issue Aug 3, 2020
…ltiple callbacks being registered for the same billboard in invalidateAllTiles, resulting in leaked/stale callbacks and bad clamped locations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants