From Tim Moore, "I noticed that the "Materials" statistic in the camera scene stats display seemed to be identical to the number of drawables. In fact, it displays the nummat member of osgUtil::Statistics, but that variable has nothing to do with materials. nummat tracks the number of matrices associated with Drawable objects in a RenderBin; as I understand it, Drawables pretty much always have a model-view matrix tied to them in RenderBins, so this statistic doesn't seem very useful. So, I added statistics for the number of StateGraph objects in RenderBins and also for the number of Drawables in the "fine grain ordering" of RenderBins. The latter corresponds to the number of Drawables in the scene that are sorted by some criteria other than graphics state; usually that is distance for semi-transparent objects, though it could be traversal order. These two statistics give an idea of the number of graphic state changes happening in a visible scene: each StateGraph implies a state change, and there could be a change for each sorted object too. You can also subtract the number of sorted Drawables from the total number of Drawables and get an idea of how many Drawables are being drawn for each StateGraph.

"
This commit is contained in:
Robert Osfield
2010-04-20 10:59:44 +00:00
parent 92a6b0020d
commit 7c38643a77
5 changed files with 18 additions and 7 deletions

View File

@@ -412,9 +412,10 @@ struct CameraSceneStatsTextDrawCallback : public virtual osg::Drawable::DrawCall
STATS_ATTRIBUTE("Visible number of lights")
STATS_ATTRIBUTE("Visible number of render bins")
STATS_ATTRIBUTE("Visible depth")
STATS_ATTRIBUTE("Visible number of materials")
STATS_ATTRIBUTE("Number of StateGraphs")
STATS_ATTRIBUTE("Visible number of impostors")
STATS_ATTRIBUTE("Visible number of drawables")
STATS_ATTRIBUTE("Number of ordered leaves")
STATS_ATTRIBUTE("Visible vertex count")
STATS_ATTRIBUTE("Visible number of GL_POINTS")
@@ -1417,9 +1418,10 @@ void StatsHandler::setUpScene(osgViewer::ViewerBase* viewer)
viewStr << "Lights" << std::endl;
viewStr << "Bins" << std::endl;
viewStr << "Depth" << std::endl;
viewStr << "Materials" << std::endl;
viewStr << "State graphs" << std::endl;
viewStr << "Imposters" << std::endl;
viewStr << "Drawables" << std::endl;
viewStr << "Sorted" << std::endl;
viewStr << "Vertices" << std::endl;
viewStr << "Points" << std::endl;
viewStr << "Lines" << std::endl;