diff --git a/src/graphics/draw_calls.cpp b/src/graphics/draw_calls.cpp index 40ad6bc94..a686f6220 100644 --- a/src/graphics/draw_calls.cpp +++ b/src/graphics/draw_calls.cpp @@ -146,10 +146,10 @@ void DrawCalls::parseSceneManager(core::list &List, { node->updateVisibility(); } - (*I)->updateAbsolutePosition(); if (!(*I)->isVisible()) continue; + (*I)->updateAbsolutePosition(); if (STKParticle *node = dynamic_cast(*I)) { if (!isCulledPrecise(cam, *I, irr_driver->getBoundingBoxesViz())) @@ -202,11 +202,17 @@ void DrawCalls::prepareDrawCalls(scene::ICameraSceneNode *camnode) { CPUParticleManager::getInstance()->reset(); TextBillboardDrawer::reset(); - PROFILER_PUSH_CPU_MARKER("- culling", 0xFF, 0xFF, 0x0); + PROFILER_PUSH_CPU_MARKER("- prepare draw call", 0xFF, 0xFF, 0x0); SP::prepareDrawCalls(); + PROFILER_POP_CPU_MARKER(); + + PROFILER_PUSH_CPU_MARKER("-- parse scene manager", 0x00, 0xFF, 0x0); parseSceneManager( irr_driver->getSceneManager()->getRootSceneNode()->getChildren(), camnode); + PROFILER_POP_CPU_MARKER(); + + PROFILER_PUSH_CPU_MARKER("-- handle dynamic draw", 0x00, 0xFF, 0x0); SP::handleDynamicDrawCall(); SP::updateModelMatrix(); PROFILER_POP_CPU_MARKER(); @@ -214,7 +220,7 @@ void DrawCalls::prepareDrawCalls(scene::ICameraSceneNode *camnode) PROFILER_PUSH_CPU_MARKER("- cpu particle generation", 0x2F, 0x1F, 0x11); CPUParticleManager::getInstance()->generateAll(); PROFILER_POP_CPU_MARKER(); - + // Add a 1 s timeout if (m_sync != 0) { @@ -233,22 +239,7 @@ void DrawCalls::prepareDrawCalls(scene::ICameraSceneNode *camnode) PROFILER_POP_CPU_MARKER(); } - /* switch (reason) - { - case GL_ALREADY_SIGNALED: - printf("Already Signaled\n"); - break; - case GL_TIMEOUT_EXPIRED: - printf("Timeout Expired\n"); - break; - case GL_CONDITION_SATISFIED: - printf("Condition Satisfied\n"); - break; - case GL_WAIT_FAILED: - printf("Wait Failed\n"); - break; - }*/ - + PROFILER_PUSH_CPU_MARKER("- particle and text billboard upload", 0x3F, 0x03, 0x61); CPUParticleManager::getInstance()->uploadAll(); diff --git a/src/graphics/lod_node.cpp b/src/graphics/lod_node.cpp index f3215aff2..fa4c06448 100644 --- a/src/graphics/lod_node.cpp +++ b/src/graphics/lod_node.cpp @@ -158,11 +158,14 @@ void LODNode::updateVisibility() if (!isVisible()) return; if (m_nodes.size() == 0) return; - unsigned int level = getLevel(); - - if (m_previous_level != level && !is_in_transition) + // Don't need to run the computation of the level everytime + if ((int)(rand()%5) == 1) + { + m_current_level = getLevel(); + } + + if (m_previous_level != m_current_level && !is_in_transition) { - m_current_level = level; is_in_transition = true; m_timer = 0; } diff --git a/src/graphics/shader_based_renderer.cpp b/src/graphics/shader_based_renderer.cpp index 8035b904a..229b6c502 100644 --- a/src/graphics/shader_based_renderer.cpp +++ b/src/graphics/shader_based_renderer.cpp @@ -235,7 +235,7 @@ void ShaderBasedRenderer::renderSceneDeferred(scene::ICameraSceneNode * const ca } irr_driver->getSceneManager()->setActiveCamera(camnode); - PROFILER_PUSH_CPU_MARKER("- Draw Call Generation", 0xFF, 0xFF, 0xFF); + PROFILER_PUSH_CPU_MARKER("- Draw Call Generation xxx", 0xFF, 0xFF, 0xFF); m_draw_calls.prepareDrawCalls(camnode); PROFILER_POP_CPU_MARKER(); PROFILER_PUSH_CPU_MARKER("Update Light Info", 0xFF, 0x0, 0x0);