[sub_resource type="ShaderMaterial" id="ShaderMaterial_v5r1v"]
shader = ExtResource("6_xkkpt")
shader_parameter/dots_color = Vector4(1, 0.86, 0.83, 1)
-shader_parameter/bg_color = Vector4(1, 0.95, 0.91, 1)
shader_parameter/radius = 0.09
shader_parameter/grid_size = 6.0
shader_parameter/speed = 0.1
shader_type canvas_item;
uniform vec4 dots_color = vec4(1, 0.86, 0.83, 1);
-uniform vec4 bg_color = vec4(1, 0.95, 0.91, 1);
uniform float radius: hint_range(0.0, 1.0, 0.01) = .07;
uniform float grid_size: hint_range(1.0, 200.0, 1.00) = 7.;
uniform float speed: hint_range(0.0, 1.0, 0.01) = .2;
void fragment() {
- vec2 uv = (FRAGCOORD.xy - (1.0 / SCREEN_PIXEL_SIZE).xy) / min((1.0 / SCREEN_PIXEL_SIZE).x,(1.0 / SCREEN_PIXEL_SIZE).y);
- uv *= grid_size;
+ vec2 uv = (FRAGCOORD.xy - (1.0 / SCREEN_PIXEL_SIZE).xy) / min((1.0 / SCREEN_PIXEL_SIZE).x, (1.0 / SCREEN_PIXEL_SIZE).y);
+ uv *= grid_size;
// movement
uv.x -= TIME * speed;
uv.y += TIME * speed;
// Here is where the offset is happening
- uv.x += step(1., mod(uv.y,2.0)) * .5;
+ uv.x += step(1.0, mod(uv.y, 2.0)) * .5;
// circle
vec2 fractal = fract(uv);
- float c = length(.5 - fractal);
- float min_dist = min(c, 1.);
+ float c = length(0.5 - fractal);
+ float min_dist = min(c, 1.0);
// anti-aliased
float d = length(uv);
float circle = smoothstep(radius + wd, radius - wd, min_dist);
// colors
- COLOR = mix(bg_color, dots_color, circle);
+ COLOR = mix(COLOR, dots_color, circle);
}
\ No newline at end of file