# Draw on top of a depth test disabled mesh

**URL:** <https://community.cesium.com/t/draw-on-top-of-a-depth-test-disabled-mesh/21639>\
**Category:** CesiumJS\
**Created:** [December 18, 2022, 10:35pm UTC](https://community.cesium.com/t/draw-on-top-of-a-depth-test-disabled-mesh/21639 "2022-12-18T22:35:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ka\_sc](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/ka_sc/32/2397_2.png) [@ka\_sc](https://community.cesium.com/u/ka_sc)\
**Post date:** [December 18, 2022, 10:35pm UTC](https://community.cesium.com/t/draw-on-top-of-a-depth-test-disabled-mesh/21639/1 "2022-12-18T22:35:35Z")

</div>

I am probably unable to change depth test disabled in my app but users still expect the yellow line to appear on top of the polygons.  
Anything I could do to make that happen? Other than a bill board with a shader or similar hacks?  
disableDepthTestDistance isnt for lines is it?

Thanks for your help

![image](https://global.discourse-cdn.com/cesium/original/3X/2/3/2308f5bd04649cae1d789c9021e1bbacc89e5c3a.jpeg)

---

<div class="post-metadata">

**Author:** ![ka\_sc](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/ka_sc/32/2397_2.png) [@ka\_sc](https://community.cesium.com/u/ka_sc)\
**Post date:** [December 21, 2022, 1:11am UTC](https://community.cesium.com/t/draw-on-top-of-a-depth-test-disabled-mesh/21639/2 "2022-12-21T01:11:51Z")

</div>

For points disableDepthTestDistance: Number.POSITIVE\_INFINITY does the trick but lines and polys?

Should i still look into hacking PolylineCollection  
[Disable Depth Test For Polylines and Polygons - #2 by swissolo](https://community.cesium.com/t/disable-depth-test-for-polylines-and-polygons/7312/2)

---

<div class="post-metadata">

**Author:** ![Gabby\_Getz](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/gabby_getz/32/7838_2.png) [@Gabby\_Getz](https://community.cesium.com/u/Gabby_Getz)\
**Post date:** [December 21, 2022, 2:10pm UTC](https://community.cesium.com/t/draw-on-top-of-a-depth-test-disabled-mesh/21639/3 "2022-12-21T14:10:19Z")

</div>

Hi there,

Maybe a depth fail material would work for your case? [This sandcastle](https://sandcastle.cesium.com/index.html?src=Sample%20Height%20from%203D%20Tiles.html) contains an example of how to use them. Though it will only work for static polylines, [not dynamic](https://github.com/CesiumGS/cesium/issues/5333).

---

<div class="post-metadata">

**Author:** ![ka\_sc](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/ka_sc/32/2397_2.png) [@ka\_sc](https://community.cesium.com/u/ka_sc)\
**Post date:** [December 21, 2022, 11:07pm UTC](https://community.cesium.com/t/draw-on-top-of-a-depth-test-disabled-mesh/21639/4 "2022-12-21T23:07:25Z")

</div>

Its dynamic lines as in the user can draw and change it maybe i am misunderstanding the definition of dynamic. Does it mean animated? I tested and saw no change. The surface is transparent if that matteras

Passes seem to not help me either. Can i just patch renderState in Source/Scene/PolylineMaterialAppearance.js?  
Or a GroundPolylinePrimitive doesnt work. Postprocess?

---

<div class="post-metadata">

**Author:** ![Aman\_Savita](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/aman_savita/32/15928_2.png) [@Aman\_Savita](https://community.cesium.com/u/Aman_Savita)\
**Post date:** [September 7, 2023, 5:39am UTC](https://community.cesium.com/t/draw-on-top-of-a-depth-test-disabled-mesh/21639/5 "2023-09-07T05:39:53Z")

</div>

Kscwjs
