It's been a while since I've been doing anything serious with Ogre, so I'm a bit rusty
My artist is trying to do manual LOD with my racing track. I use StaticGeometry to attempt to reduce the number of batches. Unfortunately when he adds manual mesh LOD to one of the track objects I get an assertion failure: -
Code: Select all
assert(qmesh->geometryLodList->size() == lodLevels);
Code: Select all
void StaticGeometry::Region::assign(QueuedSubMesh* qmesh)
{
mQueuedSubMeshes.push_back(qmesh);
// Set/check lod strategy
const LodStrategy *lodStrategy = qmesh->submesh->parent->getLodStrategy();
if (mLodStrategy == 0)
{
mLodStrategy = lodStrategy;
// First LOD mandatory, and always from base lod value
mLodValues.push_back(mLodStrategy->getBaseValue());
}
else
{
if (mLodStrategy != lodStrategy)
OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, "Lod strategies do not match",
"StaticGeometry::Region::assign");
}
// update lod values
ushort lodLevels = qmesh->submesh->parent->getNumLodLevels();
assert(qmesh->geometryLodList->size() == lodLevels);
while(mLodValues.size() < lodLevels)
{
mLodValues.push_back(0.0f);
}
// Make sure LOD levels are max of all at the requested level
for (ushort lod = 1; lod < lodLevels; ++lod)
{
const MeshLodUsage& meshLod =
qmesh->submesh->parent->getLodLevel(lod);
mLodValues[lod] = std::max(mLodValues[lod],
meshLod.value);
}
// update bounds
// Transform world bounds relative to our centre
AxisAlignedBox localBounds(
qmesh->worldBounds.getMinimum() - mCentre,
qmesh->worldBounds.getMaximum() - mCentre);
mAABB.merge(localBounds);
mBoundingRadius = Math::boundingRadiusFromAABB(mAABB);
}
Thanks for your help.
All the best,
Ash