Skip to content

Commit

Permalink
[mesh] enabled slightly more agressive mesh simplification (small err…
Browse files Browse the repository at this point in the history
…or tolerance so it doesn't happen if the mesh will get mangled)
  • Loading branch information
PanosK92 committed Jan 9, 2025
1 parent 2bb9f6e commit fb89513
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions runtime/Rendering/Mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ namespace Spartan
meshopt_optimizeVertexFetch(vertices.data(), indices.data(), index_count, vertices.data(), vertex_count, sizeof(RHI_Vertex_PosTexNorTan));

// optimization #4: create a simplified version of the model
float threshold = 1.0f;
float target_error = 0.0f;
float threshold = 0.8f;
float target_error = 0.05f;
size_t target_index_count = (size_t)(index_count * threshold);
vector<unsigned int> indices_simplified(indices.size());
size_t OptIndexCount = meshopt_simplify(indices_simplified.data(), indices.data(), index_count,
&vertices[0].pos[0], vertex_count, sizeof(RHI_Vertex_PosTexNorTan), target_index_count, target_error);

indices = indices_simplified;
indices = indices_simplified;
}
}

Expand Down

0 comments on commit fb89513

Please sign in to comment.