# Globe Materials - Custom Shader

**URL:** <https://community.cesium.com/t/globe-materials-custom-shader/18134>\
**Category:** CesiumJS\
**Created:** [April 12, 2022, 8:56am UTC](https://community.cesium.com/t/globe-materials-custom-shader/18134 "2022-04-12T08:56:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ruediger\_Brand](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/ruediger_brand/32/4004_2.png) [@Ruediger\_Brand](https://community.cesium.com/u/Ruediger_Brand)\
**Post date:** [April 12, 2022, 8:56am UTC](https://community.cesium.com/t/globe-materials-custom-shader/18134/1 "2022-04-12T08:56:30Z")

</div>

Hi,

does anyone has experiences with globe materials.

Is it possible to use a customShader for GlobeMaterials or could I specify an area of the globe for which I can use a GlobeMaterial, i.e. visibility, viewshed

Regards

Rüdiger

---

<div class="post-metadata">

**Author:** ![sam.rothstein](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/sam.rothstein/32/6584_2.png) [@sam.rothstein](https://community.cesium.com/u/sam.rothstein)\
**Post date:** [April 12, 2022, 9:02pm UTC](https://community.cesium.com/t/globe-materials-custom-shader/18134/3 "2022-04-12T21:02:22Z")

</div>

Hi @Ruediger_Brand,

Thank you for bringing the community your question. `CustomShader` is not supported for the globe (only 3D Tiles or models).

Can you please share more information on what you mean by visibility and viewshed?

Looking forward to learning more.

-Sam

---

<div class="post-metadata">

**Author:** ![Gu-Miao](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/gu-miao/32/6222_2.png) [@Gu-Miao](https://community.cesium.com/u/Gu-Miao)\
**Post date:** [April 13, 2022, 3:07am UTC](https://community.cesium.com/t/globe-materials-custom-shader/18134/4 "2022-04-13T03:07:42Z")

</div>

You could create a `Material` instance and use it with `viewer.scene.globe.material = material`. See `Source/shaders/GlobeFS.glsl` to go deeper.  
If you want to only show a part of globe, maybe you could use `clippingPlanes` for globe.

---

<div class="post-metadata">

**Author:** ![sam.rothstein](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/sam.rothstein/32/6584_2.png) [@sam.rothstein](https://community.cesium.com/u/sam.rothstein)\
**Post date:** [April 13, 2022, 2:23pm UTC](https://community.cesium.com/t/globe-materials-custom-shader/18134/5 "2022-04-13T14:23:14Z")

</div>

Hi @Gu-Miao! Great suggestion, thanks 🚀

---

<div class="post-metadata">

**Author:** ![Ruediger\_Brand](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/ruediger_brand/32/4004_2.png) [@Ruediger\_Brand](https://community.cesium.com/u/Ruediger_Brand)\
**Post date:** [April 13, 2022, 4:43pm UTC](https://community.cesium.com/t/globe-materials-custom-shader/18134/6 "2022-04-13T16:43:09Z")

</div>

@sam.rothstein @Gu-Miao

Hi,

I think about doing visibility calculations, i.e. calculation of a viewshed in a shader. We use a vertex-shader for visibility calculations in a 3D-Tileset, so the idea was -could I use this for the globe/terrain as well. Our inspiration was the elevation/slope-Material

Regards

Rüiger
