diff --git a/src/gui/plugins/scene3d/Scene3D.cc b/src/gui/plugins/scene3d/Scene3D.cc index 9dab3e058e..7d83f94a44 100644 --- a/src/gui/plugins/scene3d/Scene3D.cc +++ b/src/gui/plugins/scene3d/Scene3D.cc @@ -2019,6 +2019,8 @@ void IgnRenderer::Initialize() auto root = scene->RootVisual(); + scene->SetCameraPassCountPerGpuFlush(6u); + // Camera this->dataPtr->camera = scene->CreateCamera(); root->AddChild(this->dataPtr->camera); diff --git a/src/systems/sensors/Sensors.cc b/src/systems/sensors/Sensors.cc index a20b5c3280..9ee719e708 100644 --- a/src/systems/sensors/Sensors.cc +++ b/src/systems/sensors/Sensors.cc @@ -196,6 +196,7 @@ void SensorsPrivate::WaitForInit() igndbg << "Initializing render context" << std::endl; this->renderUtil.Init(); this->scene = this->renderUtil.Scene(); + this->scene->SetCameraPassCountPerGpuFlush(6u); this->initialized = true; } @@ -262,6 +263,15 @@ void SensorsPrivate::RunOnce() // publish data IGN_PROFILE("RunOnce"); this->sensorManager.RunOnce(this->updateTime); + } + + { + IGN_PROFILE("PostRender"); + // Update the scene graph manually to improve performance + // We only need to do this once per frame It is important to call + // sensors::RenderingSensor::SetManualSceneUpdate and set it to true + // so we don't waste cycles doing one scene graph update per sensor + this->scene->PostRender(); this->eventManager->Emit(); }