-
Notifications
You must be signed in to change notification settings - Fork 500
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
vertexfilter: Implement a floating-point exponent filter
In some cases we can't quantize the floating point data because the range of the data is unknown. While it's possible to use meshopt_quantizeFloat to reduce the precision and gain some compression back, this is often insufficient and suboptimal. For inputs that represent a vector in 3D space, such as a position or scale, a good alternative is to use a shared-exponent encoding - it's a reasonable assumption that we are content with the same (absolute) precision in all three components. To be able to encode in shared exp, we use a modified floating point like format, where we store a 24-bit signed integer mantissa (without implicit 1) and a 8-bit exponent. This is less precise than a floating point number - we lose 1 bit - but we gain an ability to individually select the exponent and mantissa at any level of desired mantissa precision. Additionally this moves exponent into a single byte, and stores the mantissa as a two-complement integer - both of these are much friendlier for vertex codec than a basic float encoding. While ideally the shared exponent would be stored just once, this complicates the SIMD decoding and is actually redundant if the output of the filter is compressed with vertex encoder *and* a general purpose LZ, because the stream of exponent bytes will be exactly the same between all three components. The resulting decoder runs at ~13 GB/s using WASM SIMD and ~2.5 GB/s using scalar WASM.
- Loading branch information
Showing
7 changed files
with
118 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters