- smooth_l * get_flow(-1, 0) +
- smooth_r * get_flow(1, 0) +
- smooth_d * get_flow(0, -1) +
- smooth_u * get_flow(0, 1);
- b1 -= laplacian.x;
- b2 -= laplacian.y;
-
- // The central term of the Laplacian, for (u0, v0) only.
- // (The central term for (du, dv) is what we are solving for.)
- vec2 central = (smooth_l + smooth_r + smooth_d + smooth_u) * texture(flow_tex, tc).xy;
- b1 += central.x;
- b2 += central.y;
+ smooth_l * textureOffset(base_flow_tex, tc, ivec2(-1, 0)).xy +
+ smooth_r * textureOffset(base_flow_tex, tc, ivec2( 1, 0)).xy +
+ smooth_d * textureOffset(base_flow_tex, tc, ivec2( 0, -1)).xy +
+ smooth_u * textureOffset(base_flow_tex, tc, ivec2( 0, 1)).xy -
+ (smooth_l + smooth_r + smooth_d + smooth_u) * texture(base_flow_tex, tc).xy;
+ b1 += laplacian.x;
+ b2 += laplacian.y;