infinite terrain experiments
[shady.git] / postprocess_double.glsl
blob662657cbc1e51e03fb6c87cd7bac88ca5fa73c23
2 @@@ FRAGMENT SHADER
4 uniform sampler2D render;
7 uniform float radius;
8 uniform float var;
9 uniform float time;
11 void main() {
12         vec2 p = gl_TexCoord[0].st;
13         
14         vec2 diff = 0.02*radius*vec2(sin(time*1.08246),cos(time*1.0356234));
15         vec2 dist1 = var * (vec2(sin(time*0.32345), cos(time*0.23874)) + 1) / 4 + 0.5;
16         vec2 p1 = (p - 0.5) * dist1 + 0.5;
17         vec2 dist2 = var * (vec2(sin(time*0.28362), cos(time*0.33289)) + 1) / 4 + 0.5;
18         vec2 p2 = (p - 0.5) * dist2 + 0.5;
19         gl_FragColor = (texture2D(render,p1+diff)+texture2D(render,p2-diff))/2;