From fbb63a81a8249adc12131a3b6553926d31683e3a Mon Sep 17 00:00:00 2001 From: Stenzek Date: Fri, 17 Jan 2025 16:05:24 +1000 Subject: [PATCH] FullscreenUI: Change default background and add Strobe --- data/resources/fullscreenui/backgrounds/Default.glsl | 4 ++-- data/resources/fullscreenui/backgrounds/Strobe.glsl | 10 ++++++++++ src/core/fullscreen_ui.cpp | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 data/resources/fullscreenui/backgrounds/Strobe.glsl diff --git a/data/resources/fullscreenui/backgrounds/Default.glsl b/data/resources/fullscreenui/backgrounds/Default.glsl index 6b30e6d1e..6051e1368 100644 --- a/data/resources/fullscreenui/backgrounds/Default.glsl +++ b/data/resources/fullscreenui/backgrounds/Default.glsl @@ -3,7 +3,7 @@ void main() // Radial gradient at (0.6, 0.4), moving horizontally slowly float r1 = length(v_tex0 - vec2(0.6, 0.4)); float r2 = length(v_tex0 - vec2(0.61, 0.41)); - float r = mix(r1, r2, sin(u_time / 10.0)); - vec3 bg_color = vec3(r * 0.33); + float r = mix(r1, r2, sin(u_time / 5.0)); + vec3 bg_color = vec3(0.1, 0.1, 0.6) * (1.0f - r); o_col0 = vec4(bg_color, 1.0); } diff --git a/data/resources/fullscreenui/backgrounds/Strobe.glsl b/data/resources/fullscreenui/backgrounds/Strobe.glsl new file mode 100644 index 000000000..0e7cacc4b --- /dev/null +++ b/data/resources/fullscreenui/backgrounds/Strobe.glsl @@ -0,0 +1,10 @@ +void main() +{ + vec2 uv = v_tex0 * 2.0 - 1.0; + uv.x *= u_display_size.x / u_display_size.y; + + vec2 center = vec2(cos(u_time * 0.2) * 1.5, (sin(u_time * 0.2) * 0.2) * 0.5 + 1.2); + float dist = length(uv - center); + float gradient = smoothstep(0.0, 1.0, dist); + o_col0 = vec4(mix(vec3(0.5, 0.5, 0.9), vec3(0.05, 0.05, 0.2), gradient), 1.0); +} diff --git a/src/core/fullscreen_ui.cpp b/src/core/fullscreen_ui.cpp index 1a588187b..ef67e6285 100644 --- a/src/core/fullscreen_ui.cpp +++ b/src/core/fullscreen_ui.cpp @@ -230,7 +230,7 @@ static void GetStandardSelectionFooterText(SmallStringBase& dest, bool back_inst // Backgrounds ////////////////////////////////////////////////////////////////////////// -static constexpr const char* DEFAULT_BACKGROUND_NAME = "Trails"; +static constexpr const char* DEFAULT_BACKGROUND_NAME = "Default"; static bool HasBackground(); static void LoadBackground();