Commit a3976e6b authored by Romain Pacanowski's avatar Romain Pacanowski

WIP. to debug heavy mesh

parent 6bd3d3f6
......@@ -44,13 +44,18 @@ Viewer::Viewer(std::string const &full_path_to_mesh)
if( _normals.size() != _vertices.size() )
{
mrf::geom::_Mesh<mrf::math::Vec3f>::computeNormals(_vertices, _index_faces, _normals );
}
mrf::geom::_Mesh<mrf::math::Vec3f>::computeTangents(_vertices, _normals, _tangents);
std::cout << " sizeof(mrf::math::Vec3f) = " << sizeof(mrf::math::Vec3f) << std::endl;
long unsigned int const mesh_memory_size_in_MB = ( (_vertices.size()+_normals.size()+_tangents.size())*sizeof(mrf::math::Vec3f) ) / 1024.0 / 1024.0;
std::cout << " CPU Required Memory for Mesh is " << mesh_memory_size_in_MB << " MB " << std::endl;
std::cout << _index_faces[0] << " " << _index_faces[1] << " " << _index_faces[2] << std::endl;
//Construct the linear VBO in CPU MEMORY
for (unsigned int i = 0; i < _vertices.size(); i++)
{
......@@ -58,14 +63,13 @@ Viewer::Viewer(std::string const &full_path_to_mesh)
_vboCPU.push_back( _normals[i] );
_vboCPU.push_back(_tangents[i]);
if( i ==0 )
{
std::cout << " VBO CPU at 0 = " << _vboCPU[0] << " Normals = " << _vboCPU[1] << " Tangents " << _vboCPU[2]
<< _vboCPU[3] << " " << _vboCPU[4] << " " << _vboCPU[5] << std::endl;
std::cout << " Vertices[0] = " << _vertices[0] << " Normals[0] = " << _normals[0] << " Tangents[0]=" << _tangents[0] << std::endl;
}
// std::cout << " i = " << i << std::endl;
// if( i ==0 )
// {
// std::cout << " VBO CPU at 0 = " << _vboCPU[0] << " Normals = " << _vboCPU[1] << " Tangents " << _vboCPU[2]
// << _vboCPU[3] << " " << _vboCPU[4] << " " << _vboCPU[5] << std::endl;
// std::cout << " Vertices[0] = " << _vertices[0] << " Normals[0] = " << _normals[0] << " Tangents[0]=" << _tangents[0] << std::endl;
// }
if (_color_per_vertex.size() == _vertices.size() )
{
......@@ -97,7 +101,8 @@ Viewer::Viewer(std::string const &full_path_to_mesh)
}
catch (const std::exception &e)
{
std::cerr << " Problem while loading PLY file. Aborting" << e.what()<< std::endl;
std::cerr << " Problem while loading PLY file. Should crash sooon. Exception raised = " << e.what()<< std::endl;
throw std::runtime_error(" PLY FILE COULD NOT BE LOADED");
}
//Clean the data that do not go on GPU
......
Markdown is supported
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