Yunus Yurtturk
Yunus Yurtturk

Reputation: 529

Meshoptimizer simplfy makes winding order reversed, how to fix it?

I use meshoptimizer C++ library to simplify a mesh, which is to be used as a terrain. If optimization is aggressive, some triangle orders reversed, making torn effect in my mesh.

enter image description here

My simplify optimization code is like below, it is almost standart for meshopt library:

lod.resize(meshopt_simplify(&lod[0],
srcMesh.indices.data(),
srcMesh.indices.size(),
glm::value_ptr(srcMesh.positionRTCs[0]),
srcMesh.positionRTCs.size(),
sizeof(glm::vec3),
targetIndexCount, targetError));

So is there an option, flag, way, etc. to mitigate from this problem? If not possible, what do you suggest to fix this problem?

Upvotes: 0

Views: 9

Answers (0)

Related Questions