From 33e34940f52d4f3aef898a50e2a10d182a18ff38 Mon Sep 17 00:00:00 2001 From: Rivo Laks Date: Fri, 2 Nov 2007 17:29:54 +0000 Subject: [PATCH] Those moved, too svn path=/trunk/KDE/kdebase/workspace/; revision=732056 --- effects/data/liquid.frag | 50 ---------------------------------------- effects/data/liquid.vert | 7 ------ 2 files changed, 57 deletions(-) delete mode 100644 effects/data/liquid.frag delete mode 100644 effects/data/liquid.vert diff --git a/effects/data/liquid.frag b/effects/data/liquid.frag deleted file mode 100644 index f2515fe845..0000000000 --- a/effects/data/liquid.frag +++ /dev/null @@ -1,50 +0,0 @@ -uniform sampler2D sceneTex; -uniform float textureWidth; -uniform float textureHeight; -uniform float time; - -varying vec2 pos; - - -#define DEG2RAD (6.2832/360.0) - - -// Converts pixel coordinates to texture coordinates -vec2 pix2tex(vec2 pix) -{ - return vec2(pix.x / textureWidth, 1.0 - pix.y / textureHeight); -} - -float wave(vec2 pos, vec2 wave_dir, float wave_length, float wave_speed) -{ - return sin(((pos.x * wave_dir.x) + (pos.y * wave_dir.y)) * 6.2832 / wave_length + - time * wave_speed * 6.2832 / wave_length); -} - -vec2 displacement(float wave_angle, float wave_length, float wave_speed, float wave_height) -{ - vec2 wave_dir = vec2(cos(wave_angle * DEG2RAD), sin(wave_angle * DEG2RAD)); - return wave_dir * (wave(pos, wave_dir, wave_length, wave_speed) * wave_height); -} - -// Only for debugging -float wave_color(float wave_angle, float wave_length, float wave_speed, float wave_height) -{ - vec2 wave_dir = vec2(cos(wave_angle * DEG2RAD), sin(wave_angle * DEG2RAD)); - return wave(pos, wave_dir, wave_length, wave_speed) * 0.5 + 0.5; -} - -void main() -{ - vec2 texpos = pos; - texpos += displacement( 20.0, 250.0, 120.0, 4.0); - texpos += displacement(-40.0, 350.0, 100.0, 4.0); - texpos += displacement(240.0, 1000.0, 100.0, 12.0); - texpos += displacement(160.0, 50.0, 30.0, 2.0); - - vec3 tex = texture2D(sceneTex, pix2tex(texpos)).rgb; - //tex.r = wave_color( 20, 250, 150, 4); // debug - - gl_FragColor = vec4(tex, 1.0); -} - diff --git a/effects/data/liquid.vert b/effects/data/liquid.vert deleted file mode 100644 index 55d169df80..0000000000 --- a/effects/data/liquid.vert +++ /dev/null @@ -1,7 +0,0 @@ -varying vec2 pos; - -void main() -{ - pos = gl_Vertex.xy; - gl_Position = ftransform(); -}