Add PolylinePoint override to Draw.Line

Avatar
  • updated
  • Declined

It would be convenient to be able to call Draw.Line with two PolylinePoints as arguments.

My use case is that I already construct a PolylinePath to store Points/Colors/etc and generally draw them with Draw.PolylinePath, but in cases where it's clear that visual artifacts (see this post) would occur I switch to consecutive Draw.Line calls instead, because there is currently no support for Volumetric Polylines.

So Instead of this:

if ( usePolyline ) {
Draw.Polyline( path, 1 );
} else {
for ( int i = 0; i < path.Count-1; ++i ) {
Draw.Line( path[i].point, path[i+1].point,
path[i].thickness, path[i].color, path[i+1].color );
}
}

I'd do this:

if ( usePolyline ) {
Draw.Polyline( path, 1 );
} else {
for ( int i = 0; i < path.Count-1; ++i ) {
Draw.Line( path[i], path[i+1].point );
}
}

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
Pinned replies
Avatar
Freya Holmér creator
  • Answer
  • Declined

I think this is too specific of a use case and easy enough to write a wrapper for yourself. Having polylinePoint parameters would also make people expect lines to be at feature parity with all the settings within polyline points

Avatar
Freya Holmér creator
  • Answer
  • Declined

I think this is too specific of a use case and easy enough to write a wrapper for yourself. Having polylinePoint parameters would also make people expect lines to be at feature parity with all the settings within polyline points