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 a 3D world texture implementation. #1639

Merged
merged 7 commits into from
Dec 23, 2023

Conversation

ThatRedox
Copy link
Member

Closes #1607.
image
2,115 chunks of my Terralith test world with the max heap set to 1 GB.

This is a 3D biome implementation that uses significantly less memory than TRIVIAL_3D. It is similar to WorldTexture2D where it only stores 8 bits per channel and deduplicates textures.

Testing with 1024 chunks of my Terralith test world:

Implementation Biome Texture Size (bytes) Loading Time (sec) Chunks loaded with 512mb heap
World Texture 3D (this) 61,735,768 56.772 942 / 1024
Trivial 3D 7,250,510,208 50.801 31 / 1024
World Texture 2D 345,600 2.898 1024 / 1024
Trivial 2D 28,434,816 2.816 1024 / 1024

Other changes:

  • Separated compact and endFinalization for BiomeStructure
  • Added dedicated Interner interface (and tests!) for deduplication
  • Refactored WorldTexture2D to share code with WorldTexture3D

@ThatRedox ThatRedox changed the title Add a 3D world texture implmentation. Add a 3D world texture implementation. Oct 1, 2023
@leMaik leMaik added performance Performance related problem hacktoberfest-accepted labels Oct 2, 2023
@leMaik leMaik merged commit fcf3c85 into chunky-dev:master Dec 23, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted performance Performance related problem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TRIVIAL_3D BiomeStructure implementation uses too much memory
2 participants