Cartoon shader improvements

Screenshots - effect of supersampling

This post concludes the status update.

All screenshots in this post taken using the new version. Depth buffer is used as an auxiliary data source.

The depth buffer is also used to slightly modulare the separation parameter (changing the thickness of the line depending on distance from camera), but I might still tweak this. Due to the nature of the algorithm, separation does not really control line thickness: instead, it controls the radius of the edge detection stencil.

Up to one pixel of separation, these are effectively the same thing, but above one pixel, it also displaces the outline from the pixel containing the edge, because the edge is detected from further away. An object that is thinner than the separation value may get several non-overlapping “ghost” outlines. (This is a consequence of the inking algorithm, and was there already in 1.8.1.)

The only difference between the pictures in this post is the number of subpixel samples. Look at the top of the head to see the effect clearly.