 
     float depthDiff = hitCoords.z - depth;
 
-    if ((dir.z - depthDiff) < 1.2) {
-      if (depthDiff <= 0.0)
+    if (dir.z - depthDiff < 1.2) {
+      if (depthDiff >= 0.0)
         return projCoords.xy/*binaryRefinement(dir, hitCoords)*/;
     }
   }

  for (uint i = 0u; i < maxRaySteps; ++i) {
    hitCoords += dir;

    projCoords = vec4(hitCoords, 1.0);
    projCoords.xy /= projCoords.w;
    projCoords.xy = projCoords.xy * 0.5 + 0.5;


}

void main() {
  vec3 viewNormal = (uniInvProjMatrix * texture(uniSceneNormalBuffer, fragTexcoords)).rgb;

  float depth = texture(uniSceneDepthBuffer, fragTexcoords).r;
  vec3 projPos = vec3(fragTexcoords.x, 1.0 - fragTexcoords.y, depth) * 2.0 - 1.0;
  vec4 viewPos = uniInvProjMatrix * vec4(projPos, 1.0);
  viewPos /= viewPos.w;
  //vec3 worldPos = (uniInvViewMatrix * viewPos).xyz;

  //vec3 jittering = mix(vec3(0.0), vec3(hash(worldPos)), 1.0);

  vec3 reflectDir = reflect(normalize(viewPos.xyz), normalize(viewNormal));
  vec3 reflectColor = texture(uniSceneColorBuffer, recoverHitCoords(reflectDir * max(0.1, -viewPos.z), viewPos.xyz)).rgb;

  fragColor = vec4(reflectColor + texture(uniSceneColorBuffer, fragTexcoords).rgb, 1.0);
}
