diff options
author | Graham Linden <graham@lindenlab.com> | 2019-03-21 10:39:14 -0700 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2019-03-21 10:39:14 -0700 |
commit | 7423a86a1bb7b87c70b5ccc3dbfb13ebb4f28668 (patch) | |
tree | a6bf3a4ec616b309df8628e6ec7790561c1dd556 /indra/newview/app_settings/shaders/class2/windlight | |
parent | edf8ba6e5ff0fc2b5ef55219c82af7b0f20437d9 (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/class2/windlight')
-rw-r--r-- | indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl | 3 | ||||
-rw-r--r-- | indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl b/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl index 93024bf4e7..666ae84e5c 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl @@ -52,6 +52,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); @@ -103,6 +104,8 @@ void main() alpha1 = 1. - alpha1 * alpha1; alpha1 = 1. - alpha1 * alpha1; + alpha1 *= altitude_blend_factor; + if (alpha1 < 0.001f) { discard; diff --git a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl index fb978691da..3cb69c33a1 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl @@ -40,6 +40,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; @@ -76,6 +77,9 @@ void main() // Get relative position vec3 P = position.xyz - camPosLocal.xyz + vec3(0,50,0); + // fade clouds beyond a certain point so the bottom of the sky dome doesn't look silly at high altitude + 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.) { @@ -86,6 +90,7 @@ void main() P *= (-32000. / P.y); } + // Can normalize then vec3 Pn = normalize(P); float Plen = length(P); |