From 8aeb1e4d4e61b032d4355049f39bf7e5114d39b4 Mon Sep 17 00:00:00 2001 From: sasha80 Date: Wed, 24 Jan 2024 14:04:36 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=BA=D0=B0.=20=D0=97=D0=B0=D1=87=D1=91=D1=80=D0=BA=D0=B8?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=BA=D0=BD=D0=BE=D0=BF=D0=BE?= =?UTF-8?q?=D0=BA=20=D0=B1=D0=BE=D0=BB=D0=B5=D0=B5=20=D0=BA=D1=80=D0=B0?= =?UTF-8?q?=D1=81=D0=B8=D0=B2=D0=BE=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scenes/button-flat/button-flat.tscn | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/scenes/button-flat/button-flat.tscn b/scenes/button-flat/button-flat.tscn index 32e0ba1..2569b90 100644 --- a/scenes/button-flat/button-flat.tscn +++ b/scenes/button-flat/button-flat.tscn @@ -46,10 +46,16 @@ void fragment() COLOR.a = 0.0; for (float x = -2.0; x < 2.0; x += 0.03) { - float v0 = smoothstep(-1.0, 1.0, (tx - UV.x + x) * sharpness + width); - float v1 = smoothstep(-1.0, 1.0, (UV.x - tx - x) * sharpness + width); + float v0 = smoothstep(0.0, 1.0, (tx - UV.x + x) * sharpness + width); + float v1 = smoothstep(0.0, 1.0, (UV.x - tx - x) * sharpness + width); float v2 = smooth_px(length(UV.x - center.x), center.x * 2.0 - ds, ds); - COLOR.a += v0 * v1 * v2; + vec2 uv = UV; + rotate_vec2(uv, -rotation, center); + float v3 = smoothstep(0.0, 1.0, (uv.x - center.x / 5.0) * sharpness); + float v4 = smoothstep(0.0, 1.0, (uv.y - center.y / 5.0) * sharpness); + float v5 = smoothstep(0.0, 1.0, (center.x * 2.0 - center.x / 5.0 - uv.x) * sharpness); + float v6 = smoothstep(0.0, 1.0, (center.y * 2.0 - center.y / 5.0 - uv.y) * sharpness); + COLOR.a += v0 * v1 * v2 * v3 * v4 * v5 * v6; } COLOR.a *= color.a; } @@ -91,6 +97,7 @@ script = ExtResource("1_ui6sg") toggle_mode = true [node name="state" type="NinePatchRect" parent="."] +modulate = Color(1, 1, 1, 0.25) layout_mode = 2 texture = ExtResource("2_0cn5u") patch_margin_left = 10