4 flat in vec2 flow, I_0_check_offset, I_1_check_offset;
7 uniform sampler2DArray gray_tex;
13 // TODO: Check if we are sampling out-of-image.
14 float I_0 = texture(gray_tex, vec3(image_pos + I_0_check_offset, 0)).r;
15 float I_1 = texture(gray_tex, vec3(image_pos + I_1_check_offset, 1)).r;
16 float diff = abs(I_1 - I_0);
17 gl_FragDepth = 0.125 * diff.x; // Make sure we stay well under the 1.0 maximum.