Dual Kawase Up – Fast Blur
Fast blur shader as explained here: https://blog.frost.kiwi/dual-kawase/#dual-kawase-blur
Instructions:
- Add a ColorRect that spans the whole screen (or at least the area you want to blur).
- Add this shader to the material.
Other versions:
- Dual Kawase Down: https://godotshaders.com/shader/dual-kawase-down-fast-blur/
- Dual Kawase Up: This shader
Shader code
shader_type canvas_item;
uniform float offset: hint_range(0.0, 10.0);
uniform sampler2D SCREEN_TEXTURE : hint_screen_texture, filter_linear_mipmap;
void fragment() {
vec2 uv = UV;
vec2 halfpixel = SCREEN_PIXEL_SIZE / 2.0;
vec4 sum = texture(SCREEN_TEXTURE, uv + vec2(-halfpixel.x * 2.0, 0.0) * offset);
sum += texture(SCREEN_TEXTURE, uv + vec2(-halfpixel.x, halfpixel.y) * offset) * 2.0;
sum += texture(SCREEN_TEXTURE, uv + vec2(0.0, halfpixel.y * 2.0) * offset);
sum += texture(SCREEN_TEXTURE, uv + vec2(halfpixel.x, halfpixel.y) * offset) * 2.0;
sum += texture(SCREEN_TEXTURE, uv + vec2(halfpixel.x * 2.0, 0.0) * offset);
sum += texture(SCREEN_TEXTURE, uv + vec2(halfpixel.x, -halfpixel.y) * offset) * 2.0;
sum += texture(SCREEN_TEXTURE, uv + vec2(0.0, -halfpixel.y * 2.0) * offset);
sum += texture(SCREEN_TEXTURE, uv + vec2(-halfpixel.x, -halfpixel.y) * offset) * 2.0;
COLOR = sum / 12.0;
}

