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

Consider "kicking" only when the current tile is renderable #1033

Closed
kring opened this issue Dec 9, 2024 · 1 comment · Fixed by #1042
Closed

Consider "kicking" only when the current tile is renderable #1033

kring opened this issue Dec 9, 2024 · 1 comment · Fixed by #1042
Labels
enhancement New feature or request

Comments

@kring
Copy link
Member

kring commented Dec 9, 2024

After working on #1028 (and its fix in #1032), it occurred to me that the kicking mechanism might be more aggressive than it needs to be, and so it is sometimes preventing tiles from appearing as soon as they could.

The purpose of kicking is to allow arbitrary level skipping while also avoiding unnecessary holes while loading is in progress. Fundamentally, when we detect that a) some of a tile's selected children / descendants aren't done loading yet, and b) none of them were rendered last frame, we can throw them all out of the render list and render the current tile instead.

However, what if the current tile also isn't renderable? We don't currently check that when choosing to kick. Which means one of the following will eventually happen:

  1. This tile will get kicked, too, in favor of some other ancestor tile. Hopefully that one is renderable! Or,
  2. This tile will be a hole. And it will continue to be a hole until all of its originally-selected descendants finish loading.

Case (1) is fine, or at least the best we can do. Case (2) is really not great. If we're going to have a hole, it would be better to have more smaller holes that visibly fill in, rather than one big hole that sticks around for a long time.

So I think that we can make our loading better by only doing a "kick" when the current tile is actually renderable. This shouldn't affect case (1) because a renderable ancestor can do the kick even if the current (unrenderable) tile doesn't. And in case (2) the hole would be smaller and fill in more incrementally over time.

This is a pretty simple change, but we need to try it out and make sure it actually makes things better.

An alternate idea is to keep kicking as we currently do, but detect the case (2) hole and load the missing tile with highest priority, rather than waiting for all the more detailed tiles for that space to load. In other words, make it a feature of the algorithm that it eliminates holes as quickly as it can. This is likely to be trickier to implement than the above, but may give better results.

@kring kring added the enhancement New feature or request label Dec 9, 2024
@kring kring changed the title Consider only "kicking" when the current tile is renderable Consider "kicking" only when the current tile is renderable Dec 9, 2024
@kring
Copy link
Member Author

kring commented Dec 13, 2024

A quick proof of concept looks like it's working how I expected. On the left is the original, on the right I've changed the kicking criteria to require that the kicked-to tile be renderable (unless the loadingDescendantLimit is exceeded):
better-kicking

The right looks like an improvement to me. It doesn't load faster overall or anything, but there's more detail initially and the rest comes in more incrementally. The original on the left loads in bigger chunks.

Both are artifically slowed down by setting "Maximum Simultaneous Tile Loads" to 1.

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

Successfully merging a pull request may close this issue.

1 participant