Skip to content

Conversation

javagl
Copy link
Contributor

@javagl javagl commented Aug 26, 2025

Description

The Request Render Mode is "spotty" with Entities. This is a bit vague, and there are many different flavors of "spotty". As shown in an example of a recent comment there, the meaning of that can be very specific (and unspecific at the same time), as in "It does not work".

The reason for this specific case is, very roughly: Under the hood, the entity causes the creation of several things, collections, batches, geometries, updaters, and a Primitive. This primitive is created with the default of asynchronous=true. This essentially means that the first requestRender call from the sandcastle is issued before the geometry is actually created. (The creation happens with a worker, namely the createGroundPolylineGeometry worker in this case). The primitive then goes through the ""well-known"" PrimitiveState state machine, and eventually, the GroundPolylinePrimitive becomes ready=true.

This is where the "fix" is hooking in: Setting the ready flag is done in a frameState.afterRender function. And when such an afterRender function returns true, it will trigger a re-rendering in 'request render mode'.

Of course, this fix is likely "too narrow", and only a "patch" for this particular case. There are other types of geometry and primitives, and whenever something is created with a web worker, this "thing" may suffer from the same issue: A client-side requestRender call may be issued before the worker is done, and the desired re-rendering of the (then ready) object does not happen. It may be necessary to more thoroughly review the places where geometry/primitives are created asynchronously, and where some afterRender.push(... return true; ) may have to be inserted.

Issue number and link

Related to #12543 , but certainly no holistic "fix" for that.

Testing plan

Run the sandcastle from this comment in the issue

Author checklist

  • I have submitted a Contributor License Agreement
  • I have added my name to CONTRIBUTORS.md
  • I have updated CHANGES.md with a short summary of my change
  • I have added or updated unit tests to ensure consistent code coverage
  • I have updated the inline documentation, and included code examples where relevant
  • I have performed a self-review of my code

Copy link

Thank you for the pull request, @javagl!

✅ We can confirm we have a CLA on file for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant