Added UI blur

This commit is contained in:
2024-02-23 22:29:20 +01:00
parent 19c1d3e74c
commit 3ba39992bc
6 changed files with 51 additions and 5 deletions

View File

@ -0,0 +1,10 @@
shader_type canvas_item;
uniform sampler2D SCREEN_TEXTURE : hint_screen_texture, filter_linear_mipmap;
uniform float blur: hint_range(0.0, 5.0) = 3.0;
void fragment() {
vec4 color = textureLod(SCREEN_TEXTURE, SCREEN_UV, blur);
COLOR = vec4(color.rgb, 1.0);
}

View File

@ -0,0 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://c73k6kaoj2bdd"]
[ext_resource type="Material" uid="uid://lc7tfhw1slhf" path="res://ui/blur/BlurMaterial.tres" id="1_fal0j"]
[node name="BlurContainer" type="PanelContainer"]
material = ExtResource("1_fal0j")

View File

@ -0,0 +1,7 @@
[gd_resource type="ShaderMaterial" load_steps=2 format=3 uid="uid://lc7tfhw1slhf"]
[ext_resource type="Shader" path="res://ui/blur/Blur.gdshader" id="1_pkjrr"]
[resource]
shader = ExtResource("1_pkjrr")
shader_parameter/blur = 3.0

View File

@ -0,0 +1,12 @@
[gd_scene load_steps=2 format=3 uid="uid://dvharlvkq4m0f"]
[ext_resource type="Material" uid="uid://lc7tfhw1slhf" path="res://ui/blur/BlurMaterial.tres" id="1_4yub6"]
[node name="BlurRect" type="ColorRect"]
material = ExtResource("1_4yub6")
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2