# How to render only the solid parts above the ground？

**URL:** <https://community.cesium.com/t/how-to-render-only-the-solid-parts-above-the-ground/39961>\
**Category:** CesiumJS\
**Created:** [April 13, 2025, 11:34am UTC](https://community.cesium.com/t/how-to-render-only-the-solid-parts-above-the-ground/39961 "2025-04-13T11:34:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Keei](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/keei/32/28987_2.png) [@Keei](https://community.cesium.com/u/Keei)\
**Post date:** [April 13, 2025, 11:34am UTC](https://community.cesium.com/t/how-to-render-only-the-solid-parts-above-the-ground/39961/1 "2025-04-13T11:34:55Z")

</div>

When I add a cylindrical solid to the scene, I notice that the part below the ground is still visible. Is there any way to display only the portion above the ground?

 ![image](https://global.discourse-cdn.com/cesium/original/3X/1/b/1b84ce136b403de02c535741ca6bdf02a171a95c.jpeg)

> **[Cesium Sandcastle](https://sandcastle.cesium.com/#c=bZHRa4MwEMb/lcMnCxKVbmM6W7a1exsMOtiTL6meNSzmJIntXOn/vqijFNq33C/f991dUpAyFvYCD6hhAQoPsEIjuoZ9jczPvWKsV6QsFwp17gVwhFwBCFXRK/2kUHFp0KHT7ClXuSrGTFRW2N5lTuFsrAUaxsvSPw5+xRtMIfcmpcsdYEvGyUill7OsuLbuxNWcVZqaNe40ovHjOGFJkgQwjwKIZqO/6KVQJeoUxh4AltoNL0Vn0jt8CCa2JWupucIS1c7W6eMZGCnc9mkcRf+g4Ra14DI9T0aSNNu8rdlB2PpFtjX3I3Y/zXIKzm/iBV5mbC9xOQUBPIumJW2h09JnLLTYtNKlm3DbFd9oWWHMYB2kWXhpzUqxB1EubvwMFJIb426qTspP8Yu5t8xCp7+ySnLLq93HHrXk/SCr4+X7BBljWejK205LJLdcXyRPij8)**
>
> The Cesium Sandcastle provides an interactive environment for testing Cesium code.

---

<div class="post-metadata">

**Author:** ![Marco13](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/marco13/32/2757_2.png) [@Marco13](https://community.cesium.com/u/Marco13)\
**Post date:** [April 13, 2025, 11:40am UTC](https://community.cesium.com/t/how-to-render-only-the-solid-parts-above-the-ground/39961/2 "2025-04-13T11:40:46Z")

</div>

The way how it _currently_ looks is strange. It looks like the cylinder is _partially_ visible in _some_ areas. This might be a bug, and may have to be investigated (or, first of all, _confirmed_ as a bug) by someone from the CesiumJS core team.

However, the fix for now might just be to set  
`viewer.scene.globe.depthTestAgainstTerrain = true;`

> **[Cesium Sandcastle](https://sandcastle.cesium.com/#c=bZFBb6MwEIX/yogTlZAhSrvasCRqm/ZWaaVutScuDkzA6jBG9pA0W/W/r4GoitTePJ/fe/MwlWUvcDB4RAdrYDzCFr0ZOvV3YnEZVdO8tSzaMLoySuAdSgYwvLf39i2HvSaPAX1c/Sp5zlK+QkbVkN2hqrGX9gW93DUhwssLOhcOYZ+4AYOn5GrqgSxGToGfQ6bZoFe6ruP3cSfrDnMoo1kZuoywtz7ILOeX/bfaSThpXqq9s90DNg7Rx4vFSq1WqwSWWQLZ1eSvTmS4RpfDtANAbP+sazP4/Bp/JDPbWRHbfcGE3Eib//wEnkx4sXyRZWfQaUFnNOWfzSxZp54fH9TRSHtHfavjTN3MXT6S8zuWHCVR4eVEuJmDAG5N11snMDiKlUoFu55Cuk93Q/WKoirvR+soLdJLa1GbA5h6/c3fhIq09+FmPxD9Mf+wjDZFGvRfrGTDx3Pz+4CO9GmUtYvN0wyVUkUaxu+dYi3ttLtInhX/AQ)**
>
> The Cesium Sandcastle provides an interactive environment for testing Cesium code.

---

<div class="post-metadata">

**Author:** ![ZhefengJin](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/zhefengjin/32/11504_2.png) [@ZhefengJin](https://community.cesium.com/u/ZhefengJin)\
**Post date:** [April 14, 2025, 1:39am UTC](https://community.cesium.com/t/how-to-render-only-the-solid-parts-above-the-ground/39961/3 "2025-04-14T01:39:25Z")

</div>

not strange.  
It is very understandable.  
You should enable “Depth Test”.

```auto
viewer.scene.globe.depthTestAgainstTerrain = true;

```
