Browse Source

MeshTools: test compile() with both flat and smooth normals requested.

And clarify the docs about what gets the priority.
mousecapture
Vladimír Vondruš 6 years ago
parent
commit
2a12ca14e3
  1. 4
      src/Magnum/MeshTools/Compile.h
  2. 1
      src/Magnum/MeshTools/Test/CompileGLTest.cpp

4
src/Magnum/MeshTools/Compile.h

@ -58,7 +58,9 @@ enum class CompileFlag: UnsignedByte {
* If the mesh is @ref MeshPrimitive::Triangles, generates normals using
* @ref MeshTools::generateFlatNormals(). If the mesh is not a triangle
* mesh or doesn't have 3D positions, this flag does nothing. If the mesh
* already has its own normals, these get replaced.
* already has its own normals, these get replaced. If
* @ref CompileFlag::GenerateSmoothNormals is specified together with this
* flag, this flag gets a priority.
*/
GenerateFlatNormals = 1 << 0,

1
src/Magnum/MeshTools/Test/CompileGLTest.cpp

@ -122,6 +122,7 @@ constexpr struct {
{"positions + normals + texcoords", Flag::Normals|Flag::TextureCoordinates2D},
{"positions + normals + texcoords + colors", Flag::Normals|Flag::TextureCoordinates2D|Flag::Colors},
{"positions + gen flat normals", Flag::GeneratedFlatNormals},
{"positions + gen both smooth and flat normals", Flag::GeneratedSmoothNormals|Flag::GeneratedFlatNormals},
{"positions + normals, gen flat normals", Flag::Normals|Flag::GeneratedFlatNormals},
{"positions + gen flat normals + colors", Flag::GeneratedFlatNormals|Flag::Colors},
{"positions + gen flat normals + texcoords", Flag::GeneratedFlatNormals|Flag::TextureCoordinates2D},

Loading…
Cancel
Save