// Convert the patch index to being the full 0..1 range, to match where
// the motion search puts the patches. We don't bother with the locking
// to texel centers, though.
// Convert the patch index to being the full 0..1 range, to match where
// the motion search puts the patches. We don't bother with the locking
// to texel centers, though.
// Increase the patch size a bit; since patch spacing is not necessarily
// an integer number of pixels, and we don't use conservative rasterization,
// Increase the patch size a bit; since patch spacing is not necessarily
// an integer number of pixels, and we don't use conservative rasterization,
image_pos = patch_center + patch_size * (grown_pos - 0.5f);
// Find the flow value for this patch, and send it on to the fragment shader.
image_pos = patch_center + patch_size * (grown_pos - 0.5f);
// Find the flow value for this patch, and send it on to the fragment shader.
- vec3 flow_du_and_mean_diff = texelFetch(flow_tex, ivec2(patch_x, patch_y), 0).xyz;
+ vec3 flow_du_and_mean_diff = texelFetch(flow_tex, ivec3(patch_x, patch_y, patch_layer), 0).xyz;
// 0.000 0.000 -2.000 -1.000
// 0.000 0.000 0.000 1.000
gl_Position = vec4(2.0 * image_pos.x - 1.0, 2.0 * image_pos.y - 1.0, -1.0, 1.0);
// 0.000 0.000 -2.000 -1.000
// 0.000 0.000 0.000 1.000
gl_Position = vec4(2.0 * image_pos.x - 1.0, 2.0 * image_pos.y - 1.0, -1.0, 1.0);