4 flat in vec2 flow, I_0_check_offset, I_1_check_offset;
7 uniform sampler2DArray image_tex;
13 // TODO: Check if we are sampling out-of-image.
14 // TODO: See whether using intensity values gives equally good results
15 // as RGB, since the rest of our pipeline is intensity.
16 vec3 I_0 = texture(image_tex, vec3(image_pos + I_0_check_offset, 0)).rgb;
17 vec3 I_1 = texture(image_tex, vec3(image_pos + I_1_check_offset, 1)).rgb;
18 vec3 diff = abs(I_1 - I_0);
19 gl_FragDepth = 0.125 * (diff.x + diff.y + diff.z); // Make sure we stay well under the 1.0 maximum.