summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2019-03-21 10:39:14 -0700
committerGraham Linden <graham@lindenlab.com>2019-03-21 10:39:14 -0700
commit7423a86a1bb7b87c70b5ccc3dbfb13ebb4f28668 (patch)
treea6bf3a4ec616b309df8628e6ec7790561c1dd556 /indra/newview/app_settings/shaders/class1
parentedf8ba6e5ff0fc2b5ef55219c82af7b0f20437d9 (diff)
SL-10751
Fix skydome VB generation to cover entire range of phi (give sky pants). Add shader code to fade out clouds to simulate old look at altitude.
Diffstat (limited to 'indra/newview/app_settings/shaders/class1')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl8
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl5
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;