From cfa5094fadd855deaf73c39090dca1c7905c7873 Mon Sep 17 00:00:00 2001 From: Graham Wihlidal Date: Mon, 14 Jan 2019 00:14:25 +0100 Subject: [PATCH] Updated readme to include mesh encoder example --- README.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d81dce6..81427eb 100644 --- a/README.md +++ b/README.md @@ -34,12 +34,25 @@ extern crate meshopt; ## Example -Currently there is only a single monolithic `demo` example, which runs nearly the entire feature matrix. In the near future I will make a straight forward `tool` example that shows the minimal calls to perform mesh optimization in a typical game engine pipeline. In `demo`, the `opt_complete` routine is the approach to get 100% optimal GPU performance. Further CPU improvements can be chosen through the various packing and encoding routines. +### demo + +This is a single monolithic `demo` example, which runs nearly the entire feature matrix. In `demo`, the `opt_complete` routine is the approach to get 100% optimal GPU performance. Further CPU improvements can be chosen through the various packing and encoding routines. ```shell cargo run --release --example demo ``` +### encoder + +The `encoder` example shows the minimal calls to perform mesh optimization in a typical game engine pipeline, and serializes the mesh into a format that is compatible with the WebAssembly loader and THREE.js viewer experiment that exists in the `meshoptimizer` repository. + +* https://github.com/zeux/meshoptimizer/blob/master/tools/OptMeshLoader.js +* https://github.com/zeux/meshoptimizer/blob/master/demo/index.html + +```shell +cargo run --release --example encoder -- --input pirate.obj --output pirate.optmesh +``` + ## Pipeline When optimizing a mesh, you should typically feed it through a set of optimizations (the order is important!):