Skip to content

Instantly share code, notes, and snippets.

@mharju
Created June 30, 2014 17:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mharju/f9453e3721e80925f9ca to your computer and use it in GitHub Desktop.
Save mharju/f9453e3721e80925f9ca to your computer and use it in GitHub Desktop.
GLSL shader test
void main(void)
{
vec2 n = 2.0 * (gl_FragCoord.xy / iResolution.xy) - 1.0;
vec2 uv = vec2(0,0);
float theta = iGlobalTime * 0.2;
uv.x = cos(theta) * n.x + sin(theta) * n.y;
uv.y = -sin(theta) * n.x + cos(theta) * n.y;
vec4 v = texture2D(iChannel0, vec2(0.0,iChannelTime[0]));
float col = 0.0;
float i = 1.0;
for(float i=1.0;i<16.0;i++)
{
uv.x += sin(100.0*i + 0.5 * uv.y + iGlobalTime * 5.0) * v.x;
col += abs((.003*i)/uv.x) * v.x * v.x;
}
col = 1.0 - col;
gl_FragColor = vec4(col, col, col, 1.0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment