Skip to content

Instantly share code, notes, and snippets.

@quakeboy
Created March 14, 2013 16:23
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 quakeboy/0a80c8841bdf1b0592bd to your computer and use it in GitHub Desktop.
Save quakeboy/0a80c8841bdf1b0592bd to your computer and use it in GitHub Desktop.
Horizontal Water - 2 variations
#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);
}
#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