Skip to content

Commit

Permalink
Set projector emissive texture (#946)
Browse files Browse the repository at this point in the history
Set projector emissive texture to be the same as the diffuse texture in ogre 2.x implementation for a more consistent result with the ogre 1.x implementation

Signed-off-by: Ian Chen <ichen@openrobotics.org>
  • Loading branch information
iche033 authored Dec 4, 2023
1 parent c42123e commit 303e843
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ogre2/src/Ogre2Projector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ void Ogre2Projector::UpdateCameraListener()
this->dataPtr->decalNode->setVisible(true);
this->dataPtr->decalNode->getCreator()->setDecalsDiffuse(
this->dataPtr->decal->getDiffuseTexture());
this->dataPtr->decalNode->getCreator()->setDecalsEmissive(
this->dataPtr->decal->getEmissiveTexture());

for (auto &ogreCamIt : this->dataPtr->camerasWithListener)
{
Expand Down Expand Up @@ -276,6 +278,7 @@ void Ogre2Projector::CreateProjector()
Ogre::GpuResidency::Resident);

this->dataPtr->decal->setDiffuseTexture(this->dataPtr->textureDiff);
this->dataPtr->decal->setEmissiveTexture(this->dataPtr->textureDiff);

// approximate frustum size
common::Image image(this->textureName);
Expand Down Expand Up @@ -332,6 +335,8 @@ void Ogre2ProjectorCameraListener::cameraPreRenderScene(
this->decalNode->setVisible(true);
this->decalNode->getCreator()->setDecalsDiffuse(
this->decal->getDiffuseTexture());
this->decalNode->getCreator()->setDecalsEmissive(
this->decal->getEmissiveTexture());
}
}

Expand Down

0 comments on commit 303e843

Please sign in to comment.