From 427581b1f980587ddd6050794a98ff55326e934d Mon Sep 17 00:00:00 2001 From: sasha80 Date: Mon, 17 Nov 2025 14:04:27 +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=92=20=D0=BF=D1=80=D0=BE=D1=86=D0=B5=D1=81?= =?UTF-8?q?=D1=81=D0=B5.=20=D0=A8=D1=82=D1=80=D0=B8=D1=85=D0=BE=D0=B2?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=BD=D0=B5=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BD=D1=8B=D1=85=20=D0=BC=D0=BE=D0=B4=D1=83=D0=BB=D0=B5=D0=B9?= =?UTF-8?q?=20=D0=A4=D0=A1=20=D0=BD=D0=B0=20=D0=B4=D0=B8=D0=B0=D0=B3=D1=80?= =?UTF-8?q?=D0=B0=D0=BC=D0=BC=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shaders/antenas.tres | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/shaders/antenas.tres b/shaders/antenas.tres index 2c689e0..8488bdc 100644 --- a/shaders/antenas.tres +++ b/shaders/antenas.tres @@ -7,6 +7,9 @@ code = "shader_type canvas_item; #define RADIUS_INNER_0 200.0 /* Радиус внутренний для режима приоритет РТО */ #define RADIUS_INNER_1 480.0 /* Радиус внутренний для режима приоритет РЛС */ +#define ANTENAS_COUNT 28 /* Количество антенн */ +#define ANT_BAND_READY 0U /* Антенна (модуль ФС) готова или исправна */ +#define ANT_BAND_FAILED 1U /* Антенна (модуль ФС) не исправно */ uniform vec2 pc0 = vec2(560, 560); /* Центр сетки антенн */ uniform float rotation: hint_range(0.0, 360.0) = 0.0; /* */ @@ -17,6 +20,8 @@ uniform float radius_inner_1 = RADIUS_INNER_1; uniform float radius_outter = 550.0; /* Радиус внешний. Должно быть равно ant_band_r1_6 */ uniform float alpha: hint_range(0.0, 1.0) = 0.5; uniform int mode = 0; /* Режим отображения. Приоритет РТО - 0, приоритет РЛС - 1 */ +uniform float ffr: hint_range(0.0, 1.0) = 0.2; +uniform float sfr: hint_range(0.0, 10.0) = 0.0; const int ant_band_count_0 = 2; const int ant_band_count_1 = 2; @@ -42,7 +47,8 @@ const float ant_band_r1_4[] = {450.0, 530.0}; const float ant_band_r1_5[] = {500.0, 540.0}; const float ant_band_r1_6[] = {550.0, 550.0}; -uniform vec4 ant_band_c[28]; +uniform vec4 ant_band_c[ANTENAS_COUNT]; +uniform uint ant_band_m[ANTENAS_COUNT]; const float d4 = 90.0; const float ds = 1.0; @@ -79,6 +85,10 @@ void antenas(inout vec4 c, vec2 uv, vec2 p0, int cnt, float r0, float r1, inout col.rgb = ant_band_c[j].rgb; index++; col.a = alpha + (random_timed(uv) - 0.5f) * ant_band_c[j].a; + if (ant_band_m[j] == ANT_BAND_FAILED) + { + col.a *= (1.0 - ffr) + tanh(10.0 * sin(TIME * sfr + 2.0 * PI * uv.x / 10.0)) * ffr; + } float v = float(i & 1); vec4 color = v * col + (1.0f - v) * col; sector(c, uv, p0, float(i) * da, da, r0, r1, color); @@ -120,4 +130,7 @@ shader_parameter/radius_inner_1 = 480.0 shader_parameter/radius_outter = 550.0 shader_parameter/alpha = 0.5 shader_parameter/mode = 0 +shader_parameter/ffr = 0.2 +shader_parameter/sfr = 0.0 shader_parameter/ant_band_c = PackedVector4Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) +shader_parameter/ant_band_m = PackedInt32Array(0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)