summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/deferred
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/class1/deferred
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/class1/deferred')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/skyV.glsl6
2 files changed, 5 insertions, 5 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl b/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl
index b59862bb3b..b7036e02cf 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl
@@ -99,11 +99,11 @@ void main()
altitude_blend_factor = clamp((rel_pos.y + 512.0) / max_y, 0.0, 1.0);
// Set altitude
- if (rel_pos.y > 0.)
+ if (rel_pos.y > 0)
{
rel_pos *= (max_y / rel_pos.y);
}
- else
+ if (rel_pos.y < 0)
{
altitude_blend_factor = 0; // SL-11589 Fix clouds drooping below horizon
rel_pos *= (-32000. / rel_pos.y);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
index b35a32dbbf..28a1faf24f 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
@@ -71,12 +71,12 @@ void main()
// Get relative position
vec3 rel_pos = position.xyz - camPosLocal.xyz + vec3(0, 50, 0);
- // Set altitude
- if (rel_pos.y > 0.)
+ // 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);
}