diff options
Diffstat (limited to 'indra/newview/app_settings/shaders/class1')
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl | 8 | ||||
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl | 5 |
2 files changed, 8 insertions, 5 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl b/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl index 60ccfa64db..3fcb416601 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl @@ -51,6 +51,7 @@ VARYING vec2 vary_texcoord0; VARYING vec2 vary_texcoord1; VARYING vec2 vary_texcoord2; VARYING vec2 vary_texcoord3; +VARYING float altitude_blend_factor; /// Soft clips the light with a gamma correction vec3 scaleSoftClip(vec3 light); @@ -102,10 +103,8 @@ void main() alpha1 = 1. - alpha1 * alpha1; alpha1 = 1. - alpha1 * alpha1; - if (alpha1 < 0.001f) - { - discard; - } + alpha1 *= altitude_blend_factor; + alpha1 = clamp(alpha1, 0.0, 1.0); // Compute alpha2, for self shadowing effect // (1 - alpha2) will later be used as percentage of incoming sunlight @@ -119,6 +118,7 @@ void main() // Combine vec4 color; color = (cloudColorSun*(1.-alpha2) + cloudColorAmbient); + color.rgb= max(vec3(0), color.rgb); color *= 2.; /// Gamma correct for WL (soft clip effect). diff --git a/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl b/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl index 4beb334f5a..cfe5632ec0 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl @@ -41,6 +41,7 @@ VARYING vec2 vary_texcoord0; VARYING vec2 vary_texcoord1; VARYING vec2 vary_texcoord2; VARYING vec2 vary_texcoord3; +VARYING float altitude_blend_factor; // Inputs uniform vec3 camPosLocal; @@ -77,12 +78,15 @@ void main() // Get relative position vec3 P = position.xyz - camPosLocal.xyz + vec3(0,50,0); + altitude_blend_factor = (P.y > -4096.0) ? 1.0 : 1.0 - clamp(abs(P.y) / max_y, 0.0, 1.0); + // Set altitude if (P.y > 0.) { P *= (max_y / P.y); } else + if (P.y <= 0.0) { P *= (-32000. / P.y); } @@ -122,7 +126,6 @@ void main() // compiler gets confused. temp1 = exp(-temp1 * temp2.z); - // Compute haze glow temp2.x = dot(Pn, lightnorm.xyz); temp2.x = 1. - temp2.x; |