Skip to content

Instantly share code, notes, and snippets.

@mk30
Created August 11, 2015 03:47
Show Gist options
  • Select an option

  • Save mk30/6be3ee0f9ff7df4dbfa1 to your computer and use it in GitHub Desktop.

Select an option

Save mk30/6be3ee0f9ff7df4dbfa1 to your computer and use it in GitHub Desktop.
shader template
vec3 hsl2rgb(in float h, float s, float l) {
vec3 rgb = clamp( abs(mod(h*6.0+vec3(0.0,4.0,2.0),6.0)-3.0)-1.0, 0.0, 1.0);
return l + s * (rgb-0.5)*(1.0-abs(2.0*l-1.0));
}
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
float t = iGlobalTime;
vec2 uv = fragCoord.xy / iResolution.xy;
float x = uv.x, y = uv.y;
float h = 0.4 * t;
float s = 1.0;
float l = 0.4;
fragColor = vec4(hsl2rgb(h, s, l), 1.0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment