# Dashed polyline material

**URL:** <https://community.cesium.com/t/dashed-polyline-material/1568>\
**Category:** CesiumJS\
**Created:** [October 9, 2014, 2:17pm UTC](https://community.cesium.com/t/dashed-polyline-material/1568 "2014-10-09T14:17:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guillaume\_Beraudo](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/guillaume_beraudo/32/2985_2.png) [@Guillaume\_Beraudo](https://community.cesium.com/u/Guillaume_Beraudo)\
**Post date:** [October 9, 2014, 2:17pm UTC](https://community.cesium.com/t/dashed-polyline-material/1568/1 "2014-10-09T14:17:56Z")

</div>

Hello,

I am evaluating what it would take to implement a dashed polyline  
material.  
The properties would be:  
- even and odd colors;  
- even and odd line lengths;  
- granularity according to distance.

The stripe material, using 'horizontal: false', fits the first property  
and looks like a good start. Are there materials with a 'scaleByDistance'  
property, similar to the Billboard?

For clarity, here attached is a sample using ol3 on the left and the  
stripe material on the right.

BR,

 ![ol3cs_dashed_line.jpg](https://global.discourse-cdn.com/cesium/original/1X/012628d431a920fca57bd55ef300049756a9d0fc.jpeg)

---

<div class="post-metadata">

**Author:** ![patrick](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/patrick/32/2045_2.png) [@patrick](https://community.cesium.com/u/patrick)\
**Post date:** [October 10, 2014, 12:28pm UTC](https://community.cesium.com/t/dashed-polyline-material/1568/2 "2014-10-10T12:28:58Z")

</div>

Hi Guillaume,

This paper is a good start: [http://jcgt.org/published/0002/02/08/](http://jcgt.org/published/0002/02/08/)

I don’t think anything other than Billboard has scaleByDistance, but its implementation is straightforward ([see here](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Shaders/BillboardCollectionVS.glsl#L27)).

Patrick

---

<div class="post-metadata">

**Author:** ![Guillaume\_Beraudo](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/guillaume_beraudo/32/2985_2.png) [@Guillaume\_Beraudo](https://community.cesium.com/u/Guillaume_Beraudo)\
**Post date:** [October 10, 2014, 12:56pm UTC](https://community.cesium.com/t/dashed-polyline-material/1568/3 "2014-10-10T12:56:07Z")

</div>

Hi Patrick,

Thank you for the link.

BR,

Guillaume
