1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-22 10:22:52 +01:00

Bring back culling events counter

This commit is contained in:
haphzd 2016-12-10 22:19:38 +03:00
parent b5079f4ae2
commit e6ec1b69f0
5 changed files with 14 additions and 6 deletions

View File

@ -351,7 +351,7 @@ void GameRenderer::renderWorld(GameWorld* world, const ViewCamera& camera,
}
RW_PROFILE_END();
culled += objectRenderer.culled;
renderer->pushDebugGroup("Objects");
renderer->pushDebugGroup("RenderList");

View File

@ -86,6 +86,9 @@ class GameRenderer {
ViewCamera _camera;
ViewCamera cullingCamera;
bool cullOverride;
/** Number of culling events */
size_t culled;
GLuint framebufferName;
GLuint fbTextures[2];
@ -99,9 +102,6 @@ public:
GameRenderer(Logger* log, GameData* data);
~GameRenderer();
/** Number of culling events */
size_t culled;
/** @todo Clean up all these shader program and location variables */
Renderer::ShaderProgram* worldProg;
Renderer::ShaderProgram* skyProg;
@ -123,6 +123,10 @@ public:
GLuint getMissingTexture() const {
return m_missingTexture;
}
size_t getCulledCount() {
return culled;
}
/**
* Renders the world using the parameters of the passed Camera.

View File

@ -129,6 +129,7 @@ bool ObjectRenderer::renderFrame(Model* m, ModelFrame* f,
glm::vec3 boundpos = bounds.center + glm::vec3(localmatrix[3]);
if (!m_camera.frustum.intersects(boundpos, bounds.radius)) {
culled++;
continue;
}
}

View File

@ -25,7 +25,8 @@ public:
: m_world(world)
, m_camera(camera)
, m_renderAlpha(renderAlpha)
, m_errorTexture(errorTexture) {
, m_errorTexture(errorTexture)
, culled(0) {
}
/**
@ -33,6 +34,7 @@ public:
*
* Exports rendering instructions for an object
*/
size_t culled;
void buildRenderList(GameObject* object, RenderList& outList);
bool renderFrame(Model* m, ModelFrame* f, const glm::mat4& matrix,

View File

@ -607,7 +607,8 @@ void RWGame::renderDebugStats(float time) {
std::stringstream ss;
ss << "FPS: " << (1000.f / time_average) << " (" << time_average << "ms)\n"
<< "Frame: " << time_ms << "ms\n"
<< "Draws/Textures/Buffers: " << lastDraws << "/"
<< "Draws/Culls/Textures/Buffers: " << lastDraws << "/"
<< renderer.getCulledCount() << "/"
<< renderer.getRenderer()->getTextureCount() << "/"
<< renderer.getRenderer()->getBufferCount() << "\n";