Detecting occlusion on one mesh effects bounding box of another mesh

Hi all! I’ve discovered an interesting but strange bug recently. Not sure what to make it of it really. In my program, I use a method to highlight the outline of an object when it is occluded but i’ve recently taken notice that when that object is occluded and the outline effect is added it also triggers what looks to be the built-in occlusion highlight effect of babylon’s bounding box on a completely different object! Not sure why that might be happening as they are two separate objects all together.

Have re-created the bug in this PG: Babylon.js Playground

Would love to hear what you you guys make of this. Not sure if I should have posted this as a question or bug so i’ve done both.

Hey there! There’s a setting on the HighlightLayer to exclude bounding boxes from the effect: HighlightLayer | Babylon.js Documentation (babylonjs.com)

Setting deglows (…is that even a word?) the mesh Occlusion of one mesh triggers bounding box effect | Babylon.js Playground (babylonjs.com) :smiley:

Thanks so much @carolhmj don’t know how i missed that flag when I looked over the docs. Setting it to true did the trick.

1 Like