Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- shader_type canvas_item;
- float shape_polygon(vec2 uv, float sides, float size, float edge) {
- uv = 2.0*uv-1.0;
- edge = max(edge, 1.0e-8);
- float angle = atan(uv.x, uv.y)+3.14159265359;
- float slice = 6.28318530718/sides;
- return clamp((1.0-(cos(floor(0.5+angle/slice)*slice-angle)*length(uv))/size)/edge, 0.0, 1.0);
- }
- vec2 transform2_clamp(vec2 uv) {
- return clamp(uv, vec2(0.0), vec2(1.0));
- }
- vec2 transform2(vec2 uv, vec2 translate, float rotate, vec2 scale) {
- vec2 rv;
- uv -= translate;
- uv -= vec2(0.5);
- rv.x = cos(rotate)*uv.x + sin(rotate)*uv.y;
- rv.y = -sin(rotate)*uv.x + cos(rotate)*uv.y;
- rv /= scale;
- rv += vec2(0.5);
- return rv;
- }
- uniform float width = 0.1;
- uniform float lenght = 0.4;
- uniform float spread = 0.265;
- const float p_o166635_translate_y = 0.000000000;
- const float p_o166635_rotate = 90.000000000;
- const float p_o68924_sides = 4.000000000;
- const float p_o68924_radius = 0.990000000;
- const float p_o68924_edge = 0.000000000;
- const float p_o262102_translate_y = 0.000000000;
- const float p_o262102_rotate = 90.000000000;
- const float p_o262105_sides = 4.000000000;
- const float p_o262105_radius = 0.990000000;
- const float p_o262105_edge = 0.000000000;
- const float p_o329162_translate_x = 0.000000000;
- const float p_o329162_rotate = 0.000000000;
- const float p_o329171_sides = 4.000000000;
- const float p_o329171_radius = 0.990000000;
- const float p_o329171_edge = 0.000000000;
- const float p_o329165_translate_x = 0.000000000;
- const float p_o329165_rotate = 0.000000000;
- const float p_o329168_sides = 4.000000000;
- const float p_o329168_radius = 0.990000000;
- const float p_o329168_edge = 0.000000000;
- void fragment() {
- float o68924_0_1_f = shape_polygon((transform2_clamp(transform2((UV), vec2(spread*(2.0*1.0-1.0), p_o166635_translate_y*(2.0*1.0-1.0)), p_o166635_rotate*0.01745329251*(2.0*1.0-1.0), vec2(width*(2.0*1.0-1.0), lenght*(2.0*1.0-1.0))))), p_o68924_sides, p_o68924_radius*1.0, p_o68924_edge*1.0);
- vec4 o166635_0_1_rgba = vec4(vec3(o68924_0_1_f), 1.0);
- float o262105_0_1_f = shape_polygon((transform2_clamp(transform2((UV), vec2(-spread*(2.0*1.0-1.0), p_o262102_translate_y*(2.0*1.0-1.0)), p_o262102_rotate*0.01745329251*(2.0*1.0-1.0), vec2(width*(2.0*1.0-1.0), lenght*(2.0*1.0-1.0))))), p_o262105_sides, p_o262105_radius*1.0, p_o262105_edge*1.0);
- vec4 o262102_0_1_rgba = vec4(vec3(o262105_0_1_f), 1.0);
- float o329171_0_1_f = shape_polygon((transform2_clamp(transform2((UV), vec2(p_o329162_translate_x*(2.0*1.0-1.0), spread*(2.0*1.0-1.0)), p_o329162_rotate*0.01745329251*(2.0*1.0-1.0), vec2(width*(2.0*1.0-1.0), lenght*(2.0*1.0-1.0))))), p_o329171_sides, p_o329171_radius*1.0, p_o329171_edge*1.0);
- vec4 o329162_0_1_rgba = vec4(vec3(o329171_0_1_f), 1.0);
- float o329168_0_1_f = shape_polygon((transform2_clamp(transform2((UV), vec2(p_o329165_translate_x*(2.0*1.0-1.0), -spread*(2.0*1.0-1.0)), p_o329165_rotate*0.01745329251*(2.0*1.0-1.0), vec2(width*(2.0*1.0-1.0), lenght*(2.0*1.0-1.0))))), p_o329168_sides, p_o329168_radius*1.0, p_o329168_edge*1.0);
- vec4 o329165_0_1_rgba = vec4(vec3(o329168_0_1_f), 1.0);
- float o293599_0_h = 0.0;
- int o293599_0_i = 0;
- float o293599_0_h1 = (dot((o166635_0_1_rgba).rgb, vec3(1.0))/3.0);
- if (o293599_0_h1 > o293599_0_h) {
- o293599_0_h = o293599_0_h1;
- o293599_0_i = 1;
- }
- float o293599_0_h2 = (dot((o262102_0_1_rgba).rgb, vec3(1.0))/3.0);
- if (o293599_0_h2 > o293599_0_h) {
- o293599_0_h = o293599_0_h2;
- o293599_0_i = 2;
- }
- float o293599_0_h3 = (dot((o329162_0_1_rgba).rgb, vec3(1.0))/3.0);
- if (o293599_0_h3 > o293599_0_h) {
- o293599_0_h = o293599_0_h3;
- o293599_0_i = 3;
- }
- float o293599_0_h4 = (dot((o329165_0_1_rgba).rgb, vec3(1.0))/3.0);
- if (o293599_0_h4 > o293599_0_h) {
- o293599_0_h = o293599_0_h4;
- o293599_0_i = 4;
- }
- float o293599_0_1_f = o293599_0_h;
- COLOR = vec4(vec3(o293599_0_1_f), o293599_0_1_f);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement