Skip to content

Instantly share code, notes, and snippets.

@mharju
Created Jun 30, 2014
Embed
What would you like to do?
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