How do I create a custom dash style?

Avatar
  • updated
  • Answered

Hello!

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:
2022.2.7
Reporting a bug? please specify Shapes version:
4.2.1
Reporting a bug? please specify Render Pipeline:
URP
Avatar
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!

Avatar
johnny thompson

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

Avatar
Freya Holmér creator
  • Answered

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

Image 709

Avatar
johnny thompson

Awesome stuff - looks great!