Created
March 24, 2011 07:50
-
-
Save Zolomon/884717 to your computer and use it in GitHub Desktop.
The rings of Uranus
This file contains hidden or 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
| #ifdef GL_ES | |
| precision highp float; | |
| #endif | |
| uniform float time; | |
| uniform vec2 resolution; | |
| uniform vec4 mouse; | |
| uniform sampler2D tex0; | |
| uniform sampler2D tex1; | |
| void main(void) | |
| { | |
| vec2 p = gl_FragCoord.xy / resolution.xy; | |
| vec2 m = mouse.xy / resolution.xy; | |
| float a1 = atan(m.y-p.y,p.x-m.x); | |
| float r1 = sqrt(dot(p-m,p-m)); | |
| vec2 uv; | |
| uv.x = 0.1*time + (r1-a1)*0.25; | |
| uv.y = sin(2.0*(a1-r1)); | |
| float w = r1*a1*1.0; | |
| vec3 col = texture2D(tex0,uv).xyz; | |
| gl_FragColor = vec4(col/(.1+w),1.0); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment