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

Feat/optimizations #10

Merged
merged 12 commits into from
Mar 27, 2024
Merged

Feat/optimizations #10

merged 12 commits into from
Mar 27, 2024

Conversation

piellardj
Copy link
Member

This PR contains various fixes and optimizations of the way the GPU memory is handled:

  • abort computation early for patches that contain no voxels
  • Terrain.showMapAroundPosition() is now more strict now, and only shows patches that will be visible for sure
  • Terrain now removes from GPU memory patches that have been invisible for a long time. As a reminder, a patch can become invisible if it was computed once and then went out of sight because the player moved. The size of this LRU cache is configurable with the new Terrain.patchesCacheSize attribute
  • Added a proper logging module. Its verbosity can be controlled with the exposed setVerbosity method.

Only compute patches that are sure to be within the visibility sphere
Don't even ask for patches that are out of bounds
This allows to free GPU memory when there are too any invisible patches. An invisible patch is a patch that was computed once and then went invisible because it is out of sight.
@piellardj piellardj requested a review from Sceat March 25, 2024 18:05
@piellardj piellardj self-assigned this Mar 25, 2024
src/lib/helpers/logger.ts Show resolved Hide resolved
@Sceat Sceat merged commit 68ac1a6 into master Mar 27, 2024
2 checks passed
@Sceat Sceat deleted the feat/optimizations branch March 27, 2024 16:07
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