Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Gazebo aware of SetCameraPassCountPerGpuFlush #921

Merged
merged 6 commits into from
Jul 22, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/gui/plugins/scene3d/Scene3D.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2019,6 +2019,8 @@ void IgnRenderer::Initialize()

auto root = scene->RootVisual();

scene->SetCameraPassCountPerGpuFlush( 6u );
darksylinc marked this conversation as resolved.
Show resolved Hide resolved

// Camera
this->dataPtr->camera = scene->CreateCamera();
root->AddChild(this->dataPtr->camera);
Expand Down
10 changes: 10 additions & 0 deletions src/systems/sensors/Sensors.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
darksylinc marked this conversation as resolved.
Show resolved Hide resolved
this->initialized = true;
}

Expand Down Expand Up @@ -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<events::PostRender>();
}

Expand Down