Skip to content

Commit

Permalink
starting to use new vertex-reorder feature introduced in mesh_optimiz…
Browse files Browse the repository at this point in the history
…er (#62)
  • Loading branch information
crocdialer committed Jun 1, 2024
1 parent 21daa8f commit 376b515
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/Mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -585,10 +585,15 @@ mesh_buffer_bundle_t create_mesh_buffers(const std::vector<Mesh::entry_create_in

ret.meshlets.reserve(ret.meshlets.size() + meshlet_count);

// generate bounds, combine data in our API output-meshlets
// reorder for locality, generate bounds, combine data in our API output-meshlets
for(uint32_t mi = 0; mi < meshlet_count; ++mi)
{
const auto &m = meshlets[mi];

// optimize internal meshlet vertex-ordering for locality
meshopt_optimizeMeshlet(&meshlet_vertices[m.vertex_offset], &meshlet_triangles[m.triangle_offset],
m.triangle_count, m.vertex_count);

auto bounds = meshopt_computeMeshletBounds(
&meshlet_vertices[m.vertex_offset], &meshlet_triangles[m.triangle_offset], m.triangle_count,
reinterpret_cast<const float *>(vertices), geom->positions.size(), ret.vertex_stride);
Expand Down
2 changes: 1 addition & 1 deletion submodules/meshoptimizer
Submodule meshoptimizer updated 54 files
+1 −1 .github/ISSUE_TEMPLATE/bug_report.md
+1 −1 .github/ISSUE_TEMPLATE/feature_request.md
+25 −38 .github/workflows/build.yml
+6 −1 .github/workflows/cifuzz.yml
+11 −11 .github/workflows/release.yml
+11 −3 .gitignore
+6 −1 CMakeLists.txt
+1 −1 LICENSE.md
+20 −4 Makefile
+11 −4 README.md
+49 −0 USERS.md
+9 −2 demo/main.cpp
+46 −8 demo/simplify.html
+51 −1 demo/tests.cpp
+192 −192 extern/cgltf.h
+6 −0 extern/fast_obj.h
+4 −0 gltf/README.md
+1 −1 gltf/animation.cpp
+4 −2 gltf/basisenc.cpp
+224 −0 gltf/fuzz.dict
+ gltf/fuzz.glb
+98 −39 gltf/gltfpack.cpp
+13 −6 gltf/gltfpack.h
+76 −12 gltf/image.cpp
+46 −5 gltf/material.cpp
+25 −19 gltf/mesh.cpp
+1 −1 gltf/package.json
+180 −29 gltf/parsegltf.cpp
+10 −3 gltf/parseobj.cpp
+61 −89 gltf/stream.cpp
+74 −57 gltf/write.cpp
+8 −0 js/README.md
+38 −0 js/benchmark.js
+20 −13 js/meshopt_decoder.js
+1 −1 js/meshopt_decoder.module.d.ts
+20 −14 js/meshopt_decoder.module.js
+1 −1 js/meshopt_decoder_reference.js
+28 −8 js/meshopt_encoder.js
+2 −1 js/meshopt_encoder.module.d.ts
+28 −9 js/meshopt_encoder.module.js
+16 −0 js/meshopt_encoder.test.js
+61 −13 js/meshopt_simplifier.js
+10 −4 js/meshopt_simplifier.module.d.ts
+61 −14 js/meshopt_simplifier.module.js
+30 −1 js/meshopt_simplifier.test.js
+1 −1 js/package.json
+90 −0 src/clusterizer.cpp
+1 −1 src/indexgenerator.cpp
+72 −57 src/meshoptimizer.h
+1 −2 src/overdrawanalyzer.cpp
+9 −3 src/quantization.cpp
+20 −15 src/simplifier.cpp
+4 −9 src/vcacheoptimizer.cpp
+10 −10 src/vertexcodec.cpp

0 comments on commit 376b515

Please sign in to comment.