1
0
Fork 0

ALS: tentative fix for skydome monolith artifact - apparently this is a numerical accuracy issue (?)

This commit is contained in:
Thorsten Renk 2018-02-13 15:00:21 +02:00
parent 96a5f8a8e3
commit d0789a1907

View file

@ -287,7 +287,10 @@ void main()
float mie_magnitude = 0.5 * smoothstep(350000.0, 150000.0, terminator -sqrt(2.0 * EarthRadius * terrain_alt));
cphi = dot(normalize(relVector), normalize(lightHorizon));
float mie_angle = (0.5 * dot(normalize(relVector), normalize(lightFull)) ) + 0.5;
hazeColor = intensity * ((1.0 - mie_magnitude) + mie_magnitude * mie_angle) * normalize(mix(hazeColor, vec3 (0.5, 0.58, 0.65), mie_magnitude * (0.5 - 0.5 * mie_angle)) );
float mie_postfactor = clamp(mie_magnitude * (0.5 - 0.5 * mie_angle),0.001,1.0);
hazeColor = intensity * ((1.0 - mie_magnitude) + mie_magnitude * mie_angle) * normalize(mix(hazeColor, vec3 (0.5, 0.58, 0.65), mie_postfactor ) );
// Transform