the blur shader isn't working

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Shlopynoobnoob

I want to blur the scene when the game is over.
this is the shader script:

shader_type canvas_item;
uniform float blur_amount : hint_range(0, 5);
void fragment() {
	COLOR = textureLod(SCREEN_TEXTURE, SCREEN_UV, blur_amount);
}

I put the shader in a control node.
this is the gdscript that I assigned to the main node:

extends Node2D

onready var blur = $blur
var blur_amount = 0

func _process(delta): 	
	if $bar.value == 0:
		game_over()

func game_over():
	blur.material.set_shader_param("blur_amount", 5)

but it’s not working

:bust_in_silhouette: Reply From: estebanmolca

I can’t try it now, but it must be sure that the node that has the shader assigned does not have a texture that covers the screen. Try the shader in a ColorRect.

thanks a lot, that worked

Shlopynoobnoob | 2019-12-19 08:19