summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class2
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2013-07-23 16:09:58 -0700
committerGraham Linden <graham@lindenlab.com>2013-07-23 16:09:58 -0700
commit72a0ae58e909b017c07e543bc99adc1db5e89180 (patch)
tree72b2ca07e2e9f6c3d306fe667890f4ace4c6b1e4 /indra/newview/app_settings/shaders/class2
parent96869baaefae1f322bff5114429e7fa73b6d4bf9 (diff)
NORSPEC-293 fix sRGB to linear conversion to not scrooge the darks
Diffstat (limited to 'indra/newview/app_settings/shaders/class2')
-rwxr-xr-xindra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl13
1 files changed, 10 insertions, 3 deletions
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
index 233985631b..dbb32c40f4 100755
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
@@ -85,6 +85,11 @@ vec3 srgb_to_linear(vec3 cs)
cl = {
{ ((cs + 0.055)/1.055)^2.4, cs > 0.04045*/
+ vec3 low_range = cs / vec3(12.92);
+
+ if (((cs.r + cs.g + cs.b) / 3) <= 0.04045)
+ return low_range;
+
return pow((cs+vec3(0.055))/vec3(1.055), vec3(2.4));
}
@@ -420,6 +425,7 @@ void main()
col *= diffuse.rgb;
+
vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz));
if (spec.a > 0.0) // specular reflection
@@ -445,11 +451,10 @@ void main()
vec3 refcol = textureCube(environmentMap, env_vec).rgb;
- col = mix(col.rgb, refcol,
- envIntensity);
+ col = mix(col.rgb, refcol, envIntensity);
}
-
+
if (norm.w < 0.5)
{
col = mix(atmosLighting(col), fullbrightAtmosTransport(col), diffuse.a);
@@ -462,6 +467,8 @@ void main()
bloom = fogged.a;
#endif
+
+
col = srgb_to_linear(col);
//col = vec3(1,0,1);