Skip to content

Instantly share code, notes, and snippets.

@zeux
Last active May 23, 2019 16:45
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zeux/b48678a44944187c16f55ad6cca45e78 to your computer and use it in GitHub Desktop.
Save zeux/b48678a44944187c16f55ad6cca45e78 to your computer and use it in GitHub Desktop.
Comparison of vertexcodec/indexcodec from meshoptimizer with Google Draco
Using fixed-point encoding for position (14 bits per component) and texture coordinates (12 bits per component), with 32-bit index buffer
and this vertex format:
// 12 bytes
struct PackedVertexOct
{
unsigned short px, py, pz;
unsigned char nu, nv; // octahedron encoded normal, aliases .pw
unsigned short tx, ty;
};
I get the following results vs Draco with default encoding settings on Core i7-8650U @ 2 GHz (turbo 4 GHz):
# data/nyra.obj: 18009 vertices, 27892 triangles
baseline : size: 550812 bytes
zstd only : size: 256047 bytes; decoding time: 0.74 msec
codec : size: 178248 bytes; decoding time: 0.19 msec
codec+zstd : size: 150811 bytes; decoding time: 0.45 msec
draco : size: 99085 bytes; decoding time: 19 msec
# data/sponza.obj: 184406 vertices, 262267 triangles
baseline : size: 5360076 bytes
zstd only : size: 1671727 bytes; decoding time: 5.76 msec
codec : size: 1417832 bytes; decoding time: 1.92 msec
codec+zstd : size: 645393 bytes; decoding time: 3.71 msec
draco : size: 698602 bytes; decoding time: 169 msec
# data/buddha.obj: 549409 vertices, 1087474 triangles
baseline : size: 19642596 bytes
zstd only : size: 6542891 bytes; decoding time: 23.96 msec
codec : size: 4132930 bytes; decoding time: 7.94 msec
codec+zstd : size: 2990709 bytes; decoding time: 14.11 msec
draco : size: 1861932 bytes; decoding time: 401 msec
# data/village.obj: 312415 vertices, 153736 triangles
baseline : size: 5593812 bytes
zstd only : size: 1982963 bytes; decoding time: 3.31 msec
codec : size: 2187247 bytes; decoding time: 2.33 msec
codec+zstd : size: 755095 bytes; decoding time: 4.86 msec
draco : size: 916276 bytes; decoding time: 151 msec
# data/bistro_interior.obj: 777816 vertices, 1020905 triangles
baseline : size: 21584652 bytes
zstd only : size: 6802774 bytes; decoding time: 21.96 msec
codec : size: 4636840 bytes; decoding time: 7.05 msec
codec+zstd : size: 2162007 bytes; decoding time: 12.79 msec
draco : size: 2916167 bytes; decoding time: 782 msec
# data/mustang.obj: 701977 vertices, 1018646 triangles
baseline : size: 20647476 bytes
zstd only : size: 6893815 bytes; decoding time: 21.97 msec
codec : size: 4310404 bytes; decoding time: 7.98 msec
codec+zstd : size: 2331132 bytes; decoding time: 12.99 msec
draco : size: 2315021 bytes; decoding time: 556 msec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment