From e249ab72ad4550a02bdd3081335485e03e4553bc Mon Sep 17 00:00:00 2001 From: Nick Date: Sat, 14 Mar 2020 11:40:33 -0500 Subject: Added my stuff --- src/shaders/wave-fs.glsl | 16 ++++++++++++++++ src/shaders/wave-vs.glsl | 11 +++++++++++ 2 files changed, 27 insertions(+) create mode 100644 src/shaders/wave-fs.glsl create mode 100644 src/shaders/wave-vs.glsl (limited to 'src/shaders') diff --git a/src/shaders/wave-fs.glsl b/src/shaders/wave-fs.glsl new file mode 100644 index 0000000..4923f97 --- /dev/null +++ b/src/shaders/wave-fs.glsl @@ -0,0 +1,16 @@ +in vec2 v_uv; +out vec4 frag; + +uniform sampler2D tex; +uniform vec2 position; +uniform float intensity; +uniform float time; + +void main() { + vec2 p =-1.+2.*v_uv / vec2(1,1)-position; + float cLength=length(p); + vec2 uv=v_uv+(p/cLength)*cos(cLength*32.0-time*4.0)*intensity; + vec3 col=smoothstep(0.1,.91,texture(tex,uv).xyz); + + frag = texture(tex,uv); +} \ No newline at end of file diff --git a/src/shaders/wave-vs.glsl b/src/shaders/wave-vs.glsl new file mode 100644 index 0000000..c2584f2 --- /dev/null +++ b/src/shaders/wave-vs.glsl @@ -0,0 +1,11 @@ +in vec3 pos; +in vec2 uv; +out vec2 v_uv; + +uniform mat4 projection; +uniform mat4 view; + +void main() { + gl_Position = projection * view * vec4(pos, 1.); + v_uv = uv; +} -- cgit v1.2.3