From 8e4298558039720fb5c832cb661097f564ae5beb Mon Sep 17 00:00:00 2001 From: Ian Chen Date: Tue, 17 Sep 2024 21:22:06 +0000 Subject: [PATCH 1/2] Revert "Fix using lightmap and emissive map together (#1047)" This reverts commit 6ec0c520f28a61b9505ada49d21adcf92e31b291. --- ogre2/src/Ogre2Material.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/ogre2/src/Ogre2Material.cc b/ogre2/src/Ogre2Material.cc index 95db59a1c..70cc66959 100644 --- a/ogre2/src/Ogre2Material.cc +++ b/ogre2/src/Ogre2Material.cc @@ -753,10 +753,14 @@ void Ogre2Material::SetLightMap(const std::string &_name, this->dataPtr->lightMapData = _img; this->lightMapUvSet = _uvSet; - // Apply lightmap by using the detail map slot to store the lightmap texture - // and blending it with the diffuse map. - Ogre::PbsTextureTypes type = Ogre::PBSM_DETAIL0; - this->ogreDatablock->setDetailMapBlendMode(0, Ogre::PBSM_BLEND_OVERLAY); + // in gz-rendering5 + ogre 2.1, we reserved detail map 0 for light map + // and set a blend mode (PBSM_BLEND_OVERLAY AND PBSM_BLEND_MULTIPLY2X + // produces better results) to blend with base albedo map. However, this + // creates unwanted red highlights with ogre 2.2. So switching to use the + // emissive map slot and calling setUseEmissiveAsLightmap(true) + // Ogre::PbsTextureTypes type = Ogre::PBSM_DETAIL0; + // this->ogreDatablock->setDetailMapBlendMode(0, Ogre::PBSM_BLEND_OVERLAY); + Ogre::PbsTextureTypes type = Ogre::PBSM_EMISSIVE; // lightmap usually uses a different tex coord set if (_img == nullptr) @@ -764,6 +768,7 @@ void Ogre2Material::SetLightMap(const std::string &_name, else this->SetTextureMapDataImpl(this->lightMapName, _img, type); this->ogreDatablock->setTextureUvSource(type, this->lightMapUvSet); + this->ogreDatablock->setUseEmissiveAsLightmap(true); } ////////////////////////////////////////////////// From 8835b390e11cde01b1a6e71c4525b3efb174da83 Mon Sep 17 00:00:00 2001 From: "Athena Z." Date: Wed, 18 Sep 2024 16:09:54 -0500 Subject: [PATCH 2/2] Add macOS instructions for render_order tutorial (#1069) Signed-off-by: Athena Z --- tutorials/21_render_order.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tutorials/21_render_order.md b/tutorials/21_render_order.md index 334204ef5..d082303e0 100644 --- a/tutorials/21_render_order.md +++ b/tutorials/21_render_order.md @@ -48,5 +48,9 @@ make Execute the example: ```{.sh} +# Linux (defaults to using ogre1) ./simple_demo + +# macOS (ogre1 is not supported on macOS, but ogre2 is) +./simple_demo ogre2 ```