zeux/meshoptimizer

Example and Further Documentation for Compression of Point Clouds

kitaedesigns opened this issue · 3 comments

It would be great to have an example for the compression of point clouds, especially programmatically in three.js. Do point clouds stay as PLY files? Or are they converted to another file type? Also I know in Blender when you import with PLY you can export as a GLTF with Loose Vertices turned on and this is very efficient in file size. Does meshopt convert the PLY to GLTF as well?

glTFPack can take in a standard glTF file, containing point primitives, and then output a glTF or gib containing compressed point primitives.
This effectively gives you MeshOpt compressed point-clouds.

some details here: https://github.com/wallabyway/minimal-pointcloud-gltf

zeux commented

Yup, maybe to expand on this:

  • meshoptimizer-the-library provides a few different algorithms that, when put together, allow to optimize point cloud transmission and storage
  • gltfpack can process .gltf files with these algorithms
  • gltfpack does not support PLY files as an input; I looked into this briefly a couple years ago and the conclusion was that the format is fairly niche, there are not that many solid existing libraries to parse it, and overall this would not be too important

https://github.com/zeux/meshoptimizer#point-cloud-compression section specifically (which maybe this is talking about?) is documenting the algorithms that already exist in meshoptimizer and already used by gltfpack. Looks like this is not documenting meshopt_simplifyPoints (which is also used by gltfpack), so I'll fix this.

These algorithms are currently not exposed to JS, so if a JS program gets its input as a point cloud, JS meshoptimizer modules can't be used to optimize it. I'm not sure if this is what the question is, as if you use glTF files already then this isn't relevant.

zeux commented

Updated gltfpack README 82888a1 to mention point cloud processing more explicitly and updated gltfpack's command line help to make it clearer that -si also applies to point clouds. I don't want to document meshopt_simplifyPoints for now as it's experimental and fairly likely to change the interface to support colors, as well as the implementation to use a different algorithm in the future.