Tentative fix for ALS cloud shadows leaking upward above cloud layer
This commit is contained in:
parent
4300eae9bd
commit
0eff76715e
1 changed files with 5 additions and 2 deletions
|
@ -187,6 +187,8 @@ void main (void)
|
||||||
|
|
||||||
float fog_lightArg = (terminator-fog_yprime_alt)/100000.0;
|
float fog_lightArg = (terminator-fog_yprime_alt)/100000.0;
|
||||||
float fog_earthShade = 0.9 * smoothstep(terminator_width+ terminator, -terminator_width + terminator, fog_yprime_alt) + 0.1;
|
float fog_earthShade = 0.9 * smoothstep(terminator_width+ terminator, -terminator_width + terminator, fog_yprime_alt) + 0.1;
|
||||||
|
float delta_z = hazeLayerAltitude - eye_alt;
|
||||||
|
|
||||||
|
|
||||||
float ct = dot(normalize(up), normalize(vertVec));
|
float ct = dot(normalize(up), normalize(vertVec));
|
||||||
|
|
||||||
|
@ -296,7 +298,9 @@ void main (void)
|
||||||
vec3 relPos = (gl_ModelViewMatrixInverse * vec4 (vertVec,0.0)).xyz;
|
vec3 relPos = (gl_ModelViewMatrixInverse * vec4 (vertVec,0.0)).xyz;
|
||||||
if (cloud_shadow_flag == 1)
|
if (cloud_shadow_flag == 1)
|
||||||
{
|
{
|
||||||
light_diffuse = light_diffuse * shadow_func(relPos.x, relPos.y, 1.0, dist);
|
float cloud_shadow_factor = shadow_func(relPos.x, relPos.y, 1.0, dist);
|
||||||
|
cloud_shadow_factor = 1.0 - ((1.0 - cloud_shadow_factor) * (1.0 - smoothstep (-100.0, 100.0, vertex_alt - hazeLayerAltitude)));
|
||||||
|
light_diffuse = light_diffuse * cloud_shadow_factor;
|
||||||
}
|
}
|
||||||
|
|
||||||
vec3 secondary_light = vec3 (0.0,0.0,0.0);
|
vec3 secondary_light = vec3 (0.0,0.0,0.0);
|
||||||
|
@ -477,7 +481,6 @@ void main (void)
|
||||||
float transmission_arg;
|
float transmission_arg;
|
||||||
float eqColorFactor;
|
float eqColorFactor;
|
||||||
|
|
||||||
float delta_z = hazeLayerAltitude - eye_alt;
|
|
||||||
float mvisibility = min(visibility, avisibility);
|
float mvisibility = min(visibility, avisibility);
|
||||||
|
|
||||||
if (dist > 0.04 * mvisibility)
|
if (dist > 0.04 * mvisibility)
|
||||||
|
|
Loading…
Add table
Reference in a new issue