Skip to content

Commit

Permalink
rayleigh: drop fogFactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Mc-Pain committed Oct 20, 2023
1 parent 95c11b7 commit 123fd48
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions data/shaders/opengl/rayleigh_sky.frag
Original file line number Diff line number Diff line change
Expand Up @@ -205,15 +205,11 @@ void main(void)
vec3 specularHighlight = vec3(0.0);

sphereEntryExitDist(skyNear, skyFar, geosphereCenter, varyingEyepos.xyz, geosphereRadius * geosphereAtmosTopRad);
float atmosDist = (skyFar - skyNear);
float ldprod=0.0;

// a&b scaled so length of 1.0 means planet surface.
vec3 a = (skyNear * eyenorm - geosphereCenter) * geosphereInvRadius;
vec3 b = (skyFar * eyenorm - geosphereCenter) * geosphereInvRadius;
ldprod = AtmosLengthDensityProduct(a, b, atmosColor.a * geosphereAtmosFogDensity, atmosDist, geosphereAtmosInvScaleHeight);

float fogFactor = 1.0 / exp(ldprod);
vec4 atmosDiffuse = vec4(0.0);

#if (NUM_LIGHTS > 0)
Expand All @@ -232,7 +228,7 @@ void main(void)
#endif

atmosDiffuse.a = 1.0;
frag_color = (1.0-fogFactor) * (atmosDiffuse *
frag_color = (atmosDiffuse *
vec4(specularHighlight.rgb, 1.0) * 20
);
}

0 comments on commit 123fd48

Please sign in to comment.