Jump to content

Analysis of Google Draco


Josh

4,232 views

 Share

Google Draco is a library that aims to do for mesh data what MP3 and OGG did for music. It does not reduce memory usage once a mesh is loaded, but it could reduce file sizes and improve download times. Although mesh data does not tend to use much disk space, I am always interested in optimization. Furthermore, some of the NASA models I work with are very high-poly, and do take up significant disk space. Google offers a very compelling chart showing a compression ratio of about 95%:

Draco1.png.a6d0f5ba2c4104a8febbe8f3283d8dcf.png

However, there is not much information given about the original mesh. Is it an ASCII .obj file? Of course that would be much bigger than binary data. I wanted to get a clear look at what kind of compression ratios I could expect, within the context of glTF files. I found a farily high-poly model on SketchFab here to work with.

Image1.thumb.jpg.ffa6cc7894911bbb2d259e615f9dd9a1.jpg

This model has 2.1 million triangles and 1 million vertices. That should be plenty to test with.

Now, glTF is actually three different file formats. Normal glTF files store JSON data and come with an extra .bin file for binary data. This stores things like vertex positions and animation data, stuff you probably won't want to edit by hand. The .glb version of the format combines JSON and binary data into a single file, which can be viewed but not edited in a text editing program. Finally, there is also base64 glTF, which stores JSON together with binary data with base64 encoding in a single file. The base64 data looks like gibberish, but the file can be opened in a text editor, modified, and resaved without destroying the binary data.

I was very curious to see what advantage Google Draco mesh compression would offer. Would it make glTF files significantly smaller, so that your games take up less space and have faster download times?

To answer this question, I imported the model into Blender and exported several versions. I only exported position, normal, and texture coordinates. I also loaded the uncompressed .glb file in Ultra Engine and resaved it with simple mesh quantization.

draco.thumb.png.80d96d7fbe2dfce0340854013dc8adc2.png

As you can see, mesh quantization (using one byte for each normal component, plus one byte for padding, and two bytes for each texture coordinate component) combined with regular old ZIP compression comes in significantly smaller than Draco compression at the maximum compression level. It's not in the chart, but I also tried ZIP compression the smallest Draco file, and that was still bigger at 28.8 MB.

You can look at the models yourself here:

dracotest.zip

Based on this test, it appears that Google Draco is only marginally smaller than an uncompressed quantitized mesh, and still slightly bigger when ZIP compression are applied to both. Unless someone can show me otherwise, it does not appear that Google Draco mesh compression offers the 95% reduction in file sizes they seem to promise.

Correction:

This model was made up of several sub-objects. I collapsed the model and resaved it, and Draco now produces compression more like I was expecting to see:

collapsed-draco.zip

Presumably this means whatever data structure they use takes up a certain amount of space (probably an n-dimensional tree), and having fewer of these structures is more optimal.

Here is the corrected comparison chart. This is good. Draco shrank this model to 7% the size of the uncompressed .glb export:

Image1.thumb.png.78b0b0d9285105b315ade3a5e79810bc.png

This will be very useful for 3D scans and CAD models, as long as they don't contain a lot of articulated subobjects. Original model is on the left, Draco compressed model is on the right:

comp.thumb.png.608c82336232ffeb9bf1a0f1fc784234.png

  • Like 1
 Share

7 Comments


Recommended Comments

If I use shorts for the position components, the quantitized mesh is 20 MB zipped, 40 uncompressed.

I have a technique in mind that I think would get the same mesh down to 6 MB without ZIP compression.

Link to comment

Draco support has been added to the glTF save routine. Here how you use it with any model:

model->Save("mymodel.glb", SAVE_GLTF_DRACO_MESH_COMPRESSION);

 

Link to comment

Even with a relatively smaller model, the train station from the Zone, the mesh data went from 2.5 MB down to 230 KB. It's very good.

  • Like 1
  • Upvote 1
Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...