Skip to content

Commit 806b0ee

Browse files
committed
Fix black blur background
1 parent fba974d commit 806b0ee

File tree

3 files changed

+19
-14
lines changed

3 files changed

+19
-14
lines changed

.github/workflows/windows_build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ jobs:
149149

150150
- name: "Setup rcedit"
151151
run: |
152+
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
153+
sudo apt-get update
152154
sudo apt-get install wine-stable
153155
wget https://github.com/electron/rcedit/releases/download/v1.1.1/rcedit-x64.exe
154156
cached_builds/editor/godot --headless --quit
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Source: https://kidscancode.org/godot_recipes/shaders/blur/
2+
3+
shader_type canvas_item;
4+
5+
// FIXME: blur_amount and modulate have to be hardcoded; the shader parameters
6+
// are not being used on exported projects from the editor
7+
// So far this hasn't been replicated on vanilla Godot, but it's likely
8+
// an engine bug. Investigate later
9+
uniform float blur_amount : hint_range(0, 5) = 1;
10+
uniform sampler2D SCREEN_TEXTURE : hint_screen_texture, filter_linear_mipmap;
11+
uniform vec4 modulate : source_color = vec4(0.749, 0.749, 0.749, 1.0);
12+
13+
void fragment() {
14+
COLOR = textureLod(SCREEN_TEXTURE, SCREEN_UV, blur_amount) * modulate;
15+
}

scenes/root/Root.tscn

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,14 @@
55
[ext_resource type="PackedScene" uid="uid://cjx4cfx0f2k2" path="res://scenes/config/ConfigPopup.tscn" id="3"]
66
[ext_resource type="Script" path="res://scenes/root/Viewport.gd" id="4"]
77
[ext_resource type="Theme" uid="uid://jtuqhw3am1h3" path="res://resources/default_theme.tres" id="5"]
8+
[ext_resource type="Shader" path="res://resources/shaders/MenuBlur.gdshader" id="5_co422"]
89
[ext_resource type="Script" path="res://scenes/root/FileSystemPopup.gd" id="6"]
910
[ext_resource type="Script" path="res://addons/godot-accessibility/ScreenReader.gd" id="7"]
1011
[ext_resource type="Script" path="res://source/utils/InputHandler.gd" id="9_5ltce"]
1112
[ext_resource type="PackedScene" uid="uid://dmcmcyq0jach5" path="res://scenes/no_theme/NoTheme.tscn" id="10"]
1213

13-
[sub_resource type="Shader" id="1"]
14-
code = "// Source: https://kidscancode.org/godot_recipes/shaders/blur/
15-
16-
shader_type canvas_item;
17-
18-
uniform float blur_amount : hint_range(0, 5);
19-
uniform sampler2D SCREEN_TEXTURE : hint_screen_texture, filter_linear_mipmap;
20-
uniform vec4 modulate : source_color;
21-
22-
void fragment() {
23-
COLOR = textureLod(SCREEN_TEXTURE, SCREEN_UV, blur_amount) * modulate;
24-
}"
25-
2614
[sub_resource type="ShaderMaterial" id="2"]
27-
shader = SubResource("1")
15+
shader = ExtResource("5_co422")
2816
shader_parameter/blur_amount = 1.0
2917
shader_parameter/modulate = Color(0.74902, 0.74902, 0.74902, 1)
3018

0 commit comments

Comments
 (0)