Manual Mesh Generation Performance

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
Anthea
Kobold
Posts: 25
Joined: Tue Oct 28, 2014 1:03 pm

Manual Mesh Generation Performance

Post by Anthea » Thu Jun 04, 2015 12:11 pm

I wonder what the performance of the generation of a custom mesh compared to ManualObject is? In my scenario I have ~100 meshes (~20 000 triangles and 45 000 vertices) that are generated at runtime. Currently I generate them like that:

Code: Select all

manual->begin("Examples/SphereMappedRustySteel", Ogre::RenderOperation::OT_TRIANGLE_LIST);
	manual->estimateVertexCount(mVertices.size());

	for (int i = 0; i < iso.mVertices.size(); i++)
	{
		manual->position(mVertices.at(i));
		manual->normal(mNormals.at(i));
	}

	for (int i = 0; i < mTriangles.size(); i++)
	{
		int* tri = mTriangles.at(i).i;
		manual->triangle(tri[0], tri[1], tri[2]);
	}

	manual->end();
Does it make sense to implement it like in the wiki?
I am thankfull for any idea to speed that up :)
0 x

Post Reply