Created
June 30, 2014 17:20
-
-
Save mharju/f9453e3721e80925f9ca to your computer and use it in GitHub Desktop.
GLSL shader test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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