-
I have imported a triangulated mesh using magnum scene importer, but it was shaded flat when rendering. if there is any api to solve this problem? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
change the compile flag to MeshTools::CompileFlag::GenerateSmoothNormals could work , sorry to disturb... |
Beta Was this translation helpful? Give feedback.
-
Yup, that's the flag :) To answer fully -- smooth normal generation relies on the index buffer, so if the mesh is not indexed, you'll still get flat normals. To fix that, perform MeshTools::removeDuplicates() first, which will generate the index buffer. |
Beta Was this translation helpful? Give feedback.
Yup, that's the flag :)
To answer fully -- smooth normal generation relies on the index buffer, so if the mesh is not indexed, you'll still get flat normals. To fix that, perform MeshTools::removeDuplicates() first, which will generate the index buffer.