summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class2
diff options
context:
space:
mode:
authorDave Houlton <euclid@lindenlab.com>2020-09-16 17:11:01 -0600
committerDave Houlton <euclid@lindenlab.com>2020-09-16 17:38:56 -0600
commite8f4017b910ae6276772f540eef80ac0c788cb57 (patch)
tree702df1071765973e531c1be445fd882907f18437 /indra/newview/app_settings/shaders/class2
parentc0bbac0676e428bba5020e4c3a156edd63045a86 (diff)
DRTVWR-4976 Misc shader cleanup.
Removed some potential div-by-0 NaNs and a mangled clamp.
Diffstat (limited to 'indra/newview/app_settings/shaders/class2')
-rw-r--r--indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class2/windlight/skyV.glsl4
2 files changed, 4 insertions, 4 deletions
diff --git a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl
index 75e074cbf8..1f881eb44b 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl
@@ -99,12 +99,12 @@ void main()
// fade clouds beyond a certain point so the bottom of the sky dome doesn't look silly at high altitude
altitude_blend_factor = clamp((rel_pos.y + 512.0) / max_y, 0.0, 1.0);
- // Set altitude
+ // Adj position vector to clamp altitude
if (rel_pos.y > 0.)
{
rel_pos *= (max_y / rel_pos.y);
}
- else
+ if (rel_pos.y < 0.)
{
rel_pos *= (-32000. / rel_pos.y);
}
diff --git a/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl b/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl
index 6528066a4e..a0a33b8642 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl
@@ -67,12 +67,12 @@ void main()
// Get relative position
vec3 rel_pos = position.xyz - camPosLocal.xyz + vec3(0, 50, 0);
- // Set altitude
+ // Adj position vector to clamp altitude
if (rel_pos.y > 0.)
{
rel_pos *= (max_y / rel_pos.y);
}
- else
+ if (rel_pos.y < 0.)
{
rel_pos *= (-32000. / rel_pos.y);
}