Hi, i know this isnt for the OgreMeshTool.exe, but i had troubles when doing it in c++ and generating a manual v2 mesh that needed lods.
The problem stemmed from not being able to set the lod values to the v2 mesh / submesh and save to disk; so i made these changes:
* Add an additional 3 commands to OgreMesh2.cpp at around line 400: ( I only used the last 2 functions )
Code: Select all
...
const LodValueArray* _getLodValueArray(void) const { return &mLodValues; }
void clearLodValues() { mLodValues.clear(); }
void setLodValue(Ogre::Real index) { mLodValues.push_back(index); }
...
* Compile and then run in your app with this sort of function:
Code: Select all
void setupLodValues(int numLods, Ogre::MeshPtr mesh)
{
Ogre::Real distances[5] = { 0, 20, 40, 50, 60 };
mesh->clearLodValues();
for (int i = 0; i < numLods; i++){
mesh->setLodValue(distances[i]);
}
}
As long as you add the lod vao to the submesh with something similar to this:
Code: Select all
...
Ogre::VertexArrayObject* lodvao = vaoManager->createVertexArrayObject(vertexBuffers, indexBuffer, Ogre::OT_TRIANGLE_LIST);
subMesh->mVao[Ogre::VpNormal].push_back( lodvao );
subMesh->mVao[Ogre::VpShadow].push_back( lodvao );
...
then you can add your own lod meshes and it will save to the v2 mesh format and can be read back from the file.
Hope this helps
