reflect_orig = (dot(reflect_dir, hit_center) < 0) ? point - hit_center * float(1e-3) : point + hit_center * float(1e-3);// offset the original point to avoid occlusion by the object itself
direction = reflect_dir;
}
if (depth == 1){
return result;
}
else{
hitColor = skyColor;
}
color += hitColor * reflectionThroughput;
reflectionThroughput *= hitReflectionThroughput;
if(!intersection.hit)
break;
vec3 reflect_color = result;
for(int i = 0; i < depth; i++){
//compute shadows and other light properties for the returned ray color