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

Add asynchronous hint to entities #5127

Open
shunter opened this issue Mar 20, 2017 · 8 comments
Open

Add asynchronous hint to entities #5127

shunter opened this issue Mar 20, 2017 · 8 comments

Comments

@shunter
Copy link
Contributor

shunter commented Mar 20, 2017

This issue has been discussed many times, but I couldn't find an issue for it, so filing this for reference.

In many cases, using the entity layer to create geometry produces bad results, because all non-time varying geometry is created asynchronously, causing significant latency when updating due to the enormous overhead of the web workers.

Our current recommendation is to use CallbackProperty to work around this bug, (see related #4791) but this workaround has significant performance penalty - the callback is run every frame, and the updaters are built expecting the values to change every frame. For truly time-varying properties, this is desirable, but in many cases, the value doesn't vary with simulation time, but does change at unknown or unpredictable times - through user input perhaps, or via updates from a server. In these cases, the definitionChanged event approach used by ConstantProperty is the right approach for efficiency.

The real solution would be to provide a hint to declare that a particular graphics should always be created synchronously. Then the natural and obvious approach of simply assigning new values would work as expected.

@EKoetsjarjan
Copy link

Hi I'm new at cesium.

I'm using the ConstantProperty to update the value is set value is used.
how to do it using definitionChanged?

My updating works like this:

var trailwall =
{
wall : {
positions: [],
material : Cesium.Color.RED.withAlpha(0.5),
}
}
var trail = datasource.entities.add(trailwall);

// ... then inside a tick method

trail.wall.positions.setValue(newpositions(time))

@hpinkos
Copy link
Contributor

hpinkos commented Aug 10, 2018

@EKoetsjarjan I'm sorry, I don't understand your question. Please ask this question on the forum instead: https://groups.google.com/forum/?hl=en#!forum/cesium-dev

We use GitHub exclusively for tracking bugs and planning new features. A lot more people are on the forum, and your post might help someone else who has the same question. Members of our team also monitor the forum to make sure all questions get answered. Thanks!

@EKoetsjarjan
Copy link

ok thank you

@OmarShehata
Copy link
Contributor

I'd like to 👍 this, since it comes up so often, and even our own Sandcastle examples struggle with this. The drawing on terrain Sandcastle uses a CallbackProperty when drawing so it's smooth, but when switches to a static entity when done, which causes a very noticable flicker while the entity is being created asynchronously:

https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/?src=Drawing%20on%20Terrain.html

Being able to say "I'd like this entity to be created synchronously if possible" would fix this.

@ggetz
Copy link
Contributor

ggetz commented Jun 2, 2023

This came up in #11315 in regards to requestRenderMode. The user would like the ability to perform value updates, but would still like the ability to not have to render every frame and evaluate the callback.

@Fedec96
Copy link

Fedec96 commented Jul 5, 2024

Any updates on the matter? Really interested on this one.

@ggetz
Copy link
Contributor

ggetz commented Jul 8, 2024

@Fedec96 There hasn't been any activity on this recently.

If you'd like to add more information about your use case, that may help us prioritize. If you are interesting in contributing, please let us know and we'd be happy to discuss implementation or review a PR. Thanks!

@Fedec96
Copy link

Fedec96 commented Jul 8, 2024

@ggetz Hi Gabby, thanks for confirming. I'm not even sure the issue I'm having is related, so I'll post a separate issue which maybe can help others. :)

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

7 participants