Is it possible to make Gaussian blur like in Photoshop via GLSL? I found just some examples of shaders which work the same. But none of them return same result as Photoshop, if half-transparent blur.
I do two-pass ping-pong Gaussian blur, where i use two framebuffers and change direction via uniform. Iterations and sigma on screenshot both are equal 2.
P.S. After two days of researching i didn't find real useful answers, i can't believe that nobody wanted to fix/make this shader.
varying vec2 uv;
uniform float iterations;
uniform float sigma;
uniform vec2 texelSize;
uniform vec2 direction;
void main() {
vec4 color = texture2D(texture, uv);
float weight = 0.0;
float totalWeight = 1.0;
for(float i = 1.0; i <= iterations; i++) {
weight = exp(-(i * i) / (2.0 * sigma * sigma)); // gaussian 1D
color += texture2D(texture, uv - i * direction * texelSize) * weight;
color += texture2D(texture, uv + i * direction * texelSize) * weight;
totalWeight += 2.0 * weight;
}
color.rgb /= totalWeight;
/*=========================*/
gl_FragColor = color;
/*==========OR============*/
gl_FragColor = vec4(color.rgb, 1.0);
}