You should draw last (create last) the element to exclude to ensure that the stencil buffer is not erased by them: https://www.babylonjs-playground.com/#2338DN#2
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Highlight layer issues with excluded meshes | 6 | 811 | November 17, 2021 | |
| Highhight of object A is uncorrect if object A is behind object B and is created later than object B | 7 | 356 | July 31, 2022 | |
| Highlight occluded | 18 | 1005 | June 23, 2024 | |
| Highlight effect on transparent object is not visible behind an opaque object | 4 | 715 | September 30, 2022 | |
| Stencil buffer and HighlightLayer | 17 | 105 | February 24, 2026 |