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

Cherry-pick LensFlare api changes to 11 #2974

Merged
merged 4 commits into from
Apr 20, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
11 changes: 3 additions & 8 deletions gazebo/rendering/DepthCamera.cc
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ void DepthCamera::CreateDepthTexture(const std::string &_textureName)
this->SetDepthTarget(this->depthTarget);

this->depthViewport->setOverlaysEnabled(false);
this->depthViewport->setShadowsEnabled(false);
this->depthViewport->setBackgroundColour(
Ogre::ColourValue(Ogre::ColourValue(0, 0, 0)));

Expand Down Expand Up @@ -282,6 +283,7 @@ void DepthCamera::CreateDepthTexture(const std::string &_textureName)
this->dataPtr->pcdViewport->setBackgroundColour(
Conversions::Convert(ignBG));
this->dataPtr->pcdViewport->setOverlaysEnabled(false);
this->dataPtr->pcdViewport->setShadowsEnabled(false);
this->dataPtr->pcdViewport->setVisibilityMask(
GZ_VISIBILITY_ALL & ~(GZ_VISIBILITY_GUI | GZ_VISIBILITY_SELECTABLE));

Expand Down Expand Up @@ -378,6 +380,7 @@ void DepthCamera::CreateNormalsTexture(const std::string &_textureName)
this->dataPtr->normalsViewport->setBackgroundColour(
Conversions::Convert(ignBG));
this->dataPtr->normalsViewport->setOverlaysEnabled(false);
this->dataPtr->normalsViewport->setShadowsEnabled(false);
this->dataPtr->normalsViewport->setVisibilityMask(
GZ_VISIBILITY_ALL & ~(GZ_VISIBILITY_GUI | GZ_VISIBILITY_SELECTABLE));

Expand Down Expand Up @@ -602,9 +605,6 @@ void DepthCamera::RenderImpl()
{
Ogre::SceneManager *sceneMgr = this->scene->OgreSceneManager();

Ogre::ShadowTechnique shadowTech = sceneMgr->getShadowTechnique();

sceneMgr->setShadowTechnique(Ogre::SHADOWTYPE_NONE);
sceneMgr->_suppressRenderStateChanges(true);

this->UpdateRenderTarget(this->depthTarget,
Expand All @@ -614,14 +614,12 @@ void DepthCamera::RenderImpl()
this->depthTarget->update(false);

sceneMgr->_suppressRenderStateChanges(false);
sceneMgr->setShadowTechnique(shadowTech);

// for camera image
Camera::RenderImpl();

if (this->dataPtr->outputPoints)
{
sceneMgr->setShadowTechnique(Ogre::SHADOWTYPE_NONE);
sceneMgr->_suppressRenderStateChanges(true);

this->UpdateRenderTarget(this->dataPtr->pcdTarget,
Expand All @@ -630,7 +628,6 @@ void DepthCamera::RenderImpl()
this->dataPtr->pcdTarget->update(false);

sceneMgr->_suppressRenderStateChanges(false);
sceneMgr->setShadowTechnique(shadowTech);
}

if (this->dataPtr->outputReflectance)
Expand All @@ -640,7 +637,6 @@ void DepthCamera::RenderImpl()

if (this->dataPtr->outputNormals)
{
sceneMgr->setShadowTechnique(Ogre::SHADOWTYPE_NONE);
sceneMgr->_suppressRenderStateChanges(true);

this->UpdateRenderTarget(this->dataPtr->normalsTarget,
Expand All @@ -649,7 +645,6 @@ void DepthCamera::RenderImpl()
this->dataPtr->normalsTarget->update(false);

sceneMgr->_suppressRenderStateChanges(false);
sceneMgr->setShadowTechnique(shadowTech);
}
}

Expand Down
Loading