Skip to content

Instantly share code, notes, and snippets.

@Iainmon
Created August 6, 2022 22:40
Show Gist options
  • Save Iainmon/178f47de4dd7e83dc5cf765b96c1691b to your computer and use it in GitHub Desktop.
Save Iainmon/178f47de4dd7e83dc5cf765b96c1691b to your computer and use it in GitHub Desktop.
const float rt = sqrt(2.);
float anim(float speed) {
return (.5*sin(iTime * speed)) + 0.5;
}
const vec3 paint = vec3(0.17, 0.55, 0.70);
void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
vec2 uv = fragCoord/iResolution.xy;
uv -= vec2(.5);
uv.x *= iResolution.x / iResolution.y;
vec2 st = uv;
float zoom = 8.;
float r = 3. * anim(1.); // radius
float k = 80.; // falloff
float d = distance(length(st * zoom),r);
float g = 1./((k * pow(d,2.)) + 1.);
vec3 col = mix(paint,vec3(1.),g);
float b = smoothstep(r,r+0.03,length(zoom * st));
col = mix(col,paint,b);
fragColor = vec4(col,1.0);
}
@Iainmon
Copy link
Author

Iainmon commented Aug 8, 2022

Orange!

const float rt = sqrt(2.);

float anim(float speed) {
    return (.5*sin(iTime * speed)) + 0.5;
}

const vec3 paint = vec3(1.00, 0.68, 0.17);

void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
    vec2 uv = fragCoord/iResolution.xy;
    uv -= vec2(.5);
    uv.x *= iResolution.x / iResolution.y;
    
    vec2 st = uv;
    
    float zoom = 8.;
    float r    = 3. * anim(1.);  // radius
    float k    = 250.; // falloff
    float d = distance(length(st * zoom),r) * sin(6.28*atan(st.x,st.y));
    float g = 1./((k * pow(d,2.)) + 1.);

    vec3 col = mix(paint,vec3(1.),g);
    float b = smoothstep(r,r+0.01,length(zoom * st));
    col = mix(col,paint,b);

    fragColor = vec4(col,1.0);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment