From 303e843ff062ab624a28b9036fd74ad111df4b44 Mon Sep 17 00:00:00 2001 From: Ian Chen Date: Mon, 4 Dec 2023 21:05:38 +0000 Subject: [PATCH] Set projector emissive texture (#946) 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 --- ogre2/src/Ogre2Projector.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ogre2/src/Ogre2Projector.cc b/ogre2/src/Ogre2Projector.cc index ef68310de..3ca9eb4a8 100644 --- a/ogre2/src/Ogre2Projector.cc +++ b/ogre2/src/Ogre2Projector.cc @@ -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) { @@ -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); @@ -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()); } }