diff --git a/weird/hud.glsl b/weird/hud.glsl index 1b167c8..cb675af 100644 --- a/weird/hud.glsl +++ b/weird/hud.glsl @@ -88,18 +88,18 @@ void main(){ vec3 color = vec3(0.0); vec2 st = get_st(); float clip = circle_clip(.5); - - - color += circle(get_center(), 0.002, 0.02, blue1); - color += circle(get_center(), 0.002, 0.3, blue1); - color += circle(get_center(), 0.002, 0.4, blue1); - color += circle(get_center(), 0.005, 0.5, vec3(0.8)); - color += circle(get_center(), 0.007, 0.6, blue1); + + + color += circle(get_center(), 0.002, 0.02, blue1); + color += circle(get_center(), 0.002, 0.3, blue1); + color += circle(get_center(), 0.002, 0.4, blue1); + color += circle(get_center(), 0.005, 0.5, vec3(0.8)); + color += circle(get_center(), 0.007, 0.6, blue1); color += clip*line(0.001, PI/4., vec3(.5), get_center()); - color += clip*line(0.001, -PI/4., vec3(.5), get_center()); + color += clip*line(0.001, -PI/4., vec3(.5), get_center()); color += clip*line_with_trace(0.001, u_time, blue2, get_center()); color += floating_circle(); color += target(); - + gl_FragColor = vec4(color,1.0); } diff --git a/weird/voronoi2.glsl b/weird/voronoi2.glsl new file mode 100644 index 0000000..a9f8648 --- /dev/null +++ b/weird/voronoi2.glsl @@ -0,0 +1,51 @@ +#ifdef GL_ES +precision mediump float; +#endif + +uniform vec2 u_resolution; +uniform vec2 u_mouse; +uniform float u_time; + +vec2 random2( vec2 p ) { + return fract(sin(vec2(dot(p,vec2(127.1,311.7)),dot(p,vec2(269.5,183.3))))*43758.5453); +} + +void main() { + vec2 st_ = gl_FragCoord.xy/u_resolution.xy; + vec2 st = st_; + st.x *= u_resolution.x/u_resolution.y; + + vec3 color = vec3(.0); + + st *= 50.; + + vec2 i_st = floor(st); + vec2 f_st = fract(st); + + float m_dist = 1.; + vec2 m_point = vec2(0.); + + for (int y= -1; y <= 1; y++) { + for (int x= -1; x <= 1; x++) { + vec2 neighbor = vec2(float(x),float(y)); + vec2 point = random2(i_st + neighbor); + point = 0.5 + 0.5*sin(u_time + 6.2831*point); + vec2 diff = neighbor + point - f_st; + float dist = length(diff); + + if (dist < m_dist) { + m_dist = dist; + m_point = point; + } + } + } + + color += m_dist; + + color.rgb *= vec3(216./255.,203./255.,161./255.) * smoothstep(0.0001, 0.001, m_point.y+0.01); + + float resmin = min(u_resolution.x, u_resolution.y); + color -= smoothstep(0.47, 0.5, distance(gl_FragCoord.xy/resmin, (u_resolution/2.)/resmin)); + + gl_FragColor = vec4(color,1.0); +}