6 uniform sampler2D left_tex, right_tex, up_tex, down_tex;
10 // Some of these may contain “junk”, in the sense that they were
11 // not written in the given pass, if they came from an edge.
12 // Most of the time, this is benign, since it means we'll get
13 // the previous value (left/right/up) again. However, if it were
14 // bogus on the very first pass, we need to exclude it.
15 // Thus the test for 100.0f (invalid flows are initialized to 1000,
16 // all valid ones are less than 1).
17 vec2 left = texture(left_tex, tc).xy;
18 vec2 right = texture(right_tex, tc).xy;
19 vec2 up = texture(up_tex, tc).xy;
20 vec2 down = texture(down_tex, tc).xy;
22 vec2 sum = vec2(0.0f);
24 if (left.x < 100.0f) {
28 if (right.x < 100.0f) {
36 if (down.x < 100.0f) {
41 // If _all_ of them were 0, this would mean the entire row _and_ column
42 // would be devoid of flow. If so, the zero flow is fine for our purposes.
44 out_flow = vec2(0.0f);