Blur shader

Problem

You want a shader to blur an object or the screen.

Solution

shader_type canvas_item;

uniform float blur_amount : hint_range(0, 5);

void fragment() {
	COLOR = textureLod(SCREEN_TEXTURE, SCREEN_UV, blur_amount);
}

For example, to gradually blur the entire screen, such as for a scene transition effect:

alt alt alt alt

You can also animate the blurring:

extends Node

# Add a ColorRect or other Control set to fill the screen
# Place it lower in the tree and/or place in CanvasLayer
# so it's on top of the rest of the scene.
onready var blur = $Blur
var blur_amount = 0

func _process(delta):
    blur_amount = wrapf(blur_amount + 0.05, 0.0, 5.0)
    blur.material.set_shader_param("blur_amount", blur_amount)