replace lineTo() with a shader: possible?

is it possible to draw lines and curves on screen with shaders, as opposed to using lineTo()? I’m curious about improving render speeds.

i think lineTo is already a built-in shader.

well, i mean when trying to draw a custom curve and you’re doing a ton of lineTo() from pixel to pixel. How to do that with a shader and some control points, instead of 100’s of single-pixel-length lineTo()'s.

the most efficient way is pbly via a mesh. Draw a series of small rects that build up your curve. With a shader you will have to define a mesh anyway if you want to draw fast (to draw only the used points). And if you want to be really accurate, inside eact rect of your mesh, draw a curve with a shader.

I thought it was line() not lineTo()?

@matkatmusic - I believe that @LoopSpace has a bezier shader here (it may take you a while to understand/adapt it, though)