Skip to content

Commit

Permalink
workaround for setting visual cast shadows without material
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Chen <[email protected]>
  • Loading branch information
iche033 committed Sep 8, 2021
1 parent 7b326dc commit e32b75c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/rendering/SceneManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,14 @@ rendering::VisualPtr SceneManager::CreateVisual(Entity _id,
double productAlpha = (1.0-_visual.Transparency()) *
(1.0 - submeshMat->Transparency());
submeshMat->SetTransparency(1 - productAlpha);

// unlike setting transparency above, the parent submesh are not
// notified about the the cast shadows changes. So we need to set
// the material back to the submesh.
// \todo(anyone) find way to propate cast shadows changes tos submesh
// in ign-rendering
submeshMat->SetCastShadows(_visual.CastShadows());
submesh->SetMaterial(submeshMat);
}
}
}
Expand Down

0 comments on commit e32b75c

Please sign in to comment.