I just try to use the HighlightLayer in my project, and I see how to process renderGroups from the doc. But when I try it in my project, the meshes using renderGroupId will not be rendered in the foreground. Are there any cases I should focus on ?
Here is the demo:
https://playground.babylonjs.com/?inspectorv2=true#1KUJ0A#2783
I know that, I make that on porpose. My question is why when I make the autoClear to false the mesh will not be rendered in the foregroud
I just don’t get it. Why when I disabled the target renderGroup buffer clearing, the meshes in the target renderGroup will not be in front of other groups. Should I use some cases I don’t know?
Having meshes with different renderingGroupId in a single highlight layer is not supported. What’s supported is to pass a renderingGroupId to the HighlightLayer constructor, and only meshes with the same renderingGroupId will be rendered in the layer. But it’s not possible to mix different ids in the same layer.
You’re not in the same case as the documentation describes: the small sphere is not always in front of the other meshes, it’s inside the big sphere. The sentence is not about what you would like to achieve, it’s about what really happens: given the positions of the spheres, the small one is not always in front of the big one.
If you want the red sphere to always be in front of the other one, you can disable depth testing:
https://playground.babylonjs.com/?inspectorv2=true#1KUJ0A#2784
Got it! Thanks for your help. It’s exactly what I am confused that what does the “in front of“ mean.Thanks for your explanation.![]()


