# Unexpected HightlightLayer effect when using fluid rendering

**URL:** <https://forum.babylonjs.com/t/unexpected-hightlightlayer-effect-when-using-fluid-rendering/38648>\
**Category:** Questions\
**Created:** [March 1, 2023, 3:17pm UTC](https://forum.babylonjs.com/t/unexpected-hightlightlayer-effect-when-using-fluid-rendering/38648 "2023-03-01T15:17:11Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ultcrt](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ultcrt/32/26169_2.png) [@Ultcrt](https://forum.babylonjs.com/u/Ultcrt)\
**Post date:** [March 1, 2023, 3:17pm UTC](https://forum.babylonjs.com/t/unexpected-hightlightlayer-effect-when-using-fluid-rendering/38648/1 "2023-03-01T15:17:11Z")

</div>

Hello,

I was trying to use HightlightLayer and FluidRenderer together, but I got some unexpected effect: the background becomes all back, and the highlighted mesh does not have the same effect when FluidRenderer is disabled.

Here are the playgrounds when FluidRenderer is [enabled](https://playground.babylonjs.com/#544N0Q#56) and [disabled](https://playground.babylonjs.com/#544N0Q#57). The Highlight effect in latter playground is what I expected.

As you can see, two playgrounds give totally different effect. I am not sure it’s a bug or maybe I misunderstood the usage of HighlightLayer?

Looking forward to your reply. Thank you.

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [March 1, 2023, 4:40pm UTC](https://forum.babylonjs.com/t/unexpected-hightlightlayer-effect-when-using-fluid-rendering/38648/2 "2023-03-01T16:40:59Z")

</div>

cc @Evgeni_Popov

---

<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:** [March 1, 2023, 6:05pm UTC](https://forum.babylonjs.com/t/unexpected-hightlightlayer-effect-when-using-fluid-rendering/38648/3 "2023-03-01T18:05:36Z")

</div>

Assigned @Evgeni\_Popov on March 1, 2023, 6:05pm UTC



---

<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:** [March 2, 2023, 2:06pm UTC](https://forum.babylonjs.com/t/unexpected-hightlightlayer-effect-when-using-fluid-rendering/38648/4 "2023-03-02T14:06:37Z")

</div>

This PR will fix the bug:

> <https://github.com/BabylonJS/Babylon.js/pull/13579>
>
> See https://forum.babylonjs.com/t/unexpected-hightlightlayer-effect-when-using-f…luid-rendering/38648

Note however that the cube (and the highlight) will still be deformed by the fluid because it is behind the fountain:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/1/a/1ab541d89a94d9cc77684b2c75fb9569d2649c43.jpeg)

---

<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:** [March 2, 2023, 2:06pm UTC](https://forum.babylonjs.com/t/unexpected-hightlightlayer-effect-when-using-fluid-rendering/38648/5 "2023-03-02T14:06:41Z")

</div>

Unassigned @Evgeni\_Popov on March 2, 2023, 2:06pm UTC



---

<div class="post-metadata">

**Author:** ![Ultcrt](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ultcrt/32/26169_2.png) [@Ultcrt](https://forum.babylonjs.com/u/Ultcrt)\
**Post date:** [March 2, 2023, 2:19pm UTC](https://forum.babylonjs.com/t/unexpected-hightlightlayer-effect-when-using-fluid-rendering/38648/6 "2023-03-02T14:19:13Z")

</div>

Thank you! This is exactly what I want.

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [March 2, 2023, 5:11pm UTC](https://forum.babylonjs.com/t/unexpected-hightlightlayer-effect-when-using-fluid-rendering/38648/7 "2023-03-02T17:11:22Z")

</div>

This effect looks so cool 😃
