summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders
diff options
context:
space:
mode:
authorPtolemy <ptolemy@lindenlab.com>2021-04-29 08:41:50 -0700
committerPtolemy <ptolemy@lindenlab.com>2021-04-29 14:07:57 -0700
commite371fdbf311e450ac0cc7f4d3fdacc938b489d92 (patch)
treeff5d1dec0a5371a661ccf103bf68ebac2f1ec3d3 /indra/newview/app_settings/shaders
parenteb1e2a231410f8d2fefa4b4903b46b24f4259b04 (diff)
SL-14113: Remove magic numbers. Take advantage of existing shader #defines injection by extending shader loading to make use of addConstant() instead of hard-coding magic number constants in each GLSL file.
Diffstat (limited to 'indra/newview/app_settings/shaders')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/moonF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/starsF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/environment/moonF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/environment/starsF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/windlight/moonF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl2
7 files changed, 7 insertions, 7 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl b/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl
index 187fed72e1..ad8ab771b8 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl
@@ -126,6 +126,6 @@ void main()
frag_data[1] = vec4(0.0,0.0,0.0,0.0);
frag_data[2] = vec4(0,0,0,1);
- gl_FragDepth = 0.999985; // SL-14113 Stars and Clouds need same depth
+ gl_FragDepth = LL_SHADER_CONST_CLOUD_DEPTH; // SL-14113 Stars and Clouds need same depth
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/moonF.glsl b/indra/newview/app_settings/shaders/class1/deferred/moonF.glsl
index 5906194437..ffeaf2b600 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/moonF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/moonF.glsl
@@ -74,6 +74,6 @@ void main()
frag_data[1] = vec4(0.0);
frag_data[2] = vec4(0.0f);
- gl_FragDepth = 0.999985f;
+ gl_FragDepth = LL_SHADER_CONST_MOON_DEPTH; // SL-14113
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl b/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl
index b028c40ed9..8d9c7e3507 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl
@@ -67,6 +67,6 @@ void main()
frag_data[1] = vec4(0.0f);
frag_data[2] = vec4(0.0, 1.0, 0.0, 1.0);
- gl_FragDepth = 0.999995f; // SL-14113 Moon Haze -- Stars need to depth test behind the moon
+ gl_FragDepth = LL_SHADER_CONST_STAR_DEPTH; // SL-14113 Moon Haze -- Stars need to depth test behind the moon
}
diff --git a/indra/newview/app_settings/shaders/class1/environment/moonF.glsl b/indra/newview/app_settings/shaders/class1/environment/moonF.glsl
index e1592c19fb..983cd17979 100644
--- a/indra/newview/app_settings/shaders/class1/environment/moonF.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/moonF.glsl
@@ -47,5 +47,5 @@ void main()
discard;
frag_color = color;
- gl_FragDepth = 0.999985f; // SL-14113 Moon is infront of stars
+ gl_FragDepth = LL_SHADER_CONST_MOON_DEPTH; // SL-14113 Moon is infront of stars
}
diff --git a/indra/newview/app_settings/shaders/class1/environment/starsF.glsl b/indra/newview/app_settings/shaders/class1/environment/starsF.glsl
index 95ab4cbf8b..e1a9cc6387 100644
--- a/indra/newview/app_settings/shaders/class1/environment/starsF.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/starsF.glsl
@@ -47,5 +47,5 @@ void main()
color.a *= max(custom_alpha, vertex_color.a);
frag_color = color;
- gl_FragDepth = 0.999995f; // SL-14113 Moon Haze -- Stars need to depth test behind the moon
+ gl_FragDepth = LL_SHADER_CONST_STAR_DEPTH; // SL-14113 Moon Haze -- Stars need to depth test behind the moon
}
diff --git a/indra/newview/app_settings/shaders/class1/windlight/moonF.glsl b/indra/newview/app_settings/shaders/class1/windlight/moonF.glsl
index 327accbd3b..293e09620f 100644
--- a/indra/newview/app_settings/shaders/class1/windlight/moonF.glsl
+++ b/indra/newview/app_settings/shaders/class1/windlight/moonF.glsl
@@ -68,6 +68,6 @@ void main()
c.rgb = scaleSoftClip(c.rgb);
frag_color = vec4(c.rgb, c.a);
- gl_FragDepth = 0.999985f; // SL-14113
+ gl_FragDepth = LL_SHADER_CONST_MOON_DEPTH; // SL-14113
}
diff --git a/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl b/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl
index 1c592402d4..ec53ae75f9 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl
@@ -132,6 +132,6 @@ void main()
// camera above water: class1\deferred\cloudsF.glsl
// camera below water: class2\windlight\coudsV.glsl
// See: starsV.glsl, cloudsV.glsl, moonF.glsl
- gl_FragDepth = 0.999985;
+ gl_FragDepth = LL_SHADER_CONST_CLOUD_DEPTH;
}