I’m trying to develop a sort of sketchy/noise/distressed edge shader for 3d objects. Kind of to give it a hard drawn effect, that makes the outside edges of the object distressed/sketchy based on a noise texture or a paintbrush-like texture. See below for a mockup example.
Yeah, I figure I’ll need to use a combination of a screenspace sobel-shader and then doing some distortion/masking of the edges but I don’t know how to combine those two concepts. I’ve tried a bunch of stuff but feeling really stuck!
IDK if I know the best way to do this and this is untested code… I would get a bool for whether near an edge or not (using the edge shader examples to make that func) then use it to pick whether to use the distorted UV or the original UV. Putting it in your fragment code could look like this:
Render distressed objects into a transparent offscreen buffer. Gaussian blur the alpha, Composit into main viewport using the blurred mask sample as a threshold for randomly skipping samples and/or as sample displacement magnitude.