-
Hello, I am currently trying to use meshoptimizer library, however I am having trouble understanding how I should apply it. I am new to rendering and some of its concepts, so this might be the reason why I don't understand the problem I am facing now. What I am looking for is to load model, optimize it and export it as new optimized version. By optimization I mean optimizing its vertices and indices (Indexing - Vertex cache optimization - Overdraw optimization - Vertex fetch optimization). The problem is that after applying the optimization I get a model with the incorrect texture or with more vertices than the original number. I suppose similar issue was discussed here: #334. However, I couldn’t understand, what to do to in my case. I use assimp (https://github.com/assimp/assimp) to import a model, apply meshoptimizer methods to it and export the new optimized version. I applied mesh optimization to .obj and .fbx files, but both types of models had the same problem with incorrect texture. Can you please tell me where I am applying the optimization incorrectly and how to avoid distorting the model view? Code:
I will attach some results from the current program. Example models: https://drive.google.com/drive/folders/1dQMGRbREltF-UKADxeA9UZ1IBWXZ4QW9?usp=sharingFBX Container model optimization example (model with word optimization in the name was optimized with meshoptimizer, same rule will apply to all further examples): OBJ Chair model optimization example: FBX Sword model optimization example: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This code doesn't recompute or reorder any attributes like normals, so it would make sense to me that you're getting the wrong rendered output - this code is effectively merging vertices with the same positions but different attributes like normals as it doesn't pass anything but positions into There's two options here:
|
Beta Was this translation helpful? Give feedback.
This code doesn't recompute or reorder any attributes like normals, so it would make sense to me that you're getting the wrong rendered output - this code is effectively merging vertices with the same positions but different attributes like normals as it doesn't pass anything but positions into
meshopt_generateVertexRemap
, but the mesh in question still contains normal/UV data that is not reindexed correctly.There's two options here: