Billboards render in wrong location when terrain provider changed.

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

Billboards render incorrectly when entities are added and deleted and terrain provider is changed. The underlying data is correct, but billboards are drawn on-top of other billboards.

In this example I gave the billboards a unique offset so you can see that they are getting drawn in the wrong location. If the offset if set to 0, then it looks like the billboards disappear, but they are really just rendered on top of another billboard.

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

  • Load sandcastle. (see below)

  • Select “Delete Billboards” in the dropdown

  • Select “Add multiple Billboards”

  • Select “Change Terrain Provider”

  • Verify that several billboards are rendered out of place.

https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/#c=nVd7b9s2EP8qRP6Jg7hylCx9pEmxOs7aYGkdtG6xrS4KWjpJRCnSIyk7buDvviMpWVTi9DHBkOkj73fHe3tBFVkwWIIiZ0TAkpyDZlUZfXS03m7ifp5LYSgToHb75HYqCD4K/q1Am3cgUlBvZAonxKgK+mQwIJflXMkFaDIHlUlVUpGA5yrpDSur0nNNWAnnBRU58l6KjAlmVj/gp4KV1DApTkhGufbiJpUSmsgsI6YAomQlUmIQmySotpKcLFmagyHUkJk0RpaPOGTGA9pzHG/2MB6XIvdwM7QV9T+R7qE8Sg4yQROoBsVTC1nCsMJToktnIpNDedMl6gQEWDtes+TrXaSs4lwnCkBsw0OVZ1TDFV2B2sbtoI9GY8FXgZPeSkMqzfA2ieRVOas0KVF8n2hJjkZE4mnPLuiC5c7or4HPtymggUNiD1yKlCXUSHVPQXRbDmp1jX5lzlC363rTOgluzHhuAfRJE1/2WcIs50ghcwUa1AJGii5R42GVZRbD3oWsvc8Kpgl+BEAK6H5JDP0KxBtNF9JokilZkmuLhMFshbWC7lnoJw3UR1826UMx6hxOnwjk1JUCsixYUmDQGwNKe3HrqVjvPZ+icM8XOZ4o53IGUQpzU0wwrV7mmG7aTEApXGBqWqWQa4EhmFJDtaxUAt2UPa80BuQId9+73Z4VUwtJN1Qd0TTttRi1LoiLZomfb5aH7fKoXf7WLo/b5eN2+aRdPm2Xz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3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

We need to be able to create billboard entities, delete billboard entities, and change terrain providers, without having rendering issues. We see this issue most often when we refresh the browser.

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

Sandcastle with Cesium 1.58. Issue has existed at least since 1.52. Chrome Version 75.0.3770.100 (Official Build) (64-bit). Windows 10.

Updated sandcastle with pixel offset

https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/#c=lVdtcxo3EP4rGr74GFOZs5s2JY6nwbiJ26RkbOJpGzIZcbccmuqkq6TDJhn+e1fSHdwBcRI+yLBvenb1aFdeMk2WHO5Bk+dEwj25BMPLnN55WXSU+J+XSlrGJeijHvk8lQQ/Gv4rwdgbkCnoNyqFAbG6hF7Q5uyB52UetBOew+WCyQxtruWcS25XlR2TPGeWKzkgcyZM7W7RQ+B+bWkGKsGNdFu6UDkMS2t3Y3A5V0P10BaaBCQ4tG958u9upHkphEk0gDwUz7uejcZSrFqpSrbkmc/hFYjioCcISJzBtUx5wqza2TfB6sKDHRfOxgzqCrvPPcwygRJSaDCglzDS7J7LbFjO5w6+w0HWva3DHsqgWk/luvtsKqcyHDb1djQTagY0hcIuJniYLzI8ZGMnoDV+QUK4AOi1RJKkzDKjSp1AmyiXpbEqH6H21msjt021SbqRGsrSNNrGqLBgXJA27uFy6pYzt/zolidu+cktP7vlqVt+cUvc96v3ib1T7L1i7xZ7v9g7xt4z9q6x9z31vqdhv9MqMYbJrjCn9x4J8VCIx0I8GOLREA+HeDzEAyIeEQmQSMC0PQf/CRBJwEgCSBJQkgCTBJwkACUBKQlQScDq/5x+8AWbl9ITiWA135TC8kLAkAsxU0ynJurW1LllMk2YscIdbiKYhuighzsGZx9WVw3BLNbih6d92n/WkMoMpWdPWkJlUFYL/P1RmkROw70C/5yH6lIBMrMLlBwfd5v09tr3/APaRxnYK2mxNUS1tEd4zwE6xmi0j5VAGJvvyhw/j/vdbmP/Lb0ouEi8ol0dr7Zdu1L6LJp3odXQPIvXrZIjvk3hXmpWLHgSKbNJx+U9ZwkXmME7LTCjI0pPsLtlYE5qBc34/KhVcw221LJZE+9CBs1gDV4tQVvsIWKsecaxz9TtuiWmk/Hbhs9Caf7JdfBdr1c7Cvr66rdJ0xF4tsCKYKsBmcDWry2nN1evX0yu764+TsYfX96M3/05agQp+AOI8XxuwA5ajYNpi9+YPI36PSxkwyXlhs0EjOq+NOLGMg/gSd9/qnM8dEYVh5AASB88ygdPIc8dR5rudn7tFT4dkGln2iHHleNWJVkOX1QWynC/+2AvtTM619gcIcOhYqItjriZbaFV4Y4PTKs+b4N4NWRZ9NndLSy6/ANWDsdff/+zhbJuBpvVFEU0X2Bsc1os1H1rTOxVNMXZZb+1x+wahy7fag1JaA3JXmtIdlrDocusIVdLGK6u6zudfKA8bVzrRi/7nqud+MdJNfaw7kvu7R7J9KDHTjdtIrBty/YIvRKCF0bxdBfB53Ud8lA1lkxgVhRLe8WSRVRnE3mDVbdRS3xgGIXohcoqLZYN6TPtDKadY1KJah5T5M2dix1V+H4vBXIZRzxQqe6jbpdadWs1PkOiTf9db6raqBY234lSYsb0G5Bl9L6C5B47SM+jF2lK8mombYlrjiqCImj/cHK9sM6tPT0OD8HGRGhgWWDLEq5tPT4J3UNp88atgYbHK6nfRfX5fDPQL/Dra0AfJdlBoCN/Acnw+2u5f8+/hu7QZa+B4ajt9Drnxq4EXATxrzwvlLak1CLCwWghL7Af4myclfgStzQxPsL5Se10nvIl9uTn087O/yDY+fASGoMa92K/5Z9g2rk4P0H7lptQLEWOjnFkCrZyJov44nUQUkrPT/DnvpcNhG1E/B8

I can see that the billboards seem to get rendered in a different order when the terrain provider changes, but then they are correctly ordered against after a second. So it’s like a flicker where they’re incorrect. Is that the same behavior you’re seeing as well? I’m looking at the pixel offset version.

Hey Omar,
No, I am seeing the billboards rendering in the wrong locations and staying there.

Here are two videos of the issue I am seeing in the sandcastles. One with and one without pixel offset.

In order to reproduce consistently, I did have to add additional steps.

  • Load sandcastle.

  • Zoom in so that the billboards fill the screen.

  • Select “Delete Billboards”

  • **Select “Change Terrain Provider” **

  • Select “Add multiple Billboards”

  • Select “Change Terrain Provider”

  • Verify that several billboards are rendered out of place.

Thanks for the additional information, I can reproduce this now. I opened a GitHub issue here:

https://github.com/AnalyticalGraphicsInc/cesium/issues/8006

I found a related issue, but it may or may not be the same underlying problem.