[ANSWERED] GLSL BLUR Shader
-
@gapworks I took a stab at it, but I dont' have much glsl experience... and I got stuck trying to dynamically set mSize.
It seems to want a Const to define an array.So, do you need smooth translation of the blur?
You could have a few copies of the GLSL, where you set 'const int mSize = ??;' to different amounts, say, 10, 20, 30, 40 or what ever, and use a Router to switch the feed between them, allowing some control over the level?regarding the extra parameters, you can hid them easily enough (setting them to zero, appears to setup the GLSL to affect the whole image), by right clicking the actor and selecting Show/Hide Properties.. and hiding the options you don't need.
-
Hi,
Here is a modification of your GLSL code that might be useful:
// ISADORA_FLOAT_PARAM(blurA, inti, .1, 10, .1, "No help available.") uniform float blurA; #ifdef GL_ES precision mediump float; #endif float normpdf(in float x, in float blurA) { return 0.39894*exp(-0.01*x*x/(blurA*blurA))/blurA; } void mainImage( out vec4 fragColor, in vec2 fragCoord ) { vec3 c = texture(iChannel0, fragCoord.xy / iResolution.xy).rgb; //if (fragCoord.x < iMouse.x) //{ //fragColor = vec4(c, 1.0); //} else { //declare stuff const int mSize = 11; const int kSize = (mSize-1)/2; float kernel[mSize]; vec3 final_colour = vec3(0.0); //create the 1-D kernel float sigma = blurA; float Z = 0.0; for (int j = 0; j <= kSize; ++j) { kernel[kSize+j] = kernel[kSize-j] = normpdf(float(j), sigma); } //get the normalization factor (as the gaussian has been clamped) for (int j = 0; j < mSize; ++j) { Z += kernel[j]; } //read out the texels for (int i=-kSize; i <= kSize; ++i) { for (int j=-kSize; j <= kSize; ++j) { final_colour += kernel[kSize+j]*kernel[kSize+i]*texture(iChannel0, (fragCoord.xy+vec2(float(i),float(j))) / iResolution.xy).rgb; } } fragColor = vec4(final_colour/(Z*Z), 1.0); } }
-
thanks both of u for ur support. the one thing left ist the blur amount which is to little. how and where can i change this
-
hi,I did have a look at the blur amount, but it was not possible to increase that without the shader over heating.
I tried a couple of things, including daisy-chaining three or four instances of the actor - that is worth a try. However, the pre-loaded Gaussian Blur actor that comes as a standard actor in Isadora might be a viable option?
Best wishes
Russell
-
I had another thought about it because I did notice that the resolution of the shader affects the amount of blur apparent in the image. So I made this user actor that scales the shader resolution as it applies the blur effectively increasing the appearance of blur across the image:
-
I have attached a 2 GLSL shader based approach. Its fast and from my initial tests looks pretty good.
It does a horizontal blur, followed by a vertical blur. -
@dusx said:
I have attached a 2 GLSL shader based approach. Its fast and from my initial tests looks pretty good. It does a horizontal blur, followed by a vertical blur.
Hi,
This works great!
Beat Wishes
Russell
-
Brilliant! Thank all of you so much -
@dusx said:
I have attached a 2 GLSL shader based approach. Its fast and from my initial tests looks pretty good. It does a horizontal blur, followed by a vertical blur.
It'd be great if you could upload these to the Add-Ons Page (if you haven't already).
Best wishes,
Woland
-
i , thanx to the help of all of you i managed to finalise my eos fixture and the corresponding izzy patch. works like charm. than again.izzyeos.zipin the zip file you will find the patch, the eos fixture file and the blur qua
best
peter