# How to hide glow layer when in background

**URL:** <https://forum.babylonjs.com/t/how-to-hide-glow-layer-when-in-background/22315>\
**Category:** Questions\
**Created:** [July 12, 2021, 7:14am UTC](https://forum.babylonjs.com/t/how-to-hide-glow-layer-when-in-background/22315 "2021-07-12T07:14:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mercurio](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mercurio/32/23383_2.png) [@Mercurio](https://forum.babylonjs.com/u/Mercurio)\
**Post date:** [July 12, 2021, 7:14am UTC](https://forum.babylonjs.com/t/how-to-hide-glow-layer-when-in-background/22315/1 "2021-07-12T07:14:56Z")

</div>

Hi there,  
i’ve a scene in which i use some glow effect to higlight some meshes. The problem is that the glow is always visible even if it is hidden by a foreground mesh like in this PG: [Babylon.js Playground](https://playground.babylonjs.com/#URYS75)

I tryed also using two cameras with mask, but in this case the masked mesh is always in foreground even if it is not supposed to be: [https://playground.babylonjs.com/#URYS75#3](https://playground.babylonjs.com/#URYS75#3) (try to rotate the scene: the sphere is always in foreground).

Is there a way to hide the glow effect without using two cameras technique?  
Thanks 😉

EDIT: if i don’t use

> gl.addIncludedOnlyMesh(box); gl.addExcludedMesh(sphere);

it seems to work.

> **[Babylon.js Playground](https://playground.babylonjs.com/#URYS75%238)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

But in this way i don’t know how to include/exclude multiple meshes. In my application i have many meshes that can be higlighted depending on user selection. It is for this reason that i use

> addIncludedOnlyMesh

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [July 12, 2021, 11:27am UTC](https://forum.babylonjs.com/t/how-to-hide-glow-layer-when-in-background/22315/2 "2021-07-12T11:27:28Z")

</div>

You can select several meshes using your method in the last PG:  
[https://playground.babylonjs.com/#URYS75#10](https://playground.babylonjs.com/#URYS75#10)

You can also try to use the highlight layer:  
[https://playground.babylonjs.com/#URYS75#11](https://playground.babylonjs.com/#URYS75#11)

---

<div class="post-metadata">

**Author:** ![Mercurio](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mercurio/32/23383_2.png) [@Mercurio](https://forum.babylonjs.com/u/Mercurio)\
**Post date:** [July 12, 2021, 12:15pm UTC](https://forum.babylonjs.com/t/how-to-hide-glow-layer-when-in-background/22315/3 "2021-07-12T12:15:44Z")

</div>

> [@Evgeni\_Popov](#):
>
> You can also try to use the highlight layer:  
> [https://playground.babylonjs.com/#URYS75#11](https://playground.babylonjs.com/#URYS75#11)

It was my first choice but i’had to abandone it becouse higlight layer requires more calculus and slow down my application. Glow layer is the best for performance issue.  
I’ll try to focus on my last PG. Thank’S
