Работа в процессе. Исчезает сектор

This commit is contained in:
sasha80
2023-06-07 08:41:11 +03:00
parent 4eedfc85fc
commit 7db6da0fd0
18 changed files with 324 additions and 355 deletions

18
shaders/bip.gdshader Normal file
View File

@@ -0,0 +1,18 @@
shader_type canvas_item;
uniform vec4 color: source_color = vec4(1, 1, 1, 1);
const float ds = 0.01; // Относительное расстояние на котором выполняется сглаживание краёв
const vec2 center = vec2(0.125, 0.125); // Центр должен быть в (0.5, 0.5) но по неведомой причине это не так
const float radius = 0.125 - ds * 2.0; // Радиус должен быть 0.5, но по неведомой причине это не так
const float rate = 10.0;
float smooth_px(float r, float R)
{
return 1.0 - smoothstep(R - ds, R + ds, r);
}
void fragment()
{
COLOR = vec4(1.0, 1.0, 1.0, 1.);
COLOR = color * smooth_px(length(UV - center), radius);
}