Avoiding color blend for polyline segment?

  • updated
  • Answered

I was hoping to have a clean color cut between two polyline segments, without any blending.

I tried adding additional points to effectively have an empty segment on each side to "use up" the vertex color blend. If the additional points are identical to their sibling, nothing gets rendered. Offsetting with a small value gets them to render, but then other artifacts show up (I saw a few other threads mentioning segments shorter than the line width don't work well).

Any thoughts on how I can achieve this? Am I going to have to stitch single-color polylines together?

Reporting a bug? please specify Unity version:
Reporting a bug? please specify Shapes version:
Reporting a bug? please specify Render Pipeline:
Built-in render pipeline
Freya Holmér creator
  • Answered

right now there's no way to do this proper. the most stable polyline is the one with simple joins, it's possible the offsetting method will be more stable using those joins, if it works in your case. otherwise, I'd recommend using lines if you have a lot of individually colored line segments (since they can batch together)