This is the code where I get batchCount and TriangleCount. mAdditionalBatchCount and mAdditionalTriangleCount are from PLanarReflection which is another node is SceneManager if precipitation is on.
Code: Select all
void VideoSystem::UpdateStatus()
{
// Sum Batch/triangle count across all render targets.
unsigned int bc = mAdditionalBatchCount;
unsigned int tc = mAdditionalTriangleCount;
Ogre::RenderSystem::RenderTargetIterator iter =
Root->getRenderSystem()->getRenderTargetIterator();
while (iter.hasMoreElements())
{
Ogre::RenderTarget* rt = iter.getNext();
if(rt->isAutoUpdated() || this->PrecipitationsEnabled)
{
bc += rt->getBatchCount();
tc += rt->getTriangleCount();
}
}
// Count fps only from active render forms.
double fps = 0;
for each (RenderForm^ rf in this->RenderFormList)
{
Ogre::RenderWindow *ogreWindow = rf->OgreWindow;
if (ogreWindow)
{
fps += ogreWindow->getAverageFPS();
bc += ogreWindow->getBatchCount();
tc += ogreWindow->getTriangleCount();
}
}
// add environment cube map stats
bc += VideoSystem::CubeMapStats->Batches;
tc += VideoSystem::CubeMapStats->Triangles;
fps /= this->RenderFormList->Count;
AutoMonitorLock lock(SimplePropertyLock);
// Update status
mStatus.AverageFps = fps;
mStatus.BatchCount = bc;
mStatus.TriangleCount = tc;
Ogre::ColourValue col;
col = Scene->getAmbientLight();
mStatus.SceneAmbient = Vector(col.r, col.g, col.b);
if (Environment->SunLight != nullptr) {
col = Environment->SunLight->getDiffuseColour();
mStatus.SunDiffuse = Vector(col.r, col.g, col.b);
col = Environment->SunLight->getSpecularColour();
mStatus.SunSpecular = Vector(col.r, col.g, col.b);
} else {
mStatus.SunDiffuse = Vector::Zero;
mStatus.SunSpecular = Vector::Zero;
}
if (Environment->MoonLight != nullptr) {
col = Environment->MoonLight->getDiffuseColour();
mStatus.MoonDiffuse = Vector(col.r, col.g, col.b);
col = Environment->MoonLight->getSpecularColour();
mStatus.MoonSpecular = Vector(col.r, col.g, col.b);
} else {
mStatus.MoonDiffuse = Vector::Zero;
mStatus.MoonSpecular = Vector::Zero;
}
}
I have tried to put status update before rendering and after rendering the values are the same.
Any suggestion what to do ?
Bloom off
Bloom on
Bloom on, but rain