Рефактор.

This commit is contained in:
sasha80
2024-01-23 14:30:13 +03:00
parent 280bf1ddd3
commit 68e5b55f51
10 changed files with 85 additions and 86 deletions

View File

@@ -65,7 +65,7 @@ void sector(inout vec4 c, vec2 uv, vec2 center, float a, float da, float r0, flo
void antenas(inout vec4 c, vec2 uv, vec2 p0, int cnt, float r0, float r1, vec4 c0, vec4 c1)
{
float da = 180.0f / float(cnt);
float da = 180.0 / float(cnt);
for (int i = -cnt; i <= cnt; i ++)
{
float v = float(i & 1);
@@ -85,7 +85,7 @@ void fragment()
{
ivec2 isz = textureSize(TEXTURE, 0);
vec2 uv = UV * vec2(float(isz.x), float(isz.y)); // координаты текущей точки в пикселях
COLOR = vec4(0, 0, 0, 0.0); //texture(TEXTURE, UV); // Цвет текущей точки
COLOR = vec4(0, 0, 0, 0); //texture(TEXTURE, UV); // Цвет текущей точки
// Сетка антенн
antenas(COLOR, uv, pc0, ant_band_count_0, ant_band_r0_0[mode], ant_band_r1_0[mode], color1, color0);

View File

@@ -1,6 +1,6 @@
shader_type canvas_item;
#include "tools.gdshaderinc"
#include "res://shaders/tools.gdshaderinc"
/* Закрашенная окружность */
uniform vec4 color: source_color = vec4(1, 1, 1, 1);

View File

@@ -1,6 +1,6 @@
shader_type canvas_item;
#include "tools.gdshaderinc"
#include "res://shaders/tools.gdshaderinc"
/* Закрашенный сектор окружности ограниченный угловым сектором и радиусами */

View File

@@ -1,6 +1,6 @@
shader_type canvas_item;
#include "tools.gdshaderinc"
#include "res://shaders/tools.gdshaderinc"
/* Рисует текстуру по маске в форме окружности */
@@ -11,4 +11,3 @@ void fragment()
{
COLOR.a *= smooth_px(length(UV - center), radius, DS);
}

View File

@@ -1,4 +1,7 @@
shader_type canvas_item;
#include "res://shaders/tools.gdshaderinc"
uniform vec4 ColorFig:source_color;
uniform vec2 point_1;
uniform vec2 point_2;
@@ -14,10 +17,6 @@ const float DSS = 0.002525;
const float radius = 0.125;
uniform float speed: hint_range(0.0, 1024.0) = 0.0;
float smooth_px(float r, float R, float dss)
{
return 1.0 - smoothstep(R - dss, R + dss, r);
}
float line(vec2 p1, vec2 p2, float width, vec2 uv)
{