Experimental changes

This commit is contained in:
samuncle 2019-03-01 21:39:55 +01:00
parent 837a9ee3ea
commit eead6f6005
3 changed files with 18 additions and 24 deletions

View File

@ -146,10 +146,10 @@ void DrawCalls::parseSceneManager(core::list<scene::ISceneNode*> &List,
{ {
node->updateVisibility(); node->updateVisibility();
} }
(*I)->updateAbsolutePosition();
if (!(*I)->isVisible()) if (!(*I)->isVisible())
continue; continue;
(*I)->updateAbsolutePosition();
if (STKParticle *node = dynamic_cast<STKParticle*>(*I)) if (STKParticle *node = dynamic_cast<STKParticle*>(*I))
{ {
if (!isCulledPrecise(cam, *I, irr_driver->getBoundingBoxesViz())) if (!isCulledPrecise(cam, *I, irr_driver->getBoundingBoxesViz()))
@ -202,11 +202,17 @@ void DrawCalls::prepareDrawCalls(scene::ICameraSceneNode *camnode)
{ {
CPUParticleManager::getInstance()->reset(); CPUParticleManager::getInstance()->reset();
TextBillboardDrawer::reset(); TextBillboardDrawer::reset();
PROFILER_PUSH_CPU_MARKER("- culling", 0xFF, 0xFF, 0x0); PROFILER_PUSH_CPU_MARKER("- prepare draw call", 0xFF, 0xFF, 0x0);
SP::prepareDrawCalls(); SP::prepareDrawCalls();
PROFILER_POP_CPU_MARKER();
PROFILER_PUSH_CPU_MARKER("-- parse scene manager", 0x00, 0xFF, 0x0);
parseSceneManager( parseSceneManager(
irr_driver->getSceneManager()->getRootSceneNode()->getChildren(), irr_driver->getSceneManager()->getRootSceneNode()->getChildren(),
camnode); camnode);
PROFILER_POP_CPU_MARKER();
PROFILER_PUSH_CPU_MARKER("-- handle dynamic draw", 0x00, 0xFF, 0x0);
SP::handleDynamicDrawCall(); SP::handleDynamicDrawCall();
SP::updateModelMatrix(); SP::updateModelMatrix();
PROFILER_POP_CPU_MARKER(); PROFILER_POP_CPU_MARKER();
@ -214,7 +220,7 @@ void DrawCalls::prepareDrawCalls(scene::ICameraSceneNode *camnode)
PROFILER_PUSH_CPU_MARKER("- cpu particle generation", 0x2F, 0x1F, 0x11); PROFILER_PUSH_CPU_MARKER("- cpu particle generation", 0x2F, 0x1F, 0x11);
CPUParticleManager::getInstance()->generateAll(); CPUParticleManager::getInstance()->generateAll();
PROFILER_POP_CPU_MARKER(); PROFILER_POP_CPU_MARKER();
// Add a 1 s timeout // Add a 1 s timeout
if (m_sync != 0) if (m_sync != 0)
{ {
@ -233,22 +239,7 @@ void DrawCalls::prepareDrawCalls(scene::ICameraSceneNode *camnode)
PROFILER_POP_CPU_MARKER(); 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, PROFILER_PUSH_CPU_MARKER("- particle and text billboard upload", 0x3F,
0x03, 0x61); 0x03, 0x61);
CPUParticleManager::getInstance()->uploadAll(); CPUParticleManager::getInstance()->uploadAll();

View File

@ -158,11 +158,14 @@ void LODNode::updateVisibility()
if (!isVisible()) return; if (!isVisible()) return;
if (m_nodes.size() == 0) return; if (m_nodes.size() == 0) return;
unsigned int level = getLevel(); // Don't need to run the computation of the level everytime
if ((int)(rand()%5) == 1)
if (m_previous_level != level && !is_in_transition) {
m_current_level = getLevel();
}
if (m_previous_level != m_current_level && !is_in_transition)
{ {
m_current_level = level;
is_in_transition = true; is_in_transition = true;
m_timer = 0; m_timer = 0;
} }

View File

@ -235,7 +235,7 @@ void ShaderBasedRenderer::renderSceneDeferred(scene::ICameraSceneNode * const ca
} }
irr_driver->getSceneManager()->setActiveCamera(camnode); 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); m_draw_calls.prepareDrawCalls(camnode);
PROFILER_POP_CPU_MARKER(); PROFILER_POP_CPU_MARKER();
PROFILER_PUSH_CPU_MARKER("Update Light Info", 0xFF, 0x0, 0x0); PROFILER_PUSH_CPU_MARKER("Update Light Info", 0xFF, 0x0, 0x0);