Display rendered objects count instead of ktris.

Things go well untill we have more than 200 objects on my system, no
matter how big they are.
This commit is contained in:
Vincent Lejeune 2014-01-28 20:05:16 +01:00
parent f1f8900c5d
commit 143e3a355d
4 changed files with 15 additions and 3 deletions

View File

@ -152,6 +152,11 @@ STKRenderingPass IrrDriver::getPhase() const
return phase;
}
void IrrDriver::IncreaseObjectCount()
{
object_count[phase]++;
}
core::array<video::IRenderTarget> &IrrDriver::getMainSetup()
{
return m_mrt;
@ -1514,8 +1519,9 @@ void IrrDriver::displayFPS()
if (UserConfigParams::m_artist_debug_mode)
{
sprintf(buffer, "FPS: %i/%i/%i - %.2f/%.2f/%.2f KTris - LightDst : ~%d",
min, fps, max, low, kilotris, high, m_last_light_bucket_distance);
sprintf(buffer, "FPS: %i/%i/%i - Objects (P1:%d P2:%d T:%d) KTris - LightDst : ~%d",
min, fps, max, object_count[SOLID_NORMAL_AND_DEPTH_PASS], object_count[SOLID_NORMAL_AND_DEPTH_PASS], object_count[TRANSPARENT_PASS], m_last_light_bucket_distance);
object_count[SOLID_NORMAL_AND_DEPTH_PASS] = object_count[SOLID_NORMAL_AND_DEPTH_PASS] = object_count[TRANSPARENT_PASS] = 0;
}
else
{

View File

@ -70,7 +70,8 @@ enum STKRenderingPass
TRANSPARENT_PASS,
GLOW_PASS,
DISPLACEMENT_PASS,
SHADOW_PASS
SHADOW_PASS,
PASS_COUNT,
};
/**
@ -164,7 +165,9 @@ private:
bool m_shadowviz;
bool m_lightviz;
bool m_distortviz;
/** Performance stats */
unsigned m_last_light_bucket_distance;
unsigned object_count[PASS_COUNT];
u32 m_renderpass;
u32 m_lensflare_query;
scene::IMeshSceneNode *m_sun_interposer;
@ -223,6 +226,7 @@ public:
void reset();
void setPhase(STKRenderingPass);
STKRenderingPass getPhase() const;
void IncreaseObjectCount();
core::array<video::IRenderTarget> &getMainSetup();
void updateConfigIfRelevant();
void setAllMaterialFlags(scene::IMesh *mesh) const;

View File

@ -160,6 +160,7 @@ void STKAnimatedMesh::render()
driver->setTransform(video::ETS_WORLD, AbsoluteTransformation * ((scene::SSkinMeshBuffer*)mb)->Transformation);
if (isObjectPass(material.MaterialType))
{
irr_driver->IncreaseObjectCount();
initvaostate(GLmeshes[i], material.MaterialType);
if (irr_driver->getPhase() == SOLID_NORMAL_AND_DEPTH_PASS)
{

View File

@ -949,6 +949,7 @@ void STKMesh::render()
}
else
{
irr_driver->IncreaseObjectCount();
initvaostate(GLmeshes[i], material.MaterialType);
if (transparent)
drawTransparent(GLmeshes[i], material.MaterialType);