3 // Warps I_1 according to the flow, then computes the mean and difference to I_0.
8 uniform sampler2D image0_tex, image1_tex, flow_tex;
12 vec3 flow = texture(flow_tex, tc).xyz;
13 flow.xy /= flow.z; // Normalize the sum coming out of the densification.
15 float I_0 = texture(image0_tex, tc).x;
16 float I_w = texture(image1_tex, tc + flow.xy).x; // NOTE: This is effectively a reverse warp since texture() is a gather operation and flow is conceptually scatter.
18 I = 0.5f * (I_0 + I_w);