Skip to content

Commit

Permalink
indexcodec: Bump default encoding version to 1
Browse files Browse the repository at this point in the history
indexcodec 0 is a legacy version that should not be preferred to 1 in
any way; applications that worked with glTF contents as well as
applications that required superior compression all had to set it to 1
manually.

We now bump the default encoding version to 1, which should be decodable
by any application that uses meshoptimizer 0.14 (released 3 years ago)
or later.

For applications that need compatibility of binary data here it should
be trivial to revert back to 0.

For now we keep explicitly setting the versions for data encoding for
gltfpack and JS mesh encoder; it's very unlikely that a newer version of
index codec will be introduced, but a newer version of vertex codec is
possible, so we'll keep pinning the version for glTF content for now.
  • Loading branch information
zeux committed Oct 13, 2023
1 parent e7580bf commit bb9f988
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions gltf/gltfpack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1200,6 +1200,7 @@ int main(int argc, char** argv)
setlocale(LC_ALL, "C"); // disable locale specific convention for number parsing/printing
#endif

meshopt_encodeVertexVersion(0);
meshopt_encodeIndexVersion(1);

Settings settings = defaults();
Expand Down
2 changes: 1 addition & 1 deletion src/indexcodec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace meshopt
const unsigned char kIndexHeader = 0xe0;
const unsigned char kSequenceHeader = 0xd0;

static int gEncodeIndexVersion = 0;
static int gEncodeIndexVersion = 1;

typedef unsigned int VertexFifo[16];
typedef unsigned int EdgeFifo[16][2];
Expand Down

0 comments on commit bb9f988

Please sign in to comment.