Skip to content

Instantly share code, notes, and snippets.

@0xdeadbeer
Created December 4, 2023 17:20
Show Gist options
  • Save 0xdeadbeer/c9c428af1d1728b40243cfd0039ebe6e to your computer and use it in GitHub Desktop.
Save 0xdeadbeer/c9c428af1d1728b40243cfd0039ebe6e to your computer and use it in GitHub Desktop.
Water effect with GLSL
#version 300 es
precision highp float;
precision highp sampler2D;
in vec2 uv;
out vec4 out_color;
uniform vec2 u_resolution;
uniform float u_time;
uniform vec4 u_mouse;
uniform sampler2D u_textures[16];
void main(){
float strength = 0.04;
float zoom = 5.0;
float scrollSpeed = 0.1;
vec4 noise_col = texture(u_textures[1], (uv / zoom) + (u_time * scrollSpeed));
vec4 output_col = texture(u_textures[0], uv + (noise_col.rr * strength));
out_color = output_col;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment