 			  ref2d += tc.xy; // use as offset from destination
 
 			  if (ref2d.y < 0.0 || ref2d.y > screen_res.y ||
-			      ref2d.x < 0.0 || ref2d.x > screen_res.x) break;
+			      ref2d.x < 0.0 || ref2d.x > screen_res.x) continue;
 
 			  // Get attributes from the 2D guess point.
 			  float refdepth = texture2DRect(depthMap, ref2d).r;

			    //refapprop *= 1.0/(1.0+distance(refpos.xyz,pos.xyz));

			    //refapprop = /*magickybooster*/2.5*(refapprop);
			    total_refapprop += refapprop;
			    best_refn += refn.xyz * refapprop;
			    best_refshad += refshad * refapprop;

			    //  refapprop = 0.0;
			    //}

			    refapprop = min(refapprop, step(0.01, ppdist));
			    //refapprop = min(refapprop, smoothstep(0.0, 0.05, ppdist));

			    ////			refapprop = min(refapprop, 1.0-smoothstep(3.0, 5.0, ppdist));
