# How to make this mask effect

**URL:** <https://community.cesium.com/t/how-to-make-this-mask-effect/11886>\
**Category:** CesiumJS\
**Created:** [December 31, 2020, 12:47am UTC](https://community.cesium.com/t/how-to-make-this-mask-effect/11886 "2020-12-31T00:47:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lzio](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/lzio/32/3983_2.png) [@lzio](https://community.cesium.com/u/lzio)\
**Post date:** [December 31, 2020, 12:47am UTC](https://community.cesium.com/t/how-to-make-this-mask-effect/11886/1 "2020-12-31T00:47:30Z")

</div>

![6ZQ~O1M%TARO38~4EQH4I8](https://global.discourse-cdn.com/cesium/original/2X/e/ec65a2cbe44d798ff74fd5fd4b91c7d177c95494.jpeg)  
Thanks for help

---

<div class="post-metadata">

**Author:** ![lzio](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/lzio/32/3983_2.png) [@lzio](https://community.cesium.com/u/lzio)\
**Post date:** [December 31, 2020, 2:41am UTC](https://community.cesium.com/t/how-to-make-this-mask-effect/11886/2 "2020-12-31T02:41:54Z")

</div>

i tried to use polygon with holes, but i found the polygon can’t cover whole globe, so anyway can make this happen?

---

<div class="post-metadata">

**Author:** ![hannah](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/hannah/32/4509_2.png) [@hannah](https://community.cesium.com/u/hannah)\
**Post date:** [January 4, 2021, 5:26pm UTC](https://community.cesium.com/t/how-to-make-this-mask-effect/11886/3 "2021-01-04T17:26:14Z")

</div>

Hello @lzio,

In order to accomplish something like this, you would have to write a custom globe material, which would involve writing a custom shader that adds a color to the globe everywhere outside the bounds of a polygonal region. You can see other custom globe materials in this sandcastle example: [Cesium Sandcastle](https://sandcastle.cesium.com/?src=Globe%20Materials.html&label=All)  
And the Materials are defined here: [cesium/Material.js at master · CesiumGS/cesium · GitHub](https://github.com/CesiumGS/cesium/blob/master/Source/Scene/Material.js#L1707)

Best regards,

Hannah  
Cesium Staff

---

<div class="post-metadata">

**Author:** ![lzio](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/lzio/32/3983_2.png) [@lzio](https://community.cesium.com/u/lzio)\
**Post date:** [January 5, 2021, 1:56am UTC](https://community.cesium.com/t/how-to-make-this-mask-effect/11886/4 "2021-01-05T01:56:06Z")

</div>

Hi hannah,

That’s exactly what I want!

Thanks for the reply.

lzio
