Created
March 14, 2013 16:23
-
-
Save quakeboy/0a80c8841bdf1b0592bd to your computer and use it in GitHub Desktop.
Horizontal Water - 2 variations
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
#ifdef GL_ES | |
precision highp float; | |
#endif | |
uniform float time; | |
uniform vec2 resolution; | |
uniform vec4 mouse; | |
uniform sampler2D tex0; | |
uniform sampler2D tex1; | |
//gl_FragCoord | |
//gl_FragColor | |
//vec4() | |
void main(void) | |
{ | |
//normalized texture coordinates | |
vec2 tc = (gl_FragCoord.xy)/resolution.xy; | |
float height = sin(tc.x*25.0 + time*10.0); | |
vec3 color = texture2D(tex0 ,vec2(tc.x + height*0.01, 1.0-tc.y)).xyz; | |
gl_FragColor = vec4(color, 1.0); | |
} |
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
#ifdef GL_ES | |
precision highp float; | |
#endif | |
uniform float time; | |
uniform vec2 resolution; | |
uniform vec4 mouse; | |
uniform sampler2D tex0; | |
uniform sampler2D tex1; | |
//gl_FragCoord | |
//gl_FragColor | |
//vec4() | |
void main(void) | |
{ | |
//normalized texture coordinates | |
vec2 tc = (gl_FragCoord.xy)/resolution.xy; | |
float height = sin(tc.x*100.0 + time*10.0); | |
vec3 color = texture2D(tex0 ,vec2(tc.x + height*0.01, 1.0-tc.y)).xyz; | |
gl_FragColor = vec4(color, 1.0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment