diff --git a/shaders/Arctic_Circle_Fragment.glsl b/shaders/Arctic_Circle_Fragment.glsl index 2006d6b1..fdad684c 100644 --- a/shaders/Arctic_Circle_Fragment.glsl +++ b/shaders/Arctic_Circle_Fragment.glsl @@ -476,6 +476,13 @@ vec3 CalculateRadiance() Re = calcFresnelReflectance(rayDirection, n, nc, nt, ratioIoR); Tr = 1.0 - Re; + if (Re == 1.0) + { + rayDirection = reflect(rayDirection, nl); + rayOrigin = x + nl * uEPS_intersect; + continue; + } + if (bounces == 0) { reflectionMask = mask * Re; @@ -483,18 +490,6 @@ vec3 CalculateRadiance() reflectionRayOrigin = x + nl * uEPS_intersect; willNeedReflectionRay = TRUE; } - - if (Re == 1.0) - { - mask = reflectionMask; - rayOrigin = reflectionRayOrigin; - rayDirection = reflectionRayDirection; - - willNeedReflectionRay = FALSE; - bounceIsSpecular = TRUE; - sampleLight = FALSE; - continue; - } // transmit ray through surface mask *= hitColor;