1
0
Fork 0
space-capture/scenes/control_planet/planet_selection.gdshader

19 lines
341 B
Text
Raw Normal View History

2024-08-06 22:46:05 +02:00
shader_type canvas_item;
// Size in pixels.
uniform float size = 100.;
// Zoom level assuming a planet of normalized size.
varying float zoom;
void vertex() {
zoom = 8. / (size * CANVAS_MATRIX[0][0]);
}
void fragment() {
float r = length(UV - .5) * -8. + 2.;
float d = abs(r);
COLOR *= vec4(1., 1., 1., smoothstep(zoom, 0., d));
}