Project_2026-08-15_18-22-06

GLSL shader by scry · created 2026-08-16 · 10s loop · 2 passes

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)

// Creates a staircase-like wave from a sine wave.
float sc(float x) {
    return x-sin(x);
}

// Iteratively applies sc() for a more pronounced staircase effect.
float sci(float x, int n) {
    for (int i=0;i<n;i++) {
        x = sc(x);
    }
    return x;
}
// Transforms a sine wave into a more square-like wave.
float fs(float x) {
    return sin(3.14159/2.*cos(x));
}

// Iteratively applies fs() to create a more pronounced square wave effect.
float fsi(float x, int n) {
    for (int i=0;i<n;i++) {
        x = (fs(x+3.14159/2.)-3.14159)*1.002;
    }
    return (x+3.14159);
}

void mainImage(out vec4 fragColor, in vec2 fragCoord) {
    vec2 uv = fragCoord.xy / iResolution.xy;
    vec2 tv = uv;
    uv -= 0.5;
    uv.x *= ar;
    vec3 col = vec3(0.);
    float t = time/10.;
    for (int i=0;i<13;i++) {
        float ii = float(i+1);
        uv = abs(uv)-(fsi(t*5.+floor(ii*0.5)+uv.y*2.,5)/5.)*0.4;
        //uv = abs(uv)-(sin(ii+sci(t*1.+ii*pi,2)/1.)*0.5+0.5)*0.3;
        //uv = abs(uv)-sin(ii+sin(time+ii*pi)+time)*0.2;
        if (i > 99) {
            uv *= r2d(deg*45./2.);
        }
        uv *= r2d(deg*45.);
    }
    //uv *= r2d(deg*45./2.);
    uv *= 10.;
    uv.y *= 2.;
    vec2 gv = floor(uv);
    
    uv.x += cos(gv.y*pi)*0.25;
    gv = floor(uv);
    uv = fract(uv);
    uv.y /= 2.;
    float b = min(abs(abs(uv.x-0.5)-0.5),abs(abs(uv.y-0.25)-0.25));
    col -= smoothstep(0.2,0.,b)*1.2;
    //gv *= r2d(deg*90.*2.);
    //col += mix(vec3(1.,0.,1.),vec3(0.,0.,1.),cos(gv.x*pi)*0.5+0.5);
    //col *= 0.2;
    col += sin(cs+gv.x)*0.5+0.5;
    col *= 0.6;
    col += 0.2;
    col = pow(col,vec3(1./1.5));
    //col.rg += gv*0.2;
    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