summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2019-07-23 11:36:22 -0700
committerGraham Linden <graham@lindenlab.com>2019-07-23 11:36:22 -0700
commitb507d63566e8896af702dd10f5643dc29068a8a9 (patch)
tree2fe8accc9802ad35364cd39b6e74efde0d7e0cfd /indra/newview/app_settings
parent230c9b68d81bcf163a6627e8474e545e8ceb2282 (diff)
SL-11621
Remove all references to unused shader var global_gamma. Remove many unused decls for gamma from shaders. Make post-deferred gamma correction use display_gamma. Make setting display_gamma use the correct RenderDeferredDisplayGamma setting.
Diffstat (limited to 'indra/newview/app_settings')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl3
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl1
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/materialF.glsl3
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl3
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/skyF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl1
-rw-r--r--indra/newview/app_settings/shaders/class1/windlight/gammaF.glsl1
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/skyF.glsl1
-rw-r--r--indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl1
-rw-r--r--indra/newview/app_settings/shaders/class2/windlight/gammaF.glsl7
-rw-r--r--indra/newview/app_settings/shaders/class2/windlight/skyF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/genSkyShF.glsl1
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/skyF.glsl1
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl3
14 files changed, 3 insertions, 27 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
index 0c4707098b..546a502ee1 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
@@ -37,10 +37,7 @@ out vec4 frag_color;
#define frag_color gl_FragColor
#endif
-uniform float display_gamma;
-uniform vec4 gamma;
uniform mat3 env_mat;
-
uniform vec3 sun_dir;
uniform vec3 moon_dir;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl b/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl
index f6694aae2a..ae1ac5de7f 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl
@@ -43,7 +43,6 @@ uniform sampler2D cloud_noise_texture_next;
uniform float blend_factor;
uniform vec4 cloud_pos_density1;
uniform vec4 cloud_pos_density2;
-uniform vec4 gamma;
uniform float cloud_scale;
uniform float cloud_variance;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
index 38792601f6..a13c8de43e 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
@@ -31,7 +31,6 @@
#define DIFFUSE_ALPHA_MODE_EMISSIVE 3
uniform float emissive_brightness;
-uniform float display_gamma;
uniform int sun_up_factor;
#ifdef WATER_FOG
@@ -64,8 +63,6 @@ uniform sampler2D lightFunc;
// Inputs
uniform vec4 morphFactor;
uniform vec3 camPosLocal;
-//uniform vec4 camPosWorld;
-uniform vec4 gamma;
uniform mat3 env_mat;
uniform vec3 sun_dir;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl
index 058e939ec8..9f519708a2 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl
@@ -37,7 +37,6 @@ uniform sampler2DRect diffuseRect;
uniform vec2 screen_res;
VARYING vec2 vary_fragcoord;
-
uniform float display_gamma;
vec3 linear_to_srgb(vec3 cl);
@@ -45,7 +44,7 @@ vec3 linear_to_srgb(vec3 cl);
void main()
{
vec4 diff = texture2DRect(diffuseRect, vary_fragcoord);
- diff.rgb = linear_to_srgb(diff.rgb);
+ diff.rgb = pow(diff.rgb, vec3(display_gamma));
frag_color = diff;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl b/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl
index 65e4fdf17f..331249dc33 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl
@@ -37,8 +37,6 @@ out vec4 frag_data[3];
VARYING vec4 vary_HazeColor;
-uniform vec4 gamma;
-
/// Soft clips the light with a gamma correction
vec3 scaleSoftClip(vec3 light);
vec3 srgb_to_linear(vec3 c);
diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl
index 0607ea8bc5..4460ef905b 100644
--- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl
+++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl
@@ -22,7 +22,6 @@
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
-uniform vec4 gamma;
uniform vec4 lightnorm;
uniform vec4 sunlight_color;
uniform vec4 moonlight_color;
diff --git a/indra/newview/app_settings/shaders/class1/windlight/gammaF.glsl b/indra/newview/app_settings/shaders/class1/windlight/gammaF.glsl
index 346634af33..fc51e81177 100644
--- a/indra/newview/app_settings/shaders/class1/windlight/gammaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/windlight/gammaF.glsl
@@ -24,7 +24,6 @@
*/
uniform int no_atmo;
-uniform vec4 gamma;
vec3 scaleSoftClipFrag(vec3 light)
{
diff --git a/indra/newview/app_settings/shaders/class2/deferred/skyF.glsl b/indra/newview/app_settings/shaders/class2/deferred/skyF.glsl
index b826cff304..1dce85a83b 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/skyF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/skyF.glsl
@@ -64,7 +64,6 @@ VARYING vec3 pos;
// The fragment shader for the sky
/////////////////////////////////////////////////////////////////////////
-uniform vec4 gamma;
uniform sampler2D rainbow_map;
uniform sampler2D halo_map;
diff --git a/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl b/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl
index 3ac0fc224b..75bf8730df 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl
@@ -44,7 +44,6 @@ uniform sampler2D cloud_noise_texture_next;
uniform float blend_factor;
uniform vec4 cloud_pos_density1;
uniform vec4 cloud_pos_density2;
-uniform vec4 gamma;
uniform float cloud_scale;
uniform float cloud_variance;
diff --git a/indra/newview/app_settings/shaders/class2/windlight/gammaF.glsl b/indra/newview/app_settings/shaders/class2/windlight/gammaF.glsl
index 5c339f9663..68db7fcbb1 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/gammaF.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/gammaF.glsl
@@ -22,10 +22,7 @@
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
-
-
-
-uniform vec4 gamma;
+uniform float gamma;
uniform int no_atmo;
vec3 getAtmosAttenuation();
@@ -39,7 +36,7 @@ vec3 scaleSoftClipFrag(vec3 light)
}
//soft clip effect:
light = 1. - clamp(light, vec3(0.), vec3(1.));
- light = 1. - pow(light, gamma.xxx);
+ light = 1. - pow(light, vec3(gamma)); // s/b inverted already CPU-side
return light;
}
diff --git a/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl b/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl
index de6fb276aa..7146349453 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl
@@ -35,8 +35,6 @@ out vec4 frag_color;
VARYING vec4 vary_HazeColor;
-uniform vec4 gamma;
-
/// Soft clips the light with a gamma correction
vec3 scaleSoftClip(vec3 light);
diff --git a/indra/newview/app_settings/shaders/class3/deferred/genSkyShF.glsl b/indra/newview/app_settings/shaders/class3/deferred/genSkyShF.glsl
index c02e6d1e57..d5d91c88f0 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/genSkyShF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/genSkyShF.glsl
@@ -37,7 +37,6 @@ uniform sampler2D transmittance_texture;
uniform sampler3D scattering_texture;
uniform sampler3D single_mie_scattering_texture;
uniform sampler2D irradiance_texture;
-uniform vec4 gamma;
vec3 GetSkyLuminance(vec3 camPos, vec3 view_dir, float shadow_length, vec3 dir, out vec3 transmittance);
diff --git a/indra/newview/app_settings/shaders/class3/deferred/skyF.glsl b/indra/newview/app_settings/shaders/class3/deferred/skyF.glsl
index d0514f7d23..6de01cb667 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/skyF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/skyF.glsl
@@ -44,7 +44,6 @@ uniform sampler3D single_mie_scattering_texture;
uniform sampler2D irradiance_texture;
uniform sampler2D rainbow_map;
uniform sampler2D halo_map;
-uniform vec4 gamma;
uniform float moisture_level;
uniform float droplet_radius;
diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
index 82a899ad65..978c25b86a 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
@@ -50,7 +50,6 @@ uniform vec3 camPosLocal;
uniform float cloud_shadow;
uniform float max_y;
uniform vec4 glow;
-uniform float global_gamma;
uniform mat3 env_mat;
uniform vec4 shadow_clip;
@@ -94,7 +93,6 @@ void main()
norm.xyz = getNorm(tc);
float da = max(dot(norm.xyz, sun_dir.xyz), 0.0);
- da = pow(da, global_gamma + 0.3);
vec4 diffuse = texture2DRect(diffuseRect, tc); // linear
@@ -106,7 +104,6 @@ void main()
vec4 spec = texture2DRect(specularRect, vary_fragcoord.xy);
vec2 scol_ambocc = texture2DRect(lightMap, vary_fragcoord.xy).rg;
-// scol_ambocc = pow(scol_ambocc, vec3(global_gamma + 0.3));
float scol = max(scol_ambocc.r, diffuse.a);