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:
parent
b5079f4ae2
commit
e6ec1b69f0
@ -351,7 +351,7 @@ void GameRenderer::renderWorld(GameWorld* world, const ViewCamera& camera,
|
||||
}
|
||||
|
||||
RW_PROFILE_END();
|
||||
|
||||
culled += objectRenderer.culled;
|
||||
renderer->pushDebugGroup("Objects");
|
||||
renderer->pushDebugGroup("RenderList");
|
||||
|
||||
|
@ -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.
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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,
|
||||
|
@ -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";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user