+
+vec3 get_fragment_position(vec2 tc)
+{
+ return unproject(vec3(tc*2.0-1.0, texture(depth, tc).r));
+}
+
+vec3 get_slope(vec3 a, vec3 x, vec3 b)
+{
+ float dz1 = abs(x.z-a.z);
+ float dz2 = abs(b.z-x.z);
+ return (dz1>2.0*dz2 ? b-x : dz2>2.0*dz1 ? x-a : b-a);
+}