Jump to content

  • Log In with Google      Sign In   
  • Create Account

#Actualic0de

Posted 10 July 2013 - 05:47 PM

I use assimp to load mesh data for my game and I was recently doing some optimization work on my rendering engine and I figured I should check to see how many vertices were actually being loaded. As it turns out I'm actually using more data indexing the meshes than I save by using indexed buffers. Here is my code:
 

#define IMPORT_OPTIONS	aiProcess_RemoveComponent|\
			aiProcess_OptimizeGraph|\
			aiProcess_JoinIdenticalVertices|\
			aiProcess_OptimizeMeshes|\
			aiProcess_Triangulate|\
			aiProcess_FlipUVs|\
			aiProcess_CalcTangentSpace|\
			aiProcess_SortByPType|\
			aiProcess_ImproveCacheLocality 


Assimp::Importer importer;

const aiScene* scene = importer.ReadFile(fname, IMPORT_OPTIONS);

numTriangles = scene->mMeshes[0]->mNumFaces;

numVertices = scene->mMeshes[0]->mNumVertices;
numIndices = numTriangles * 3;

It seems that somehow numVertices and numIndices are almost the same give or take 100 vertices. For example I had 34907440 vertices and 34907512 indices. Any closed mesh should have three times as many Indices as vertices because a vertex should be shared by at least 3 triangles. I'm guessing that Assimp is doing something quite sinister behind the scenes and isn't merging vertices properly even though I specified aiProcess_JoinIdenticalVerticesEverthing is rendering properly but I feel this might be eating away my performance. Does anyone have any Idea what might be going on? 


#2ic0de

Posted 10 July 2013 - 02:04 PM

I use assimp to load mesh data for my game and I was recently doing some optimization work on my rendering engine and I figured I should check to see how many vertices were actually being loaded. As it turns out I'm actually using more data indexing the meshes than I save by using indexed buffers. Here is my code:
 

#define IMPORT_OPTIONS	aiProcess_RemoveComponent|\
			aiProcess_OptimizeGraph|\
			aiProcess_JoinIdenticalVertices|\
			aiProcess_OptimizeMeshes|\
			aiProcess_Triangulate|\
			aiProcess_FlipUVs|\
			aiProcess_CalcTangentSpace|\
			aiProcess_SortByPType|\
			aiProcess_ImproveCacheLocality 


Assimp::Importer importer;

const aiScene* scene = importer.ReadFile(fname, IMPORT_OPTIONS);

numTriangles = scene->mMeshes[0]->mNumFaces;

numVertices = scene->mMeshes[0]->mNumVertices;
numIndices = numTriangles * 3;

It seems that somehow numVertices and numIndices are almost the same give or take 100 vertices. For example I had 34907440 vertices and 34907512 indices. Any convex mesh should have three times as many Indices as vertices because a vertex should be shared by at least 3 triangles. I'm guessing that Assimp is doing something quite sinister behind the scenes and isn't merging vertices properly even though I specified aiProcess_JoinIdenticalVerticesEverthing is rendering properly but I feel this might be eating away my performance. Does anyone have any Idea what might be going on? 


#1ic0de

Posted 10 July 2013 - 01:59 PM

I use assimp to load mesh data for my game and I was recently doing some optimization work on my rendering engine and I figured I should check to see how many vertices were actually being loaded. As it turns out I'm actually using more data indexing the meshes than I save by using indexed buffers. Here is my code:
 

#define IMPORT_OPTIONS	aiProcess_RemoveComponent|\
			aiProcess_OptimizeGraph|\
			aiProcess_JoinIdenticalVertices|\
			aiProcess_OptimizeMeshes|\
			aiProcess_Triangulate|\
			aiProcess_FlipUVs|\
			aiProcess_CalcTangentSpace|\
			aiProcess_SortByPType|\
			aiProcess_ImproveCacheLocality 


Assimp::Importer importer;

const aiScene* scene = importer.ReadFile(fname, IMPORT_OPTIONS);

numTriangles = scene->mMeshes[0]->mNumFaces;

numVertices = scene->mMeshes[0]->mNumVertices;
numIndices = numTriangles * 3;

It seems that somehow numVertices and numIndices are almost the same give or take 100 vertices. Any convex mesh should have three times as many Indices as vertices because a vertex should be shared by at least 3 triangles. I'm guessing that Assimp is doing something quite sinister behind the scenes and isn't merging vertices properly even though I specified aiProcess_JoinIdenticalVerticesEverthing is rendering properly but I feel this might be eating away my performance. Does anyone have any Idea what might be going on? 


PARTNERS