5 #ifdef SPLIT_YCBCR_OUTPUT
12 uniform sampler2DArray image_tex;
13 uniform sampler2D flow_tex;
18 vec2 flow = texture(flow_tex, tc.xy).xy;
19 vec4 I_0 = texture(image_tex, vec3(tc.xy - alpha * flow, 0));
20 vec4 I_1 = texture(image_tex, vec3(tc.xy + (1.0f - alpha) * flow, 1));
22 // Occlusion reasoning:
24 vec2 size = textureSize(image_tex, 0).xy;
26 // Follow the flow back to the initial point (where we sample I_0 from), then forward again.
27 // See how well we match the point we started at, which is out flow consistency.
28 float d0 = alpha * length(size * (texture(flow_tex, vec2(tc.xy - alpha * flow)).xy - flow));
31 float d1 = (1.0f - alpha) * length(size * (texture(flow_tex, vec2(tc.xy + (1.0f - alpha) * flow)).xy - flow));
34 if (max(d0, d1) < 3.0f) { // Arbitrary constant, not all that tuned. The UW paper says 1.0 is fine for ground truth.
35 // Both are visible, so blend.
36 result = I_0 + alpha * (I_1 - I_0);
43 #ifdef SPLIT_YCBCR_OUTPUT