News for hackers. Stuff that matters.
Re:Shaderoo: realtime ballpoint effect by dahart on Monday March 12, 2018 @11:53AM (#16568955)
You got it right at a high level. The main bit of line drawing is the velocity calculation in the middle of the propagate() function:

    // calculate velocity change
    vec2 dvel=vec2(0);

    float dir = (float(p.idx%2)*2.-1.); // every 2nd particle is bent left/right
    
    // vel tends towards gradient
    dvel -= 10.*gu*(1.+sqrt(gl*2.))*sc;
    
    // vel tends towards/away from normal to gradient (every second particle)
    dvel -= 20.*N(gu)/(1.+1.*sqrt(gl*100.))*sc*dir;
    
    // vel bends right/left (every second particle)
    dvel += .06*N(p.vel)/(1.+gl*10.)*dir;
Re:Shaderoo: realtime ballpoint effect by jcims on Monday March 12, 2018 @01:05PM (#16569560)
It's fun tinkering with all of the constants throughout the script (don't forget to click Apply at the bottom). It's surprisingly robust to changes, they just flavor the image in various ways.