Skip to content

Commit

Permalink
[Metal] Revert RenderOrder is in different scale in Reverse Z gazebos…
Browse files Browse the repository at this point in the history
…im#514

Signed-off-by: Rhys Mainwaring <[email protected]>

gazebosim#514 causes render order issues for Metal - reverting until resolved.
  • Loading branch information
srmainwaring committed Feb 5, 2022
1 parent 7498432 commit 1fc616c
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions ogre2/src/Ogre2Material.cc
Original file line number Diff line number Diff line change
Expand Up @@ -313,22 +313,7 @@ void Ogre2Material::SetRenderOrder(const float _renderOrder)
this->renderOrder = _renderOrder;
Ogre::HlmsMacroblock macroblock(
*this->ogreDatablock->getMacroblock());

Ogre::Root *root = Ogre2RenderEngine::Instance()->OgreRoot();
Ogre::RenderSystem *renderSystem = root->getRenderSystem();

if (renderSystem->isReverseDepth())
{
// Reverse depth needs 100x scale AND ends up being superior
// See https://github.com/ignitionrobotics/ign-rendering/
// issues/427#issuecomment-991800352
// and see https://www.youtube.com/watch?v=s2XdH3fYUac
macroblock.mDepthBiasConstant = _renderOrder * 100.0f;
}
else
{
macroblock.mDepthBiasConstant = _renderOrder;
}
macroblock.mDepthBiasConstant = _renderOrder;
this->ogreDatablock->setMacroblock(macroblock);
}

Expand Down

0 comments on commit 1fc616c

Please sign in to comment.