Skip to content

Commit

Permalink
Update Arctic_Circle_Fragment.glsl
Browse files Browse the repository at this point in the history
  • Loading branch information
erichlof authored Sep 12, 2024
1 parent 8a63714 commit 7c44e1e
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions shaders/Arctic_Circle_Fragment.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -476,25 +476,20 @@ 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;
reflectionRayDirection = reflect(rayDirection, nl); // reflect ray from surface
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;
Expand Down

0 comments on commit 7c44e1e

Please sign in to comment.