How to avoid highlight from HighlightLayer bending around objects?

In this example I don’t want the red highlight to curve around the sphere, better to just be blocked by the sphere. This is because otherwise, if the sphere is compeltely infront of the ground, it looks like I’m highlighting both the sphere and the ground when I only want to highlight the ground

This is what I want, any easy way to get it?:

highLightLayer1.addExcludedMesh(sphere);
2 Likes

You can also set the renderingGroupId property of the sphere to a higher value than the one of the ground (which is 0 by default) so that it is drawn above:

3 Likes