--- turing-fluid.html 2015-02-05 16:11:00.257444768 -0800
+++ turing-fluid-fixed.html 2015-02-05 16:16:14.501291164 -0800
@@ -132,9 +132,10 @@
uniform float time;
void main(void) {
+ vec2 uv = vec2(0, 0);
vec2 motion = decode2( texture2D(sampler_fluid, uv))*pixelSize*0.75;
- vec2 uv = uv - motion; // add fluid motion
+ uv = uv - motion; // add fluid motion
vec4 noise = texture2D(sampler_noise, uv_orig + rnd.xy)-0.5;
gl_FragColor.y = texture2D(sampler_prev, uv).y + noise.y*1./256.;
@@ -204,7 +205,7 @@
d = pixelSize*4.;
- vec2 gz; // blue blur2 gradient vector
+ vec2 gz = vec2(0, 0); // blue blur2 gradient vector
gz.x += texture2D(sampler_blur2, uv-vec2(1.,0.)*d).z - texture2D(sampler_blur2, uv+vec2(1.,0.)*d).z;
gz.y += texture2D(sampler_blur2, uv-vec2(0.,1.)*d).z - texture2D(sampler_blur2, uv+vec2(0.,1.)*d).z;
@@ -987,4 +988,4 @@
-