We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello,
I was playing around with the BLUR GLSL shader example in Processing2.0, filed under 'Topics > Shaders > BlurFilter', and I'd like to know if there's anyway to increase the size of the blur filter. Specifying a parameter as we'd normally do for the default shader like, filter(BLUR,2);
doesn't quite work for the 'blur.glsl' shader. This is my first time using shaders in Processing, and I apologize if this turns out to be a really silly question.
Is there anyway I could increase the size of the blur filter using the blur.glsl shader?
Thanks!
Answers
Hi, the blur size in the BlurFilter example is hard-coded inside the shader. You basically need to implement a larger kernel (this example uses a 3x3 kernel) in order to get a smoother result.
Take a look at the SepBlur example, where you can control the extent of blurring with the blurSize and sigma parameters.
Thanks for the answer!
Also, on a different note - I noticed that using
filter(BLUR,amt);
andfilter(blur)
in thedraw()
function work differently. The default renderer continuously blurs what's being drawn every frame, whereas with the GLSL shader, it appears to blur just once, and not every frame.The difference is that, if a rectangle is drawn to the screen, it eventually fades into the background if blurred using the default renderer, and with a GLSL shader in the
draw()
function, it just appears blurred and doesn't eventually fade away. Is this normal?sorry I missed your last post. If understand your question correctly, I'd say that both filter functions operate in a similar way (by applying the filter on what has been drawn to the screen so far in the current frame), compare the output of these two sketches:
and