VoxelPlugin icon indicating copy to clipboard operation
VoxelPlugin copied to clipboard

Heightmap decompression blocks the game thread

Open blakeanator opened this issue 4 years ago • 0 comments

Decompression for heightmap assets happens at runtime and can block the main thread. If loading many large heightmap assets, the block can be a substantial amount of time (in our test case >30 seconds). The goal here is to be able to load/stream voxel worlds in without any hitches.

One obvious solution would be to do decompression on another thread. As simple as that.

Another would be to allow user to opt out of compression entirely on a heightmap asset so that no decompression has to happen in the first place. Note, this is not the same as z-lib "0" compression as this still compresses and decompresses the asset, which still blocks the main thread for substantial time. Would recommend that users that have a "0" setting for compression on the project settings actually skip CompressData() all together.

I have a local build that does the later of the two solutions (simply based on how straightforward it is to implement). Would love to see both solutions implemented in the voxel plugin :)

https://discord.com/channels/379297529235243020/432618591901450240/780624264855420948

blakeanator avatar Nov 26 '20 13:11 blakeanator