-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Support for animated billboards #2319
Comments
Another thought I've had is that it might be reasonable to make the private TextureAtlas use reference counting, so essentially when a billboard changes its image, it would release its ref to the previous location, which could allow that location in the atlas to be reused for new textures. |
Makes sense. We could also compact the atlas every so often if there are lots of unused textures. This way if someone is dynamically drawing with a canvas, it throws away old snapshots. |
Yes, although you get re-use for "free" without compacting if you release the old ref before adding the new one, because it will re-use that location immediately (assuming the same size, and that no other billboard in the collection has a ref to the old snapshot) |
Related forum discussion: https://groups.google.com/forum/#!topic/cesium-dev/JzpfPUvBdEA |
Support for dynamic billboards has been requested on the forum a number of times: https://groups.google.com/d/msg/cesium-dev/jFsmh7LOiTs/MCJfLJlEZZgJ |
Requested on the forum: https://groups.google.com/forum/#!topic/cesium-dev/ah039dU-4No |
I have an old implementation of this which uses animated gifs (but really as long as you have the frames it works). It's an Entity API-level solution, but that kind of makes the most sense anyway. I'll see if I can dig up the code and post it here, might be a good PR for someone else to finish up if I can't find the time. |
@mramato Do you have your gif implementation still? It was requested on the forum: https://groups.google.com/forum/#!topic/cesium-dev/Qd_LRhmlb50 |
it's the It's been a while, but I think you use it like this: var animator = BillboardAnimator.fromGif({url: url});
entity.billboard.image = animator.image;
entity.billboard.imageSubRegion = animator.imageSubRegion As you can tell, I never finished it so the usability is a little quirky, but it works really well. Here's a live demo http://mramato.github.io/Demos/AnimatedBillboards/index.html (the imagery doesn't load because ancient version of Cesium) |
Requested again: https://groups.google.com/d/msg/cesium-dev/XQoDWp02Ysk/JAM5fABtCQAJ |
Requested again: https://groups.google.com/d/msg/cesium-dev/j6EVJ2e_nzg/Sk6BWJ7ICwAJ |
We definitely have a need for this feature. I work on an app that is fed a CZML data source with real time data. We feed SVG Data URI to billboards to track objects. The data uri is generated using https://spatialillusions.com/milsymbol/ library. I should also clarify the data uri is generated by a nodejs service on the back end which is then kicked up to the front end in a CZML data stream. I can break cesium in as little as two minutes with a small set of our data. :( The edit forum thread on the OP describes our problem exactly. Finally, when we update the entity's billboard with a new data uri, we are left with an unpleasant flickering/flashing of the image when the new image is loaded. It would be very nice if there was a double buffering feature where the image appeared to "move" when updated and redrawn. |
I wrote the second Groups thread, 5 years ago. Still working on the same app, with the same workaround in place. This would be extremely beneficial to have. |
Animated billboards has come up numerous times on the mailing list, most recently here: https://groups.google.com/d/msg/cesium-dev/Qd_LRhmlb50/j-_rdsVUK4IJ I don't expect this to happen anytime soon, but since we didn't have an issue for it; I figured I'd create one.
Me and @shunter have some ideas on how to do this within the existing BillboardCollection architecture, it would basically involve an internal list of images/canvases/etc.. that need to be re-uploaded to the same spot in the text coordinates each frame. There's a chance that the ultimate answer is we need something other than a Billboard to do this, but it seems like a reasonable extension of the existing primitive.
EDIT: Better thread with use case: https://groups.google.com/d/msg/cesium-dev/cF9Vt28Wk-4/nJ68p3YONKcJ
The text was updated successfully, but these errors were encountered: