0.00
60.0 fps

Log in to post a comment.

#version 300 es
precision highp float;

// Welcome to OneShader!
//
// OneShader is a community for creative coding. We believe the joy 
// is in the craft. 
//
// ---------------------------------------------------------------
// A NOTE ON AI:
// Please do not publish code entirely generated by AI. 
// We want to see YOUR creativity, your mistakes, and your logic. 
// If you use AI to learn, try to rewrite the code yourself before 
// sharing, so others can learn from your human approach.
// ---------------------------------------------------------------
//
// API Reference: https://oneshader.net/syntax

uniform float iTime;
uniform vec2  iResolution;
uniform float gap; // value=0.8, min=0, max=1, step=0.001
uniform float speed; // value=4., min=-25, max=25, step=0.1
uniform float ci; // value=0.08, min=0, max=1, step=0.001
uniform vec3 color; // value=0.467,0.067,1.
uniform float colorAlpha; // value=1., min=0, max=1, step=0.001
uniform float fxenable;// value=1., min=0, max=1, step=1.
uniform float Gradientenable;// value=1., min=0, max=1, step=1.

// TRY THIS: Create a UI slider by uncommenting the line below:
// uniform float speed; // value=1, min=0, max=5, step=0.001

out vec4 fragColor;

void main() {

    float PI = 3.1415927;

    vec2 UV = gl_FragCoord.xy/iResolution.xy;
    UV.x *= iResolution.x/iResolution.y;

    UV.x += (iResolution.x*0.5 - iResolution.x*(iResolution.x/iResolution.y)*0.5)/iResolution.x;

    //UV = (UV - 0.5) * 2.;

    vec2 uv = fract(UV*3.);
    
    uv = (uv - 0.5) * 2.;

    vec2 UVID = floor(UV*3. - 1.)*4.;

    float angleID = floor((atan(UVID.y, UVID.x) + PI + 0.001) / (PI/4.));
    float IDnow = floor(mod(iTime*speed, 8.) + 1.); 
    
    bool visable = (abs(uv.x) < gap && abs(uv.y) < gap) && !(abs(UVID.x) > 4.);

    vec3 fcolor = color.rgb;
    vec3 fxcolor = color.rgb / (abs(uv.x) + abs(uv.y))*ci*(1. - gap*(abs(uv.x) + abs(uv.y))); //color.rgb / (abs(uv.x) * sin(u_time) + abs(uv.y) * tan(u_time))*ci

    if (bool(Gradientenable)) {

    	fcolor = vec3((abs(UVID.y) + abs(UVID.x) == 0. ? 0. : (mod(atan(UVID.y, UVID.x) + PI + 0.001 - (IDnow / 4. * PI), 2.*PI) / (2.*PI)))) * (bool(fxenable) ? fxcolor : color.rgb);
    } else {

    	fcolor = vec3((IDnow == angleID) ? 0. : (abs(UVID.y) + abs(UVID.x) == 0. ? 0. : 1.)) * (bool(fxenable) ? fxcolor : color.rgb); //(abs(uv.x) * abs(uv.y))*ci
    }

    fragColor = vec4(fcolor, 1.)*(visable ? colorAlpha : 0.);
}