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 "UnloadTilesPlugin" to save GPU memory #874

Merged
merged 19 commits into from
Dec 20, 2024
Merged

Add "UnloadTilesPlugin" to save GPU memory #874

merged 19 commits into from
Dec 20, 2024

Conversation

gkjohnson
Copy link
Contributor

@gkjohnson gkjohnson commented Dec 18, 2024

Fix #873
Fix #875

  • Add priority support to plugins
  • TilesCompression and BatchedMesh plugin will always run first
  • Prevent empty groups from being added for each tile when using BatchedMeshPlugin
  • Add "UnloadTilesPlugin"
  • Add support for "setTileActive" and "setTileVisible" plugin callbacks
  • Add names to some plugins that were missing them

TODO

  • Add "visibleTiles" and "activeTiles" to base tiles renderer class
  • Consider removing "setTileActive" callback
  • Expose byte counting function for plugin use

Upcoming PR

  • Make this work with fade tiles
    • Override the setTileVisible to only fire when the tile fades in and out for the first time
  • Add to demos, move to core plugins directory

@gkjohnson gkjohnson changed the title Add "UnloadTilesPlugin" to save memory Add "UnloadTilesPlugin" to save GPU memory Dec 18, 2024
@sguimmara
Copy link
Contributor

Would you consider adding some sort of configurable timer to unload the tiles after some time ? Often, a tile that has been hidden because the user quickly moved the camera can be re-displayed a few milliseconds/seconds after being hidden. It's useful that this tile can be displayed right away.

@gkjohnson
Copy link
Contributor Author

Would you consider adding some sort of configurable timer to unload the tiles after some time ?

It's a good idea - I'll make another issue for it and focus on getting the basics working in this PR. You could imagine other metrics, as well, such as only removing items from the GPU once a certain memory threshold is passed. Something like a smaller lru cache just for GPU memory.

@gkjohnson gkjohnson merged commit 837cca8 into master Dec 20, 2024
2 checks passed
@gkjohnson gkjohnson deleted the unload-plugin branch December 20, 2024 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants