Рефактор.
This commit is contained in:
@@ -21,30 +21,29 @@ func _ready() -> void:
|
||||
|
||||
func sv(val: float) -> float: return val / ($строб.scale.x / 2.0) * 0.125
|
||||
|
||||
func set_canvas_rotation(val: float) -> void: material.set('shader_parameter/rotation', val)
|
||||
func set_strob_visible(val: bool): $строб.visible = val
|
||||
func set_strob_center(val: Vector2): $строб.position = val
|
||||
func set_strob_dir(val: float): $строб.set_instance_shader_parameter('dir', val)
|
||||
func set_strob_width(val: float): $строб.set_instance_shader_parameter('width', val)
|
||||
func set_strob_band(val: float): $строб.set_instance_shader_parameter('band', val / 125.0)
|
||||
func set_strob_radius(val: float): $строб.set_instance_shader_parameter('radius', sv(val))
|
||||
func set_strob_color(val: Color): $строб.set_instance_shader_parameter('color', val)
|
||||
func set_band_colors(val: PackedColorArray): material.set('shader_parameter/ant_band_c', val)
|
||||
func set_band_failures(val: PackedInt32Array): material.set('shader_parameter/ant_band_m', val)
|
||||
func set_canvas_rotation(val: float): material.set('shader_parameter/rotation', val)
|
||||
func set_strob_band(val: float): $строб.set_instance_shader_parameter('band', val / 125.0)
|
||||
func set_strob_center(val: Vector2): $строб.position = val
|
||||
func set_strob_color(val: Color): $строб.set_instance_shader_parameter('color', val)
|
||||
func set_strob_dir(val: float): $строб.set_instance_shader_parameter('dir', val)
|
||||
func set_strob_radius(val: float): $строб.set_instance_shader_parameter('radius', sv(val))
|
||||
func set_strob_visible(val: bool): $строб.visible = val
|
||||
func set_strob_width(val: float): $строб.set_instance_shader_parameter('width', val)
|
||||
|
||||
func get_strob_center() -> Vector2: return $строб.position
|
||||
func get_strob_visible() -> bool: return $строб.visible
|
||||
func get_strob_dir() -> float: return $строб.get_instance_shader_parameter('dir')
|
||||
func get_strob_width() -> float: return $строб.get_instance_shader_parameter('width')
|
||||
func get_strob_band() -> float: return $строб.get_instance_shader_parameter('band') * 125.0
|
||||
func get_strob_radius() -> float: return $строб.get_instance_shader_parameter('radius') * 125.0
|
||||
func get_strob_color() -> float: return $строб.get_instance_shader_parameter('color')
|
||||
|
||||
func get_canvas_rotation() -> float: return material.get('shader_parameter/rotation')
|
||||
func get_radius_outter() -> float: return size.x / scale.x
|
||||
|
||||
func get_band_colors(_val: Array): return material.get('shader_parameter/ant_band_c')
|
||||
func get_band_colors(_val: Array): return material.get('shader_parameter/ant_band_c')
|
||||
func get_band_failures(_val: Array): return material.get('shader_parameter/ant_band_m')
|
||||
func set_band_colors(val: PackedColorArray): material.set('shader_parameter/ant_band_c', val)
|
||||
func set_band_failures(val: Array): material.set('shader_parameter/ant_band_m', val)
|
||||
func get_canvas_rotation() -> float: return material.get('shader_parameter/rotation')
|
||||
func get_radius_outter() -> float: return size.x / scale.x
|
||||
func get_strob_band() -> float: return $строб.get_instance_shader_parameter('band') * 125.0
|
||||
func get_strob_center() -> Vector2: return $строб.position
|
||||
func get_strob_color() -> float: return $строб.get_instance_shader_parameter('color')
|
||||
func get_strob_dir() -> float: return $строб.get_instance_shader_parameter('dir')
|
||||
func get_strob_radius() -> float: return $строб.get_instance_shader_parameter('radius') * 125.0
|
||||
func get_strob_visible() -> bool: return $строб.visible
|
||||
func get_strob_width() -> float: return $строб.get_instance_shader_parameter('width')
|
||||
|
||||
|
||||
## Добавляет сектор запрета[br]
|
||||
## [param id] - Индекс сектора запрета.[br]
|
||||
|
||||
@@ -389,8 +389,8 @@ texture_normal = ExtResource("14_ggrwd")
|
||||
[connection signal="toggled" from="btn_activate" to="." method="on_btn_activate_toggled"]
|
||||
[connection signal="toggled" from="btn_center" to="." method="on_btn_center_toggled"]
|
||||
[connection signal="button_down" from="zoom_plus" to="tilemap" method="_on_zoom_plus_button_down"]
|
||||
[connection signal="button_up" from="zoom_plus" to="tilemap" method="_on_zoom_plus_button_up"]
|
||||
[connection signal="button_up" from="zoom_plus" to="tilemap" method="_on_zoom_button_up"]
|
||||
[connection signal="button_up" from="zoom_plus" to="tilemap" method="_on_zoom_plus_button_up"]
|
||||
[connection signal="button_down" from="zoom_minus" to="tilemap" method="_on_zoom_minus_button_down"]
|
||||
[connection signal="button_up" from="zoom_minus" to="tilemap" method="_on_zoom_button_up"]
|
||||
[connection signal="pressed" from="btn_all_work" to="." method="_on_btn_all_work_pressed"]
|
||||
|
||||
@@ -15,21 +15,17 @@ uniform float grid_line_width = 0.0025; /* Сетка, ширина линий.
|
||||
uniform float rotation: hint_range(0, 360) = 0.0;
|
||||
uniform float ffr: hint_range(0.0, 1.0) = 0.2; /* Индикация неисправности модулей ФС. Заметность штриховки. Индикация неисправности модулей ФС */
|
||||
uniform float sfr: hint_range(0.0, 10.0) = 0.0; /* Индикация неисправности модулей ФС. Скорость движения штрховки */
|
||||
uniform float pfr: hint_range(0.01, 1.0) = 0.05; /* Индикация неисправности модулей ФС. Частота штриховки */
|
||||
|
||||
uniform float pfr: hint_range(0.01, 1.0) = 0.025; /* Индикация неисправности модулей ФС. Частота штриховки */
|
||||
|
||||
// Вариант 1: Массив цветов для каждой ячейки (4×7 = 28)
|
||||
uniform vec4 ant_band_c[28]: source_color;
|
||||
uniform uint ant_band_m[28];
|
||||
varying vec2 centered_uv;
|
||||
|
||||
const float d4 = 1.0;
|
||||
const float ds = 1.2;
|
||||
const float sf = 1.0;
|
||||
|
||||
// Вариант 2: Текстура-палитра (альтернатива)
|
||||
void vertex()
|
||||
{
|
||||
// 1. Переводим UV в координаты относительно центра (-1..1)
|
||||
centered_uv = (UV - 0.5) * 2.0;
|
||||
rotate_vec2(centered_uv, radians(rotation + 315.0), vec2(0, 0));
|
||||
}
|
||||
@@ -37,7 +33,6 @@ void vertex()
|
||||
|
||||
void fragment()
|
||||
{
|
||||
// 1. Переводим UV в координаты относительно центра (-1..1)
|
||||
float dist = length(centered_uv);
|
||||
|
||||
// 2. Отсекаем за пределами внешнего радиуса
|
||||
@@ -95,7 +90,7 @@ void fragment()
|
||||
}
|
||||
|
||||
// Подмешивание шума для включённых
|
||||
cell_color.a = alpha + random_timed(centered_uv);
|
||||
cell_color.a = alpha + random_timed(centered_uv) * cell_color.a;
|
||||
|
||||
// Индикация не исправности
|
||||
if (ant_band_m[cell_index] == ANT_BAND_FAILED)
|
||||
|
||||
Reference in New Issue
Block a user