w24 – Controlling linesizes

I was thinking a bit a when I was a recent trip. Thinking usually leads to ideas and so forth. This also happened to me on that trip.
“It would be cool to dynamically adjust linesizes by analytical fields for an image” -> “this can easily be done in a fragment shader!”.

By simply finding the line, and then finding it’s shortest distance to end of the line I can precalculate a directional map for samples:
dir-search-0

As this lead to quite a few ugly artifacts, I ended up computing the minimum distance to the boarder by a “spherical-search”. This also led me to apply some basic antialiasing tricks. I would still like to throw some fxaa on top of this to see if it would improve.

Here’s the technique applied to on a drawing by Gard Sviggum Saabye, the field is “abs(sin(time+tc.y*2.5”.

Might do another one this technique.

Leave a Reply

Your email address will not be published.