diff options
author | tpart <tpart120@proton.me> | 2024-08-13 21:38:20 +0200 |
---|---|---|
committer | tpart <tpart120@proton.me> | 2024-08-13 21:38:30 +0200 |
commit | 598cc27e750b00cb9c4e58789dee19c926bbd41e (patch) | |
tree | 5d0cf8892454c267d28b550331decffe8f1e2520 /client/menu/blur_mix.gdshader | |
parent | fa4e866c2736e6679ff6717b849f3f6f34a7dc00 (diff) | |
download | hurrycurry-598cc27e750b00cb9c4e58789dee19c926bbd41e.tar hurrycurry-598cc27e750b00cb9c4e58789dee19c926bbd41e.tar.bz2 hurrycurry-598cc27e750b00cb9c4e58789dee19c926bbd41e.tar.zst |
Add UI blur setting
Diffstat (limited to 'client/menu/blur_mix.gdshader')
-rw-r--r-- | client/menu/blur_mix.gdshader | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/client/menu/blur_mix.gdshader b/client/menu/blur_mix.gdshader index 706903d5..7e95224d 100644 --- a/client/menu/blur_mix.gdshader +++ b/client/menu/blur_mix.gdshader @@ -19,10 +19,16 @@ 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 float mix_amount_no_blur : hint_range(0.0, 1.0); uniform vec4 color_over: source_color; uniform sampler2D SCREEN_TEXTURE : hint_screen_texture, filter_linear_mipmap; +uniform bool enable_blur; void fragment() { - vec4 blurred = textureLod(SCREEN_TEXTURE, SCREEN_UV, blur_amount); - COLOR = mix(blurred, color_over, mix_amount); + if (enable_blur) { + vec4 blurred = textureLod(SCREEN_TEXTURE, SCREEN_UV, blur_amount); + COLOR = mix(blurred, color_over, mix_amount); + } else { + COLOR = mix(texture(SCREEN_TEXTURE, SCREEN_UV), color_over, mix_amount_no_blur); + } }
\ No newline at end of file |