Simple Blur Godot 4.1

A simple BLRU Shader based on this shader for Godot 4.1

Shader code
shader_type canvas_item;

uniform float blur_amount : hint_range(-2.0, 10.0);
uniform float mix_amount : hint_range(0.0, 1.0);
uniform vec4 color_over : source_color;
uniform sampler2D SCREEN_TEXTURE : hint_screen_texture, filter_linear_mipmap;

void fragment() {
   vec4 blurred = textureLod(SCREEN_TEXTURE, SCREEN_UV, blur_amount);
   blurred.a = 255.0;
   vec4 fin = mix(blurred, color_over, mix_amount);
   COLOR = fin;
}
Live Preview
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.

Related shaders

guest

6 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
oxorfr
oxorfr
1 year ago

currently the best blur that i could find. almost doesn’t affect performance

lechatonmortel
lechatonmortel
10 months ago

On Godot 4.4 is dont work well for me :/

UnrealSoftware
UnrealSoftware
9 months ago
Reply to  lechatonmortel

It works fine with Godot 4.4 for me. Maybe something is wrong with your setup?

Saniori
Saniori
9 months ago

Not working in godot 4.4

kesha2326
kesha2326
9 months ago

In version 4.4, everything works like a charm — you just need to set the blur amount in the shader parameters

Destroyanad
2 months ago

Works perfect for godot 4.4.1 2D Compatibility. I used it to add blurred background particles to my UI using particle2DCPU