Skip to content

Commit

Permalink
minor optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
wellcaffeinated committed Jan 9, 2024
1 parent fd9903d commit f9a1699
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/shaders/sky/fragment.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -418,19 +418,17 @@ vec4 scattering(
// earthShadow = 0.01;
}

float u = umbra(pos, rApparentSun, sunPosition, rApparentMoon, moonPosition);

if (u < 1e-2){
continue;
}
// float approachDepth = closestApproachDepth(pos, sSun, planetRadius);
// float earthShadow = 1.0; //clampMix(1.0, 0.0, approachDepth / ds);

vec2 intAtmosphere2 = raySphereIntersection(pos, sSun, atmosphereRadius);
vec3 exit = pos + intAtmosphere2.y * sSun;

float u = umbra(
pos,
rApparentSun,
sunPosition,
rApparentMoon,
moonPosition
);
vec2 secondaryDepth = opticalDepths(pos, exit, scaleHeights, planetRadius, steps.y);
// vec2 secondaryDepth = getOpticalDepths(pos, normalize(exit - pos), scaleHeights, planetRadius, atmosphereRadius);
// vec2 secondaryDepth = vec2(0.0);
Expand Down

0 comments on commit f9a1699

Please sign in to comment.