В процессе. Добавлена работа с картами Меркатора. Добавлен общий шейдер.
This commit is contained in:
13
shaders/tilemap.gdshader
Normal file
13
shaders/tilemap.gdshader
Normal 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);
|
||||
}
|
||||
|
||||
6
shaders/tools.gdshaderinc
Normal file
6
shaders/tools.gdshaderinc
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user