Directional Coordination

GLSL shader by scry · created 2026-02-13 · 20s loop · 2 passes

Tags: 2d, Animation, Abstract, Symmetry, Layers

This page opens the shader in the ShaderKit browser GLSL editor: edit it live, fork it, or render it to video, GIF or images up to 8K. Also available as a full-screen view and an embeddable player.

Shader source (GLSL)

Common

#define pi acos(-1.)
#define deg pi/180.  //1 degree
#define time iTime*2.*pi/10. //sin(time) loops 10 seconds
#define R iResolution.xy //shorthand
#define ar R.x/R.y //aspect ratio
#define M iMouse //shorthand
#define xm (M.xy/R) //normalized mouse
#define nm ((xm.xy-0.5)*vec2(ar,1.)+0.5) //aspect ratio correction
vec3 cs = vec3(1.,2.,3.);
mat2 r2d(float a) {
    return mat2(cos(a),sin(a),-sin(a),cos(a));
}

Buffer A (iChannel0)

// SDF for ^ shape (upward pointing triangle/chevron)
float sdChevron(vec2 p, vec2 q) {
    p.x = abs(p.x);
    vec2 a = p - q*clamp(dot(p,q)/dot(q,q), 0.0, 1.0);
    return abs(length(a) * sign(p.y*q.x - p.x*q.y));
}

vec3 c1(vec2 uv) {
    uv -= 0.5;
    uv.x *= ar;
    vec3 col = vec3(0.);
    uv *= 1.4;
    uv = vec2(length(uv)-0.5,atan(uv.x,uv.y));
    uv.x = log(uv.x+0.5);
    
    float gs = 4.5;
    float ug = floor(uv.x*gs-0.5);
    uv.x = (fract(uv.x*gs-0.5)-0.5)/gs;
    
    uv.y *= mod(ug,2.)*2.-1.;
    float s = 10.;
    float ag = ug*pi/2.;
    float as = sin(uv.y-time*1.+ag)*1.;
    uv.y -= cos(uv.y-time*1.+ag)/1.5;
    
    uv.y /= pi/2.;
    float gc = uv.y;
    
    s += as*6.;
    
    uv.y = (fract(uv.y*10.)-0.5)/s;
    
    float d = sdChevron(uv, vec2(0.1));
    //gc = floor(d*1.+0.9);
    d = min((d), sdChevron(uv+vec2(0.,1./s),vec2(0.1)));
    d = min((d), sdChevron(uv-vec2(0.,-2./s),vec2(0.1)));
    gc = floor(gc+d*120.+time*0.);
    //col.r += sin(gc*pi/2.)*0.2;
    vec3 c = vec3(1.0, 0.5, 0.2);
    c = sin(c+time*0.+ug*pi/2.+gc*pi)*0.5+0.5;
    col += mix(c, vec3(0.), smoothstep(0.0, 0.01, abs(d)));
    //col += sin(d*20.);
    return col;
}

void mainImage(out vec4 fragColor, in vec2 fragCoord) {
    vec2 uv = fragCoord.xy / iResolution.xy;
    vec3 col = vec3(0.);
    
    for (int i=0;i<12;i++) {
        float ii = float(i);
        float fi = fract(ii/8.+time/pi/2.);
        float f2 = fract(ii/8.+time/pi/2.+0.5);
        float afi = abs(fi-0.5)*2.;
        float af2 = abs(fi-0.5)*2.;
        float nfi = 1.-fi;
        float nf2 = 1.-f2;
        float naf2 = 1.-af2;
        float nafi = 1.-afi;
        vec2 av = uv;
        av += sin(uv.yx*8.+ii*pi/3.)*0.5*pow(nf2,4.);
        //uv -= 0.5;
        //uv *= r2d(deg*45.);
        //uv = abs(uv)-0.5;
        //uv += 0.5;
        av -= 0.5;
        av = av/dot(av,av)*0.2;
        av *= r2d(ii*pi/12.);
        av += sin(time/2.+ii*pi/8.)*0.*nf2;
        av = mix(av,uv,0.1);
        //uv = abs(uv)-0.1;
        //av = abs(av)-0.5;
        vec3 c = c1(av)*afi*(sin(ii+sin(uv.x*4.+ii)*sin(uv.y*4.+ii)+time)*0.5+0.5);
        col += c;
    }

    fragColor = vec4(col, 1.0);
}

Image

Not used

More shaders by scry

Browse all public shaders · All shaders by scry · ShaderKit home

Vibe Mode BETA
💰 ~0 credits
Uniforms
FPS: 0
Time: 0
Resolution: 0 x 0

Account

FPS: -- Time: -- --×-- 1x