2006-07-18 23:21:48 +08:00
|
|
|
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
2003-01-22 00:45:36 +08:00
|
|
|
*
|
|
|
|
* This library is open source and may be redistributed and/or modified under
|
|
|
|
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
|
|
|
* (at your option) any later version. The full license is in LICENSE file
|
|
|
|
* included with this distribution, and on the openscenegraph.org website.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* OpenSceneGraph Public License for more details.
|
|
|
|
*/
|
2001-10-04 23:12:57 +08:00
|
|
|
|
2001-10-23 06:02:47 +08:00
|
|
|
#ifndef OSGUTIL_STATISTICS
|
|
|
|
#define OSGUTIL_STATISTICS 1
|
2001-09-20 05:19:47 +08:00
|
|
|
|
2005-02-09 18:39:45 +08:00
|
|
|
#include <osg/PrimitiveSet>
|
2002-02-06 05:54:46 +08:00
|
|
|
#include <osg/Drawable>
|
2006-07-13 23:25:22 +08:00
|
|
|
#include <osg/NodeVisitor>
|
|
|
|
#include <osg/Geode>
|
|
|
|
#include <osg/LOD>
|
|
|
|
#include <osg/Switch>
|
|
|
|
#include <osg/Geometry>
|
|
|
|
#include <osg/Transform>
|
2001-09-20 05:19:47 +08:00
|
|
|
|
2002-07-18 22:20:01 +08:00
|
|
|
#include <map>
|
2006-07-13 23:25:22 +08:00
|
|
|
#include <set>
|
|
|
|
#include <ostream>
|
2002-07-18 22:20:01 +08:00
|
|
|
|
2003-07-15 21:46:19 +08:00
|
|
|
namespace osgUtil {
|
2001-09-20 05:19:47 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Statistics base class. Used to extract primitive information from
|
2001-10-23 06:02:47 +08:00
|
|
|
* the renderBin(s). Add a case of getStats(osgUtil::Statistics *stat)
|
|
|
|
* for any new drawable (or drawable derived class) that you generate
|
2002-06-26 04:27:51 +08:00
|
|
|
* (eg see Geometry.cpp). There are 20 types of drawable counted - actually only
|
2001-10-23 06:02:47 +08:00
|
|
|
* 14 cases can occur in reality. these represent sets of GL_POINTS, GL_LINES
|
|
|
|
* GL_LINESTRIPS, LOOPS, TRIANGLES, TRI-fans, tristrips, quads, quadstrips etc
|
|
|
|
* The number of triangles rendered is inferred:
|
|
|
|
* each triangle = 1 triangle (number of vertices/3)
|
|
|
|
* each quad = 2 triangles (nverts/2)
|
|
|
|
* each trifan or tristrip = (length-2) triangles and so on.
|
2001-09-20 05:19:47 +08:00
|
|
|
*/
|
2001-10-23 06:02:47 +08:00
|
|
|
|
2005-02-09 18:39:45 +08:00
|
|
|
class Statistics : public osg::PrimitiveFunctor
|
2003-07-15 21:46:19 +08:00
|
|
|
{
|
2001-09-20 05:19:47 +08:00
|
|
|
public:
|
2002-07-18 22:20:01 +08:00
|
|
|
|
|
|
|
typedef std::pair<unsigned int,unsigned int> PrimitivePair;
|
2005-09-29 18:25:44 +08:00
|
|
|
typedef std::map<GLenum,PrimitivePair> PrimitiveValueMap;
|
|
|
|
typedef std::map<GLenum, unsigned int> PrimitiveCountMap;
|
2002-07-18 22:20:01 +08:00
|
|
|
|
|
|
|
|
|
|
|
Statistics()
|
2001-11-05 03:29:20 +08:00
|
|
|
{
|
2001-09-20 05:19:47 +08:00
|
|
|
reset();
|
|
|
|
};
|
2001-10-23 06:02:47 +08:00
|
|
|
|
2006-07-30 00:47:28 +08:00
|
|
|
enum StatsType
|
2001-11-05 03:29:20 +08:00
|
|
|
{
|
2001-10-23 06:02:47 +08:00
|
|
|
STAT_NONE, // default
|
2002-07-18 22:20:01 +08:00
|
|
|
STAT_FRAMERATE,
|
|
|
|
STAT_GRAPHS,
|
|
|
|
STAT_PRIMS,
|
|
|
|
STAT_PRIMSPERVIEW,
|
|
|
|
STAT_PRIMSPERBIN,
|
2001-10-23 06:02:47 +08:00
|
|
|
STAT_DC,
|
|
|
|
STAT_RESTART // hint to restart the stats
|
|
|
|
};
|
2002-07-18 22:20:01 +08:00
|
|
|
|
2001-11-05 03:29:20 +08:00
|
|
|
void reset()
|
|
|
|
{
|
2005-12-16 01:14:40 +08:00
|
|
|
numDrawables=0;
|
|
|
|
nummat=0;
|
|
|
|
depth=0;
|
|
|
|
stattype=STAT_NONE;
|
|
|
|
nlights=0;
|
|
|
|
nbins=0;
|
|
|
|
nimpostor=0;
|
2002-07-18 22:20:01 +08:00
|
|
|
|
|
|
|
_vertexCount=0;
|
|
|
|
_primitiveCount.clear();
|
|
|
|
|
2005-09-29 18:25:44 +08:00
|
|
|
_currentPrimitiveFunctorMode=0;
|
2006-07-13 19:46:55 +08:00
|
|
|
|
|
|
|
_primitives_count.clear();
|
|
|
|
_total_primitives_count=0;
|
|
|
|
_number_of_vertexes=0;
|
2001-09-20 05:19:47 +08:00
|
|
|
}
|
|
|
|
|
2006-07-30 00:47:28 +08:00
|
|
|
void setType(StatsType t) {stattype=t;}
|
2002-07-18 22:20:01 +08:00
|
|
|
|
2003-07-15 21:46:19 +08:00
|
|
|
virtual void setVertexArray(unsigned int count,const osg::Vec3*) { _vertexCount += count; }
|
2003-08-18 17:24:17 +08:00
|
|
|
virtual void setVertexArray(unsigned int count,const osg::Vec2*) { _vertexCount += count; }
|
|
|
|
virtual void setVertexArray(unsigned int count,const osg::Vec4*) { _vertexCount += count; }
|
2003-07-15 21:46:19 +08:00
|
|
|
|
|
|
|
virtual void drawArrays(GLenum mode,GLint,GLsizei count)
|
|
|
|
{
|
|
|
|
PrimitivePair& prim = _primitiveCount[mode];
|
|
|
|
++prim.first;
|
|
|
|
prim.second+=count;
|
|
|
|
_primitives_count[mode] += _calculate_primitives_number_by_mode(mode, count);
|
|
|
|
}
|
|
|
|
virtual void drawElements(GLenum mode,GLsizei count,const GLubyte*)
|
|
|
|
{
|
|
|
|
PrimitivePair& prim = _primitiveCount[mode];
|
|
|
|
++prim.first;
|
|
|
|
prim.second+=count;
|
|
|
|
_primitives_count[mode] += _calculate_primitives_number_by_mode(mode, count);
|
|
|
|
}
|
|
|
|
virtual void drawElements(GLenum mode,GLsizei count,const GLushort*)
|
|
|
|
{
|
|
|
|
PrimitivePair& prim = _primitiveCount[mode];
|
|
|
|
++prim.first;
|
|
|
|
prim.second+=count;
|
|
|
|
_primitives_count[mode] += _calculate_primitives_number_by_mode(mode, count);
|
|
|
|
}
|
|
|
|
virtual void drawElements(GLenum mode,GLsizei count,const GLuint*)
|
|
|
|
{
|
|
|
|
PrimitivePair& prim = _primitiveCount[mode];
|
|
|
|
++prim.first;
|
|
|
|
prim.second+=count;
|
|
|
|
_primitives_count[mode] += _calculate_primitives_number_by_mode(mode, count);
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void begin(GLenum mode)
|
|
|
|
{
|
2005-09-29 18:25:44 +08:00
|
|
|
_currentPrimitiveFunctorMode=mode;
|
2003-07-15 21:46:19 +08:00
|
|
|
PrimitivePair& prim = _primitiveCount[mode];
|
|
|
|
++prim.first;
|
|
|
|
_number_of_vertexes = 0;
|
|
|
|
}
|
2003-08-18 17:24:17 +08:00
|
|
|
|
|
|
|
inline void vertex()
|
2003-07-15 21:46:19 +08:00
|
|
|
{
|
2005-09-29 18:25:44 +08:00
|
|
|
PrimitivePair& prim = _primitiveCount[_currentPrimitiveFunctorMode];
|
2003-07-15 21:46:19 +08:00
|
|
|
++prim.second;
|
|
|
|
_number_of_vertexes++;
|
|
|
|
}
|
2003-08-18 17:24:17 +08:00
|
|
|
virtual void vertex(float,float,float) { vertex(); }
|
|
|
|
virtual void vertex(const osg::Vec3&) { vertex(); }
|
2003-09-17 03:56:19 +08:00
|
|
|
virtual void vertex(const osg::Vec2&) { vertex(); }
|
|
|
|
virtual void vertex(const osg::Vec4&) { vertex(); }
|
|
|
|
virtual void vertex(float,float) { vertex(); }
|
|
|
|
virtual void vertex(float,float,float,float) { vertex(); }
|
2003-08-18 17:24:17 +08:00
|
|
|
|
2003-07-15 21:46:19 +08:00
|
|
|
virtual void end()
|
|
|
|
{
|
2005-09-29 18:25:44 +08:00
|
|
|
_primitives_count[_currentPrimitiveFunctorMode] +=
|
|
|
|
_calculate_primitives_number_by_mode(_currentPrimitiveFunctorMode, _number_of_vertexes);
|
2005-12-16 01:14:40 +08:00
|
|
|
|
|
|
|
_vertexCount += _number_of_vertexes;
|
2003-07-15 21:46:19 +08:00
|
|
|
}
|
2001-11-05 03:29:20 +08:00
|
|
|
|
2002-08-31 03:45:56 +08:00
|
|
|
void addDrawable() { numDrawables++;}
|
2001-11-05 03:29:20 +08:00
|
|
|
void addMatrix() { nummat++;}
|
2002-09-02 20:31:35 +08:00
|
|
|
void addLight(int np) { nlights+=np;}
|
|
|
|
void addImpostor(int np) { nimpostor+= np; }
|
|
|
|
inline int getBins() { return nbins;}
|
|
|
|
void setDepth(int d) { depth=d; }
|
|
|
|
void addBins(int np) { nbins+= np; }
|
2001-11-05 03:29:20 +08:00
|
|
|
|
2006-07-30 00:47:28 +08:00
|
|
|
void setBinNo(int n) { _binNo=n;}
|
|
|
|
|
|
|
|
void add(const Statistics& stats)
|
|
|
|
{
|
|
|
|
numDrawables += stats.numDrawables;
|
|
|
|
nummat += stats.nummat;
|
|
|
|
depth += stats.depth;
|
|
|
|
nlights += stats.nlights;
|
|
|
|
nbins += stats.nbins;
|
|
|
|
nimpostor += stats.nimpostor;
|
|
|
|
|
|
|
|
_vertexCount += stats._vertexCount;
|
|
|
|
// _primitiveCount += stats._primitiveCount;
|
|
|
|
for(PrimitiveValueMap::const_iterator pitr = stats._primitiveCount.begin();
|
|
|
|
pitr != stats._primitiveCount.end();
|
|
|
|
++pitr)
|
|
|
|
{
|
|
|
|
_primitiveCount[pitr->first].first += pitr->second.first;
|
|
|
|
_primitiveCount[pitr->first].second += pitr->second.second;
|
|
|
|
}
|
|
|
|
|
|
|
|
_currentPrimitiveFunctorMode += stats._currentPrimitiveFunctorMode;
|
|
|
|
|
|
|
|
for(PrimitiveCountMap::const_iterator citr = stats._primitives_count.begin();
|
|
|
|
citr != stats._primitives_count.end();
|
|
|
|
++citr)
|
|
|
|
{
|
|
|
|
_primitives_count[citr->first] += citr->second;
|
|
|
|
}
|
|
|
|
|
|
|
|
_total_primitives_count += stats._total_primitives_count;
|
|
|
|
_number_of_vertexes += stats._number_of_vertexes;
|
|
|
|
}
|
2001-11-05 03:29:20 +08:00
|
|
|
|
2003-01-10 17:25:42 +08:00
|
|
|
public:
|
2001-10-23 06:02:47 +08:00
|
|
|
|
2005-09-29 18:25:44 +08:00
|
|
|
PrimitiveCountMap::iterator GetPrimitivesBegin() { return _primitives_count.begin(); }
|
|
|
|
PrimitiveCountMap::iterator GetPrimitivesEnd() { return _primitives_count.end(); }
|
2003-07-15 21:46:19 +08:00
|
|
|
|
2002-08-31 03:45:56 +08:00
|
|
|
int numDrawables, nummat, nbins;
|
2002-07-18 22:20:01 +08:00
|
|
|
int nlights;
|
2001-11-05 03:29:20 +08:00
|
|
|
int depth; // depth into bins - eg 1.1,1.2,1.3 etc
|
|
|
|
int _binNo;
|
2006-07-30 00:47:28 +08:00
|
|
|
StatsType stattype;
|
2001-10-23 06:02:47 +08:00
|
|
|
int nimpostor; // number of impostors rendered
|
2002-07-18 22:20:01 +08:00
|
|
|
|
|
|
|
unsigned int _vertexCount;
|
2005-09-29 18:25:44 +08:00
|
|
|
PrimitiveValueMap _primitiveCount;
|
|
|
|
GLenum _currentPrimitiveFunctorMode;
|
2003-01-10 17:25:42 +08:00
|
|
|
|
2003-07-15 21:46:19 +08:00
|
|
|
private:
|
2005-09-29 18:25:44 +08:00
|
|
|
PrimitiveCountMap _primitives_count;
|
2003-07-15 21:46:19 +08:00
|
|
|
|
|
|
|
unsigned int _total_primitives_count;
|
|
|
|
unsigned int _number_of_vertexes;
|
|
|
|
|
2003-09-02 18:27:57 +08:00
|
|
|
inline unsigned int _calculate_primitives_number_by_mode(GLenum, GLsizei);
|
2001-09-20 05:19:47 +08:00
|
|
|
};
|
|
|
|
|
2003-07-15 21:46:19 +08:00
|
|
|
inline unsigned int Statistics::_calculate_primitives_number_by_mode(GLenum mode, GLsizei count)
|
|
|
|
{
|
|
|
|
switch (mode)
|
|
|
|
{
|
|
|
|
case GL_POINTS:
|
|
|
|
case GL_LINE_LOOP:
|
|
|
|
case GL_POLYGON: return count;
|
|
|
|
case GL_LINES: return count / 2;
|
|
|
|
case GL_LINE_STRIP: return count - 1;
|
|
|
|
case GL_TRIANGLES: return count / 3;
|
|
|
|
case GL_TRIANGLE_STRIP:
|
|
|
|
case GL_TRIANGLE_FAN: return count - 2;
|
|
|
|
case GL_QUADS: return count / 4;
|
2005-12-15 23:25:02 +08:00
|
|
|
case GL_QUAD_STRIP: return count / 2 - 1;
|
2003-07-15 21:46:19 +08:00
|
|
|
default: return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-07-13 23:25:22 +08:00
|
|
|
/** StatsVisitor for collecting statistics about scene graph.*/
|
|
|
|
class StatsVisitor : public osg::NodeVisitor
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
typedef std::set<osg::Node*> NodeSet;
|
|
|
|
typedef std::set<osg::Drawable*> DrawableSet;
|
2006-08-29 03:06:33 +08:00
|
|
|
typedef std::set<osg::StateSet*> StateSetSet;
|
2006-07-13 23:25:22 +08:00
|
|
|
|
|
|
|
StatsVisitor():
|
|
|
|
osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN),
|
|
|
|
_numInstancedGroup(0),
|
|
|
|
_numInstancedSwitch(0),
|
|
|
|
_numInstancedLOD(0),
|
|
|
|
_numInstancedTransform(0),
|
|
|
|
_numInstancedGeode(0),
|
|
|
|
_numInstancedDrawable(0),
|
2006-08-29 03:06:33 +08:00
|
|
|
_numInstancedGeometry(0),
|
|
|
|
_numInstancedStateSet(0) {}
|
2006-07-13 23:25:22 +08:00
|
|
|
|
|
|
|
void reset()
|
|
|
|
{
|
|
|
|
_numInstancedGroup = 0;
|
|
|
|
_numInstancedSwitch = 0;
|
|
|
|
_numInstancedLOD = 0;
|
|
|
|
_numInstancedTransform = 0;
|
|
|
|
_numInstancedGeode = 0;
|
|
|
|
_numInstancedDrawable = 0;
|
|
|
|
_numInstancedGeometry = 0;
|
2006-08-29 03:06:33 +08:00
|
|
|
_numInstancedStateSet = 0;
|
2006-07-13 23:25:22 +08:00
|
|
|
|
|
|
|
_groupSet.clear();
|
|
|
|
_transformSet.clear();
|
|
|
|
_lodSet.clear();
|
|
|
|
_switchSet.clear();
|
|
|
|
_geodeSet.clear();
|
|
|
|
_drawableSet.clear();
|
|
|
|
_geometrySet.clear();
|
2006-08-29 03:06:33 +08:00
|
|
|
_statesetSet.clear();
|
2006-07-13 23:25:22 +08:00
|
|
|
|
|
|
|
_uniqueStats.reset();
|
|
|
|
_instancedStats.reset();
|
|
|
|
}
|
|
|
|
|
2006-08-29 03:06:33 +08:00
|
|
|
void apply(osg::Node& node)
|
|
|
|
{
|
|
|
|
if (node.getStateSet())
|
|
|
|
{
|
|
|
|
++_numInstancedStateSet;
|
|
|
|
_statesetSet.insert(node.getStateSet());
|
|
|
|
}
|
|
|
|
traverse(node);
|
|
|
|
}
|
|
|
|
|
2006-07-13 23:25:22 +08:00
|
|
|
void apply(osg::Group& node)
|
|
|
|
{
|
2006-08-29 03:06:33 +08:00
|
|
|
if (node.getStateSet())
|
|
|
|
{
|
|
|
|
++_numInstancedStateSet;
|
|
|
|
_statesetSet.insert(node.getStateSet());
|
|
|
|
}
|
|
|
|
|
2006-07-13 23:25:22 +08:00
|
|
|
++_numInstancedGroup;
|
|
|
|
_groupSet.insert(&node);
|
|
|
|
traverse(node);
|
|
|
|
}
|
|
|
|
|
|
|
|
void apply(osg::Transform& node)
|
|
|
|
{
|
2006-08-29 03:06:33 +08:00
|
|
|
if (node.getStateSet())
|
|
|
|
{
|
|
|
|
++_numInstancedStateSet;
|
|
|
|
_statesetSet.insert(node.getStateSet());
|
|
|
|
}
|
|
|
|
|
2006-07-13 23:25:22 +08:00
|
|
|
++_numInstancedTransform;
|
|
|
|
_transformSet.insert(&node);
|
|
|
|
traverse(node);
|
|
|
|
}
|
|
|
|
|
|
|
|
void apply(osg::LOD& node)
|
|
|
|
{
|
2006-08-29 03:06:33 +08:00
|
|
|
if (node.getStateSet())
|
|
|
|
{
|
|
|
|
++_numInstancedStateSet;
|
|
|
|
_statesetSet.insert(node.getStateSet());
|
|
|
|
}
|
|
|
|
|
2006-07-13 23:25:22 +08:00
|
|
|
++_numInstancedLOD;
|
|
|
|
_lodSet.insert(&node);
|
|
|
|
traverse(node);
|
|
|
|
}
|
|
|
|
|
|
|
|
void apply(osg::Switch& node)
|
|
|
|
{
|
2006-08-29 03:06:33 +08:00
|
|
|
if (node.getStateSet())
|
|
|
|
{
|
|
|
|
++_numInstancedStateSet;
|
|
|
|
_statesetSet.insert(node.getStateSet());
|
|
|
|
}
|
|
|
|
|
2006-07-13 23:25:22 +08:00
|
|
|
++_numInstancedSwitch;
|
|
|
|
_switchSet.insert(&node);
|
|
|
|
traverse(node);
|
|
|
|
}
|
|
|
|
|
|
|
|
void apply(osg::Geode& node)
|
|
|
|
{
|
2006-08-29 03:06:33 +08:00
|
|
|
if (node.getStateSet())
|
|
|
|
{
|
|
|
|
++_numInstancedStateSet;
|
|
|
|
_statesetSet.insert(node.getStateSet());
|
|
|
|
}
|
|
|
|
|
2006-07-13 23:25:22 +08:00
|
|
|
++_numInstancedGeode;
|
|
|
|
_geodeSet.insert(&node);
|
|
|
|
|
|
|
|
for(unsigned int i=0; i<node.getNumDrawables();++i)
|
|
|
|
{
|
|
|
|
apply(*node.getDrawable(i));
|
|
|
|
}
|
|
|
|
|
|
|
|
traverse(node);
|
|
|
|
}
|
|
|
|
|
|
|
|
void apply(osg::Drawable& drawable)
|
|
|
|
{
|
2006-08-29 03:06:33 +08:00
|
|
|
if (drawable.getStateSet())
|
|
|
|
{
|
|
|
|
++_numInstancedStateSet;
|
|
|
|
_statesetSet.insert(drawable.getStateSet());
|
|
|
|
}
|
|
|
|
|
2006-07-13 23:25:22 +08:00
|
|
|
++_numInstancedDrawable;
|
|
|
|
|
|
|
|
drawable.accept(_instancedStats);
|
|
|
|
|
|
|
|
_drawableSet.insert(&drawable);
|
|
|
|
|
|
|
|
osg::Geometry* geometry = dynamic_cast<osg::Geometry*>(&drawable);
|
|
|
|
if (geometry)
|
|
|
|
{
|
|
|
|
++_numInstancedGeometry;
|
|
|
|
_geometrySet.insert(geometry);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void totalUpStats()
|
|
|
|
{
|
|
|
|
_uniqueStats.reset();
|
|
|
|
|
|
|
|
for(DrawableSet::iterator itr = _drawableSet.begin();
|
|
|
|
itr != _drawableSet.end();
|
|
|
|
++itr)
|
|
|
|
{
|
|
|
|
(*itr)->accept(_uniqueStats);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void print(std::ostream& out)
|
|
|
|
{
|
|
|
|
|
|
|
|
unsigned int unique_primitives = 0;
|
|
|
|
osgUtil::Statistics::PrimitiveCountMap::iterator pcmitr;
|
|
|
|
for(pcmitr = _uniqueStats.GetPrimitivesBegin();
|
|
|
|
pcmitr != _uniqueStats.GetPrimitivesEnd();
|
|
|
|
++pcmitr)
|
|
|
|
{
|
|
|
|
unique_primitives += pcmitr->second;
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned int instanced_primitives = 0;
|
|
|
|
for(pcmitr = _instancedStats.GetPrimitivesBegin();
|
|
|
|
pcmitr != _instancedStats.GetPrimitivesEnd();
|
|
|
|
++pcmitr)
|
|
|
|
{
|
|
|
|
instanced_primitives += pcmitr->second;
|
|
|
|
}
|
|
|
|
|
|
|
|
out<<"Object Type\t#Unique\t#Instanced"<<std::endl;
|
2006-08-29 03:06:33 +08:00
|
|
|
out<<"StateSet \t"<<_statesetSet.size()<<"\t"<<_numInstancedStateSet<<std::endl;
|
2006-07-13 23:25:22 +08:00
|
|
|
out<<"Group \t"<<_groupSet.size()<<"\t"<<_numInstancedGroup<<std::endl;
|
|
|
|
out<<"Transform \t"<<_transformSet.size()<<"\t"<<_numInstancedTransform<<std::endl;
|
|
|
|
out<<"LOD \t"<<_lodSet.size()<<"\t"<<_numInstancedLOD<<std::endl;
|
|
|
|
out<<"Switch \t"<<_switchSet.size()<<"\t"<<_numInstancedSwitch<<std::endl;
|
|
|
|
out<<"Geode \t"<<_geodeSet.size()<<"\t"<<_numInstancedGeode<<std::endl;
|
|
|
|
out<<"Drawable \t"<<_drawableSet.size()<<"\t"<<_numInstancedDrawable<<std::endl;
|
|
|
|
out<<"Geometry \t"<<_geometrySet.size()<<"\t"<<_numInstancedGeometry<<std::endl;
|
|
|
|
out<<"Vertices \t"<<_uniqueStats._vertexCount<<"\t"<<_instancedStats._vertexCount<<std::endl;
|
|
|
|
out<<"Primitives \t"<<unique_primitives<<"\t"<<instanced_primitives<<std::endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned int _numInstancedGroup;
|
|
|
|
unsigned int _numInstancedSwitch;
|
|
|
|
unsigned int _numInstancedLOD;
|
|
|
|
unsigned int _numInstancedTransform;
|
|
|
|
unsigned int _numInstancedGeode;
|
|
|
|
unsigned int _numInstancedDrawable;
|
|
|
|
unsigned int _numInstancedGeometry;
|
2006-08-29 03:06:33 +08:00
|
|
|
unsigned int _numInstancedStateSet;
|
2006-07-13 23:25:22 +08:00
|
|
|
|
|
|
|
NodeSet _groupSet;
|
|
|
|
NodeSet _transformSet;
|
|
|
|
NodeSet _lodSet;
|
|
|
|
NodeSet _switchSet;
|
|
|
|
NodeSet _geodeSet;
|
|
|
|
DrawableSet _drawableSet;
|
|
|
|
DrawableSet _geometrySet;
|
2006-08-29 03:06:33 +08:00
|
|
|
StateSetSet _statesetSet;
|
2006-07-13 23:25:22 +08:00
|
|
|
|
|
|
|
osgUtil::Statistics _uniqueStats;
|
|
|
|
osgUtil::Statistics _instancedStats;
|
|
|
|
};
|
|
|
|
|
2002-02-03 20:33:41 +08:00
|
|
|
}
|
2001-09-20 05:19:47 +08:00
|
|
|
|
|
|
|
#endif
|