Commit 9be8cf60 authored by Joseph Mirabel's avatar Joseph Mirabel
Browse files

[Assimp] Change assimp postprocessing steps.

parent e7d6ddc8
......@@ -131,26 +131,31 @@ inline void loadPolyhedronFromResource (const std::string & resource_path,
const boost::shared_ptr < BVHModel<BoundingVolume> > & polyhedron) throw (std::invalid_argument)
{
Assimp::Importer importer;
// // set list of ignored parameters (parameters used for rendering)
// importer.SetPropertyInteger(AI_CONFIG_PP_RVC_FLAGS,
// aiComponent_TANGENTS_AND_BITANGENTS|
// aiComponent_COLORS |
// aiComponent_BONEWEIGHTS |
// aiComponent_ANIMATIONS |
// aiComponent_LIGHTS |
// aiComponent_CAMERAS|
// aiComponent_TEXTURES |
// aiComponent_TEXCOORDS |
// aiComponent_MATERIALS |
// aiComponent_NORMALS
// );
// set list of ignored parameters (parameters used for rendering)
importer.SetPropertyInteger(AI_CONFIG_PP_RVC_FLAGS,
aiComponent_TANGENTS_AND_BITANGENTS|
aiComponent_COLORS |
aiComponent_BONEWEIGHTS |
aiComponent_ANIMATIONS |
aiComponent_LIGHTS |
aiComponent_CAMERAS|
aiComponent_TEXTURES |
aiComponent_TEXCOORDS |
aiComponent_MATERIALS |
aiComponent_NORMALS
);
const aiScene* scene = importer.ReadFile(resource_path.c_str(), aiProcess_SortByPType| aiProcess_GenNormals|
aiProcess_Triangulate|aiProcess_GenUVCoords|
aiProcess_FlipUVs);
// const aiScene* scene = importer.ReadFile(resource_path, aiProcess_SortByPType|
// aiProcess_Triangulate | aiProcess_RemoveComponent |
// aiProcess_JoinIdenticalVertices);
const aiScene* scene = importer.ReadFile(resource_path.c_str(),
aiProcess_SortByPType |
aiProcess_Triangulate |
aiProcess_RemoveComponent |
aiProcess_ImproveCacheLocality |
// TODO: I (Joseph Mirabel) have no idea whether degenerated triangles are
// properly handled. Enabling aiProcess_FindDegenerates would throw an
// exception when that happens. Is it too conservative ?
// aiProcess_FindDegenerates |
aiProcess_JoinIdenticalVertices
);
if (!scene)
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment