Skip to content

Commit

Permalink
[default_plugin] Enable lighting even when vertex colors are set for …
Browse files Browse the repository at this point in the history
…triangle list.
  • Loading branch information
mmurooka committed Oct 5, 2022
1 parent 440c19a commit ad4ac32
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/rviz/default_plugin/markers/triangle_list_marker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,14 @@ void TriangleListMarker::onNewMessage(const MarkerConstPtr& old_message,

if (has_vertex_colors || has_face_colors)
{
material_->getTechnique(0)->setLightingEnabled(false);
// Ref. https://gamedev.stackexchange.com/a/68342
material_->getTechnique(0)->setLightingEnabled(true);
material_->getTechnique(0)->getPass(0)->setVertexColourTracking(Ogre::TVC_AMBIENT | Ogre::TVC_DIFFUSE | Ogre::TVC_SPECULAR);
}
else
{
material_->getTechnique(0)->setLightingEnabled(true);
material_->getTechnique(0)->getPass(0)->setVertexColourTracking(Ogre::TVC_NONE);
float r, g, b, a;
r = new_message->color.r;
g = new_message->color.g;
Expand Down

0 comments on commit ad4ac32

Please sign in to comment.