Skip to content

Commit

Permalink
Changes the Ogre depth write and scene blending based on the alpha value
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrefranklin committed Apr 6, 2017
1 parent 016a232 commit fa22632
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions grid_map_rviz_plugin/src/GridMapVisual.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,18 @@ void GridMapVisual::computeVisualization(float alpha, bool showGridLines, bool f

manualObject_->end();
material_->getTechnique(0)->setLightingEnabled(false);
material_->getTechnique(0)->setSceneBlending(Ogre::SBT_TRANSPARENT_ALPHA);
material_->getTechnique(0)->setDepthWriteEnabled(false);


if ( alpha < 0.9998 )
{
material_->getTechnique(0)->setSceneBlending( Ogre::SBT_TRANSPARENT_ALPHA );
material_->getTechnique(0)->setDepthWriteEnabled( false );
}
else
{
material_->getTechnique(0)->setSceneBlending( Ogre::SBT_REPLACE );
material_->getTechnique(0)->setDepthWriteEnabled( true );
}
}

void GridMapVisual::setFramePosition(const Ogre::Vector3& position)
Expand Down

0 comments on commit fa22632

Please sign in to comment.