How do I create a custom dash style?

  • updated


I am trying to render directional dashed lines in immediate mode. By this I mean that I'd like to have the dashes display as chevrons or arrows pointing from one end to the other to convey directionality.

Image 708

I've already located the line-dash-angled and modified the .png to be in the shape I want and have confirmed that the correct texture is set in the "Line Dash Style Angled" field of the Shapes UI Assets ScriptableObject instance. I also ran the "Regenerate Shaders & Materials" operation in the Shapes Settings window.

However, when drawing the lines, they still show up as the original angled style.

Image 707

Is there anything else I may be able to set to get the dashed lines displaying in my custom style in immediate mode?

Thanks in advance and thank you for the awesome asset!

Reporting a bug? please specify Unity version:
Reporting a bug? please specify Shapes version:
Reporting a bug? please specify Render Pipeline:
Freya Holmér creator

that texture is only in the UI, the actual dash shape itself is procedurally made in shader code unfortunately, so you'll have to modify the shader to get the result you want.

That being said, I've been wanting to add this dash style myself, so it might come in the future!

johnny thompson

Ahhh that makes sense. Thank you very much for the quick response 😊

Freya Holmér creator

I've implemented it now, will be coming with the next update!

Image 709

johnny thompson

Awesome stuff - looks great!