|
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? |
Answered by
mosra
Jul 28, 2022
Replies: 2 comments
|
change the compile flag to MeshTools::CompileFlag::GenerateSmoothNormals could work , sorry to disturb... |
0 replies
|
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. |
0 replies
Answer selected by
mosra
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.