+ vec3 tex_scale = vec3(1.0/vec2(textureSize(depth, 0)), 0.0);
+
+ vec3 center = get_fragment_position(texcoord);
+ vec3 left = get_fragment_position(texcoord-tex_scale.xz);
+ vec3 right = get_fragment_position(texcoord+tex_scale.xz);
+ vec3 bottom = get_fragment_position(texcoord-tex_scale.zy);
+ vec3 top = get_fragment_position(texcoord+tex_scale.zy);
+
+ vec3 normal = normalize(cross(get_slope(left, center, right), get_slope(bottom, center, top)));
+ vec3 tangent = (abs(normal.x)>abs(normal.y) ? vec3(-normal.z, 0.0, normal.x) : vec3(0.0, -normal.z, normal.y));
+ vec3 binormal = cross(normal, tangent);
+