Can I have parts of a Polyline change color or become a dotted line when rendering through/in front of obscuring geometry?

Avatar
  • updated

Can I have the possibility to draw a Polyline in front of all objects (possible today with "Depth Test" set to: Always), but have the otherwise would-be obscured parts of it change into a different color or dotted line while those parts are drawn "through" in front of the other objects?

(this unaffiliated image kind of shows the kind of behaviour I'm looking for)

Image 593

Thanks for your taking your time to read this!

Best Regards, Viktor

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

sure, you can use two polylines, one with ZTest LEqual for the style that's visible normally, and ZTest Greater for the polyline that should only be visible behind

Avatar
viktor segerback
Quote from Freya Holmér

sure, you can use two polylines, one with ZTest LEqual for the style that's visible normally, and ZTest Greater for the polyline that should only be visible behind

Thank you! 


I realized now that my problem was that I was not changing the Blend Mode on the second line. Without changing it, the first line just combines with the second and overrides it to become uniformly colored and always visible. I ended up using the Linear Dodge blend mode on the second line with a 50% brightness value and that gave a subtle effect of whatever color I gave it. /V