summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2019-06-19 13:01:06 -0700
committerGraham Linden <graham@lindenlab.com>2019-06-19 13:01:06 -0700
commitc1d1d7968325403a8033fa79567f07345c49b0a8 (patch)
treeb9a6b2998ea741724d3c58dbc498dad8848de9f1 /indra/newview/app_settings
parent7f24395889832c9ce51bae69054c7d081d77f65a (diff)
Sky fixes.
Make class1 sky use pre-projection pos to get proper distances for attenuation. Make all sky shaders use the dist_mul again. Revert to using old sky tessellation logic (may regress bugs addressed by new tess code).
Diffstat (limited to 'indra/newview/app_settings')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/skyF.glsl1
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/skyV.glsl11
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/skyF.glsl3
-rw-r--r--indra/newview/app_settings/shaders/class2/windlight/skyV.glsl2
4 files changed, 8 insertions, 9 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl b/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl
index 7d4d9eb49f..65e4fdf17f 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl
@@ -41,6 +41,7 @@ uniform vec4 gamma;
/// Soft clips the light with a gamma correction
vec3 scaleSoftClip(vec3 light);
+vec3 srgb_to_linear(vec3 c);
void main()
{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
index 45e79f36ea..b30651351d 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
@@ -66,7 +66,7 @@ void main()
gl_Position = pos;
// Get relative position
- vec3 P = pos.xyz - camPosLocal.xyz + vec3(0,50,0);
+ vec3 P = position.xyz - camPosLocal.xyz + vec3(0,50,0);
// Set altitude
if (P.y > 0.)
@@ -81,7 +81,7 @@ void main()
// Can normalize then
vec3 Pn = normalize(P);
- float Plen = length(P);
+ float Plen = length(P);
// Initialize temp variables
vec4 temp1 = vec4(0.);
@@ -114,9 +114,7 @@ void main()
// Transparency (-> temp1)
// ATI Bugfix -- can't store temp1*temp2.z in a variable because the ati
// compiler gets confused.
- //temp1 = exp(-temp1 * temp2.z * dist_mul);
- temp1 = exp(-temp1 * dist_mul);
-
+ temp1 = exp(-temp1 * temp2.z * dist_mul);
// Compute haze glow
temp2.x = dot(Pn, lightnorm.xyz);
@@ -132,12 +130,13 @@ void main()
// Add "minimum anti-solar illumination"
temp2.x += .25;
- temp2.x *= sun_moon_glow_factor;
+ //temp2.x *= sun_moon_glow_factor;
vec4 color = ( blue_horizon * blue_weight * (sunlight + ambient_color)
+ (haze_horizon * haze_weight) * (sunlight * temp2.x + ambient_color)
);
+
// Final atmosphere additive
color *= (1. - temp1);
diff --git a/indra/newview/app_settings/shaders/class2/deferred/skyF.glsl b/indra/newview/app_settings/shaders/class2/deferred/skyF.glsl
index 889a989985..3bdcf28363 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/skyF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/skyF.glsl
@@ -141,8 +141,7 @@ void main()
// Transparency (-> temp1)
// ATI Bugfix -- can't store temp1*temp2.z in a variable because the ati
// compiler gets confused.
- //temp1 = exp(-temp1 * temp2.z * dist_mul);
- temp1 = exp(-temp1 * dist_mul);
+ temp1 = exp(-temp1 * temp2.z * dist_mul);
// Compute haze glow
temp2.x = dot(Pn, lightnorm.xyz);
diff --git a/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl b/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl
index eb5ab0f012..e6a4f3833c 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl
@@ -111,7 +111,7 @@ void main()
// Transparency (-> temp1)
// ATI Bugfix -- can't store temp1*temp2.z in a variable because the ati
// compiler gets confused.
- temp1 = exp(-temp1 * dist_mul);
+ temp1 = exp(-temp1 * temp2.z * dist_mul);
// Compute haze glow
temp2.x = dot(Pn, lightnorm.xyz);