Convolution patches performance

Hi, I have a question or two about @josh_beckwith 's Convolution patches in on github: https://github.com/positlabs/spark-convolution-patch

  1. What is fastest and lightest blur patch (performance-wise) to use as a fast blur?
  2. What is the ranking from the lightest to the most resource for convolution type? regardless the 3, 5 and so on. since the documentation already said “Numbers in the patch names signify the size of the kernel that is used. Lower is better for performance, higher is better for quality.”.
  3. What other image processing that we can do using convolution beside edge detection, sharpening, and blurring? Is there any other implementation that we can do with it or not? So I can try to google it and learn.

thank you :slight_smile:

I remember seeing the YT video and he mentions that Directional is better than Gaussian (the fact you can split it comes down to a property of Gauss’ equations) but I’m not sure about the other ones. I haven’t used the other Blurs but I’m pretty sure the patches underneath are the same so you could just count the amount of heavy shader patches and make a rough estimate with that.

Edit: I’m not sure that this is Gauss’s equation, I read something related on a paper and it stuck with me, so I may be wrong. Still there’s no noticeable difference and it’s better performant

I think the directional blur is still gaussian, but I’m not totally sure. The trick with the directional blur is to do one pass horizontally and one vertically, so you end up blurring a grid. That means that if you have a kernel size of 5, you only do 10 (5+5) texture samples instead of 25 (5x5), but you get the same result. This is the only blur I use at this point.

You can also combine it with render pass with low size so there’s less pixels to process :slight_smile:

I think you can accomplish some reaction-diffusion stuff with convolution but I haven’t tried it. Still a cool technique, regardless.

1 Like

By doing horizontal and vertical, do you mean i have to set parallel and combine them with mix patch or in series?

Also i;m interested about the render pass, so i lower the size using shader render pass first before it goes to the blur patch right?

about the reaction diffusion, I know how to do that in photoshop to make a turing pattern by creating dots. blur it, highpass it to get a threshold so it looks like growing, and repeat it again and agian, but i still don’t understand how to do that in spark ar patch editor. can you give me a clue on how to do that?

Render pass - yep, and you can also insert another render pass between the two directional blurs. I usually do the blurs in a series.

I haven’t done any reaction-diffusion stuff in spark, but maybe some Kevin Kripper videos will point you in the right direction.

Thanks Josh! how low do you usually go to for the render pass size? 0.1? 0.5?

Yeah, I’ve seen his work and can try to replicate some of them using sdf and uv but for the reaction-diffusion i still have no idea how he did that. I tried using blur, and then step, not working, blur, grid, mask them, step. blur grid step again, also not working like like what i expect them to work. kinda choppy and awful. not as smooth and crisp looking like his.

It’s definitely something that I have on my list. I’ll let you know how it goes, but it might be a while before I get to it.

For standard blurs, I usually do something like .2 or .3.

1 Like