KhronosGroup / 3D-Formats-Guidelines

Guidelines for artists and developers using Khronos Group 3D formats.
Other
127 stars 18 forks source link

Choice of zstd compression levels #14

Open donmccurdy opened 3 years ago

donmccurdy commented 3 years ago

I was asked a good question by @looeee, on twitter:

https://twitter.com/lewy_blue/status/1384689633112432643

--zstd 18 applies supercompression. ... Values above 20 should be used with caution as they require more memory.

Does this mean more memory while compressing or at runtime?

The Artist Guidelines, glTF-Transform, and toktx all display similar wording here. We should probably be more specific about when that memory is required (on the client, while decompressing) and how much memory we're talking about. 134MB on a mobile device is a lot, but it isn't totally trivial to find that number from zstd's own documentation.

Working from https://news.ycombinator.com/item?id=13814475 and the zstd codebase, I'm planning to add this table to the glTF-Transform help output:

Screen Shot 2021-04-20 at 8 58 19 PM

(https://github.com/donmccurdy/glTF-Transform/commit/519641c85d0ee51282370f75922a97f6b579e6c9)

Does this look correct, and should we put similar messages elsewhere?

EricChadwick commented 1 year ago

This would be very helpful to add, in my opinion.

Does "requiring more memory to decompress" mean there's a memory spike during decompression but it's not a persistent memory cost during rendering? Or does this mean the decompressed texture requires that amount of memory once it has been decompressed?

lexaknyazev commented 1 year ago

A spike during decompression.