Dual Kawase Down – Fast Blur

Fast blur shader as explained here: https://blog.frost.kiwi/dual-kawase/#dual-kawase-blur

 

Instructions:

  1. Add a ColorRect that spans the whole screen (or at least the area you want to blur).
  2. Add this shader to the material.

 

Other versions:

 

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) * 4.0;
	sum += texture(SCREEN_TEXTURE, uv - halfpixel.xy * offset);
	sum += texture(SCREEN_TEXTURE, uv + halfpixel.xy * offset);
	sum += texture(SCREEN_TEXTURE, uv + vec2(halfpixel.x, -halfpixel.y) * offset);
	sum += texture(SCREEN_TEXTURE, uv - vec2(halfpixel.x, -halfpixel.y) * offset);

	COLOR = sum / 8.0;
}
Tags
blur
The shader code and all code snippets in this post are under CC0 license and can be used freely without the author's permission. Images and videos, and assets depicted in those, do not fall under this license. For more info, see our License terms.

More from SanderVanhove

Dual Kawase Up – Fast Blur

Related shaders

Dual Kawase Up – Fast Blur

Fast Starnest

Symmetric Pixelated Dual-Progress Ring

guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments