В процессе. Добавлена работа с картами Меркатора. Добавлен общий шейдер.

This commit is contained in:
sasha80
2023-11-02 10:42:35 +03:00
parent b893781f17
commit 94206beb47
13 changed files with 818 additions and 16 deletions

13
shaders/tilemap.gdshader Normal file
View File

@@ -0,0 +1,13 @@
shader_type canvas_item;
#include "tools.gdshaderinc"
uniform vec2 center = vec2(0.5, 0.5);
uniform float radius: hint_range(0.0, 1.0) = 0.4; /* Радиус */
void fragment()
{
COLOR = texture(TEXTURE, UV) * smooth_px(length(UV - center), radius, DS);
}

View File

@@ -0,0 +1,6 @@
const float DS = 0.004; /* Относительное расстояние на котором выполняется сглаживание краёв */
float smooth_px(float r, float R, float ds)
{
return 1.0 - smoothstep(R - ds, R + ds, r);
}