From 308cf26a7730182cc12b75e796f0625f16fc186c Mon Sep 17 00:00:00 2001 From: Eric Smith <5d@fifthdread.com> Date: Wed, 20 May 2026 15:07:42 -0400 Subject: [PATCH] fix: liquid fills from bottom; make module root panel transparent with 12px corners to eliminate grey corners --- panels/cpu/cpu_module.gd | 10 ++++++++++ panels/memory/memory_module.gd | 10 ++++++++++ shaders/vial_fill.gdshader | 13 +++++++------ 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/panels/cpu/cpu_module.gd b/panels/cpu/cpu_module.gd index 1463c78..3f162a5 100644 --- a/panels/cpu/cpu_module.gd +++ b/panels/cpu/cpu_module.gd @@ -50,6 +50,16 @@ func _setup_shader() -> void: func _style() -> void: + # Transparent root panel — the VialFill shader provides the background + var panel := StyleBoxFlat.new() + panel.bg_color = Color.TRANSPARENT + panel.corner_radius_top_left = 12 + panel.corner_radius_top_right = 12 + panel.corner_radius_bottom_right = 12 + panel.corner_radius_bottom_left = 12 + add_theme_stylebox_override("panel", panel) + add_theme_stylebox_override("panel_focused", panel) + title_label.add_theme_color_override("font_color", Color(0.7, 0.7, 0.8, 1.0)) label.add_theme_color_override("font_color", Color(0.9, 0.9, 1.0, 1.0)) label.add_theme_font_size_override("font_size", 48) diff --git a/panels/memory/memory_module.gd b/panels/memory/memory_module.gd index ddc866e..ab71b2b 100644 --- a/panels/memory/memory_module.gd +++ b/panels/memory/memory_module.gd @@ -50,6 +50,16 @@ func _setup_shader() -> void: func _style() -> void: + # Transparent root panel — the VialFill shader provides the background + var panel := StyleBoxFlat.new() + panel.bg_color = Color.TRANSPARENT + panel.corner_radius_top_left = 12 + panel.corner_radius_top_right = 12 + panel.corner_radius_bottom_right = 12 + panel.corner_radius_bottom_left = 12 + add_theme_stylebox_override("panel", panel) + add_theme_stylebox_override("panel_focused", panel) + title_label.add_theme_color_override("font_color", Color(0.7, 0.7, 0.8, 1.0)) label.add_theme_color_override("font_color", Color(0.9, 0.9, 1.0, 1.0)) label.add_theme_font_size_override("font_size", 48) diff --git a/shaders/vial_fill.gdshader b/shaders/vial_fill.gdshader index ac21ed8..168bf91 100644 --- a/shaders/vial_fill.gdshader +++ b/shaders/vial_fill.gdshader @@ -36,20 +36,21 @@ void fragment() { float inner_d = rr_sdf(uv_centered, vec2(inner_hw, inner_hh), inner_r); float inner = 1.0 - smoothstep(0.0, max(0.001, fwidth(inner_d)), max(inner_d, 0.0)); - // Liquid fill with a gentle animated wave at the surface + // Liquid fill with a gentle animated wave at the surface. + // UV.y = 0 is top, UV.y = 1 is bottom. fill = 0 → empty, fill = 1 → full. float wave = sin(UV.x * wave_freq * 6.283 + TIME * 1.5) * wave_amp; - float fill_line = fill + wave; - float liquid = 1.0 - smoothstep(fill_line - 0.001, fill_line + 0.001, UV.y); + float fill_line = 1.0 - fill + wave; + float liquid = smoothstep(fill_line - 0.001, fill_line + 0.001, UV.y); liquid *= inner; // Base background vec3 col = bg_color.rgb; - // Liquid with subtle depth gradient (lighter near the top) - vec3 liq = mix(liquid_color.rgb, liquid_color.rgb * 1.35, 1.0 - UV.y * 0.6); + // Liquid with subtle depth gradient + vec3 liq = mix(liquid_color.rgb, liquid_color.rgb * 1.35, 1.0 - UV.y); col = mix(col, liq, liquid); - // Surface highlight line + // Surface highlight line at the top of the liquid column float surface = smoothstep(fill_line - 0.008, fill_line, UV.y) - smoothstep(fill_line, fill_line + 0.002, UV.y); col += surface * vec3(0.3, 0.4, 0.5) * liquid;