Hey guys,
Yes it is possible but not simple or cheap as Jamsh suggested. That said it was pretty quick for me to knock this out since I mess around with these type of coordinate based shapes pretty often. I did get thrown off by the missing -X after the swizzle for a bit though (DanW reminded me that y,-x is perpendicular to x,y which is how the transform here works).
This works by drawing a line between P0 and P1. You can specify line thickness and edge hardness. It costs around 17 instructions. You could make this into a material function and use it a few times. I might do that and toss is into engine\functions.
In the left preview the line goes from 0.1,0.1 to 0.9,0.9, showing that there is also end point cutoff on the line drawing.
A simpler approach is to use a single quad mesh and use the worldpositionoffset shader to move the top 2 verts (using UV-Y coord) to the P0 location, and the bottom 2 verts to the P1 location. Then you project using the UV-X coordinate along the vector between your points for thickness.
That is how we do alot of fake shadows for things like the hexmap in Fortnite where the objects are too small to cast nice real shadows. Then you just spawn one of these meshes, make a material instance dynamic and set the point locations.
