Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skullface/9f5823e3f6e2533f388275bb3baa5a18 to your computer and use it in GitHub Desktop.
Save skullface/9f5823e3f6e2533f388275bb3baa5a18 to your computer and use it in GitHub Desktop.
what i ended up with from today’s shader workshop!
// giant circle owo
float circ(vec2 p) {
return length(p - 0.9) - 0.1;
}
// cycle thru color via cosine function
vec3 cosPalette( float t, vec3 a, vec3 b, vec3 c, vec3 d ) {
return a + b*cos( 6.28318*(c*t+d) );
}
void main () {
//position in center
vec2 position = uv();
vec2 positionN = uvN();
float swirler = log(length(position)) * .5;
// create our giant circle and scale position
float shape = circ( position * vec2(0.4));
// variables to pass through cosPalette function
vec3 brightness = vec3(0.5,0.5,0.5);
vec3 contrast = vec3(0.5,0.5,0.5);
vec3 osc = vec3(1.0,1.0,1.0);
vec3 phase = vec3(0.0,0.33,0.67);
// determine color via custom vars in cosPalette function
vec3 colourRainbow = cosPalette(time/12.0, brightness, contrast, osc, phase);
// color this puppy
colourRainbow = vec3(shape) * colourRainbow;
// swirly noise
vec2 p = vec2(sin(positionN.x * 1.0),swirler);
float v = abs(snoise(time/100.0 + p * 8.0 + 2.0 )) * -1.3 + 1.6;
// make some bloobs
vec3 bloob = vec3(0.034,0.098,0.990);
position = rotate(position, vec2(0.), time/300.0);
float f = voronoi(position * 8.0 * bands.y + time) ;
bloob+= step(bands.y, f) * magenta;
position = rotate(position, vec2(0.01), time/12.0);
float f2 = voronoi((position) * 200.0 * bands.z + time);
bloob+= step(bands.z, f2) * colourRainbow;
position = rotate(position, vec2(0), time/30.0);
float f3 = voronoi(position * 6.2 * bands.w + vec2(0,time*2.50));
bloob+= step(bands.w, (v * 1.1) * f3) * vec3(1.000,0.581,0.929);
gl_FragColor = vec4(bloob, 1.0);
}
@skullface
Copy link
Author

here’s the minimal version!

// giant circle owo
float circ(vec2 p) {
  return length(p - 0.9) - 0.1;  
}

// cycle thru color via cosine function
vec3 cosPalette( float t, vec3 a, vec3 b, vec3 c, vec3 d ) {
  return a + b*cos( 6.28318*(c*t+d) );
}

void main () {
  //position in center
  vec2 position = uv(); 
  vec2 positionN = uvN(); 
  
  float swirler = log(length(position)) * .5;
    
  // create our giant circle and scale position
  float shape = circ( position * vec2(0.4));
    
  // variables to pass through cosPalette function
  vec3 brightness = vec3(0.5,0.5,0.5);
  vec3 contrast = vec3(0.5,0.5,0.5);
  vec3 osc = vec3(1.0,1.0,1.0);
  vec3 phase = vec3(0.0,0.33,0.67);

  // determine color via custom vars in cosPalette function
  vec3 colourRainbow = cosPalette(time/12.0, brightness, contrast, osc, phase);

  // color this puppy
  colourRainbow = vec3(shape) * colourRainbow;
  
  // swirly noise
  vec2 p = vec2(sin(positionN.x * 1.0),swirler);
  float v = abs(snoise(time/100.0 + p * 8.0 + 2.0 )) * -1.3 + 1.6;
  
  // make some bloobs
  vec3 bloob = vec3(0.034,0.098,0.990);
  
  position = rotate(position, vec2(0.1), time/4.0);
  float f = voronoi(position * 0.9 + time/4.0);
  bloob += step(0.8, v + f) + colourRainbow;
  
  gl_FragColor = vec4(bloob, 1.0);
}

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