zeux / meshoptimizer

Mesh optimization library that makes meshes smaller and faster to render
MIT License
5.54k stars 476 forks source link

Fast Integer Compression #600

Closed CITIZENDOT closed 11 months ago

CITIZENDOT commented 1 year ago

Currently meshopt is doing a great job in compressing GLBs (especially with animations). I noticed this in the README:

Compression ratios depend on the data; vertex data compression ratio is typically around 2-4x

I came across this tool: TurboPFor-Integer-Compression and the goals of it are similar to what meshopt wants. Good compression ratio (7x), Extremely fast decompression speed. Is it possible to add this compression mechanism to attribute buffers?

zeux commented 1 year ago

PFor-like approaches were evaluated when the attribute compression was initially designed, but the target was mostly quantized data. Do you have some specific data set in mind?

In general it's unlikely that attribute compression scheme will be extended in ways that change the approach significantly; additionally for any update in general we'd need to publish a new glTF extension for it to be usable in the ecosystem, as the existing glTF extension only supports version 0 (the only version at this time) for attribute encoding. So any change in compression would need to solve a significant need that the current algorithm doesn't solve adequately.

zeux commented 11 months ago

Closing this since I don't think this is actionable; the linked repository is also GPL2 so I'm not going to look at that code to avoid license contamination.