Draco is a 3D model files compressing / decompressing library, especially for Web use.
Draco compression reduces over 90% of file size.
here is a compression result.
In this article, I will show how to compress with Draco compressor.
Visit Draco repositry and download entire repository.
In order to build Draco, you need to use CMake
download and extract dmg, then install CMake.app
Make a folder and run CMake with the folder. When you press “Generate” button, you will have a XCode project file.
You will see following log when CMake has been done.
and you should have several files in the folder.
draco.excodeproj in XCode.
then press build button.
after that, CLIs will be generated. In order to compress with Draco, we will use “draco_encoder”
open Terminal and exec draco_encoder. Encoder take 3 arguments. Path to input file, output file name and compression level
FYI: Draco can only take OBJ and PLY format so far.
-iis the path to input file.
-ois the name of the compressed file.
-clis the compression level. You can set a number from 0 to 10.
Here is a final example.
If you need another compressor for other formats such as three.js JSON, glTF, There is Zip compression. Zip reduce about 70%, because three.js JSON consist mostly of number.
Here is a zip encoder for JS.
Unzip JS library is available on NPM