# How to custom color gradient of highlight mesh effect

**URL:** <https://forum.babylonjs.com/t/how-to-custom-color-gradient-of-highlight-mesh-effect/24558>\
**Category:** Questions\
**Tags:** material\
**Created:** [October 14, 2021, 3:22am UTC](https://forum.babylonjs.com/t/how-to-custom-color-gradient-of-highlight-mesh-effect/24558 "2021-10-14T03:22:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![11123](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/11123/32/10880_2.png) [@11123](https://forum.babylonjs.com/u/11123)\
**Post date:** [October 14, 2021, 3:22am UTC](https://forum.babylonjs.com/t/how-to-custom-color-gradient-of-highlight-mesh-effect/24558/1 "2021-10-14T03:22:22Z")

</div>

[https://www.babylonjs-playground.com/#1KUJ0A#1172](https://www.babylonjs-playground.com/#1KUJ0A#1172)

How to set the highlight effect like this?

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/e/d/ed18034d89a6ee3170ea927a96325c57c7d4caa7.jpeg)

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [October 14, 2021, 7:56am UTC](https://forum.babylonjs.com/t/how-to-custom-color-gradient-of-highlight-mesh-effect/24558/2 "2021-10-14T07:56:03Z")

</div>

As long as your shape has smooth edges you can use the oultine renderer: [https://playground.babylonjs.com/#0YG7IF#50](https://playground.babylonjs.com/#0YG7IF#50)

The smooth edge problem is described here: [Render Outline - Buggy - #13 by Evgeni\_Popov](https://forum.babylonjs.com/t/render-outline-buggy/17938/13)

With the solution to smooth them here :[Weird effect when applying overlayColor - #7 by bartbutenaers](https://forum.babylonjs.com/t/weird-effect-when-applying-overlaycolor/24463/7)
