Skip to content

Conversation

@tobias74
Copy link
Contributor

Description
It seems that tiles-load-end fires as soon as the download queue is empty, which can happen before the scene is fully stable (e.g. before children are queued).

I introduced a tiles-settled event that waits for 2 consecutive frames of inactivity to ensure the renderer is truly done.

Use Case
I am using this in a headless worker for elevation raycasting. The standard tiles-load-end event was occasionally causing me to sample low-resolution tiles; this new event solved the issue.

@gkjohnson
Copy link
Contributor

Thanks! I think it would be best to fix up the tiles-load-end event, though, so we don't have these blips of "download complete" before starting again when there's no camera movement. Just waiting for a couple frames doesn't seem so robust. Do we know why this seems to be happening? Notionally it should be the case that there's always something "in progress" until the tiles are all loaded.

  1. Tiles are added to the download queue, including internal tileset json files (downloadQueue)
  2. Content downloads and tile is immediately moved to the parse queue (parseQueue)
  3. Tile is parsed and removed from the parse queue.
  4. Next call to "update" the children are added to the "processQueue" (processNodeQueue)
  5. Children are process and removed from the queue
  6. Next call to "update" the children are traversed and new tiles are added to the download queue if needed (go back to step 1)

@gkjohnson gkjohnson added this to the v0.4.19 milestone Dec 11, 2025
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.

2 participants