Cesium: Entity primitive continuously re-drawn when position is SampledProperty

Created on 25 May 2018  路  10Comments  路  Source: CesiumGS/cesium

Example in Sandcastle, based on the Interpolation demo.

Note that the debug frame counter shows continuous frames being drawn even though we're in requestRenderMode = true and the animation is paused. I found this because my app is rendering with a poor framerate in some cases, and I tracked it to a single rogue entity that has a SampledPositionProperty and an ellipsoid graphic. I dug in the debugger a little and figured out that for some reason, the associated primitive collection is being updated just about every frame, which didn't make sense to me as I wasn't modifying anything.

This doesn't happen in 3D scene mode, and it also doesn't happen with other 2D primitives (billboard, label, etc). I haven't tried with other solids but I'd be surprised if the issue was limited to ellipsoid.

category - 2d / columbus view category - entity type - bug

All 10 comments

Hmm, that's very weird. Thanks for reporting this @thw0rted!

@ggetz any ideas here?

Looks like setReady is being called by the primitive every frame in 2D mode, but not 3D mode. (This add a function that triggers after the frame is rendered, which signals another frame to be rendered in requestRenderMode).

I assume this is a trivial fix, but @bagnell can you confirm that there's no reason we should be calling setReady every frame?

This might be related, trying to get the Clipping Planes Sandcastle working with requestRenderMode doesn't really work because the entity has a PlaneGraphics with a Plane which is a CallbackProperty, which forces it to re-render every frame.

Is this expected that CallbackProperties essentially break requestRenderMode (even if they're not returning different values?) If so, I think this could be worked around by not using a CallbackProperty and manually updating the property's value. @ggetz

Original forum post.

@OmarShehata this is how entities are designed to work when they're dynamic. The Entity API is really good at drawing things that are static, and things that are constantly changing, but it unfortunately doesn't handle updating things that change intermittently in the best way because it will always update every frame if any of the properties are not constant.

I haven't looked at this since it was first filed. The last response before Omar's was Matt asking if the diagnosis was correct. Has the issue been fixed in the meantime? If not, can it get some attention?

I understand that this is by design and it works in most cases. I do feel like for this situation it would be nice if as an application developer I could do something like entity.markDirty() or someway to force to update only when needed, since in requestRenderMode you're also responsible for calling the scene.requestRender when needed.

Right now to get the Sandcastle to work I had to clone the Entity's position and re-set it to force it to update, but even then it doesn't trigger an update in the same frame.

The last response before Omar's was Matt asking if the diagnosis was correct. Has the issue been fixed in the meantime? If not, can it get some attention?

Just to bump that question, @bagnell do you know if calling setReady on the Primitive every frame is intentional? https://github.com/AnalyticalGraphicsInc/cesium/issues/6631#issuecomment-392858303

I have seen in the @thw0rted that this behavior doesn't happen in 3D scene, but in the example provided in #7943 the requestRenderMode is not working in the 3D scene when a CallbackProperty is used to update the entity vertices

Example on v1.59

Why the Callback function is not only called when the scene.requestRender is called?

I see this has been dormant for awhile.

Perhaps it would possible to switch to the isConstant flag dynamically based on the currentTime.
Basically if the clock has changed time you can trigger the callback event by comparison of the timestamps.
Maybe this sounds hacky.
Is there no way to prevent scene rendering when time is paused and using a callbackProperty or sampledProperty on an entity?

My team recently encountered this issue when using request render mode with entities whose position is a sampledPositionProperty. The goal of request render mode for us is to reduce the computer resources required when the clock is paused. However, this issue seems to cause the screen to continually update.

Has any progress been made towards this?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

OmarShehata picture OmarShehata  路  4Comments

nikakhov picture nikakhov  路  4Comments

worlddai picture worlddai  路  3Comments

OmarShehata picture OmarShehata  路  4Comments

OmarShehata picture OmarShehata  路  4Comments