In my current Godot game I am using a blur shader to blur the background and keep the UI sharp. The shaders that I have used to create this effect work, but blur to little or look glitch. For example:
float radius = 0.009;
vec3 col = vec3(0);
col+= texscreen(SCREEN_UV+vec2(-radius,-radius));
col+= texscreen(SCREEN_UV+vec2(0,-radius));
col+= texscreen(SCREEN_UV+vec2(radius,-radius));
col+= texscreen(SCREEN_UV+vec2(-radius,0));
col+= texscreen(SCREEN_UV+vec2(0,0));
col+= texscreen(SCREEN_UV+vec2(radius,0));
col+= texscreen(SCREEN_UV+vec2(-radius,radius));
col+= texscreen(SCREEN_UV+vec2(0,radius));
col+= texscreen(SCREEN_UV+vec2(radius,radius));
col/=9.0;
COLOR.rgb=col;
I would write such code on my own, but I don't know the shader Language of Godot 2.0 (My Project is using 2.0, 3.0 is too unstable and I would need to transfer my whole project :/). Can anyone provide me a code snippet for a good looking, in optimal case, adjustable gaussian blur?
Sth like this would be great:
I know I ask for a lot, but I would appreciate every help. :)
For anyone wondering what the solution to such a gaussian blur is:
https://www.reddit.com/r/godot/comments/7kdshl/godot_gaussian_blur_shader/