diff options
author | Graham Linden <graham@lindenlab.com> | 2013-07-03 10:56:10 -0700 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2013-07-03 10:56:10 -0700 |
commit | d2855f9eecdfb80dca6c5a8b496ef9fe1b746843 (patch) | |
tree | 886cf209dcd99d249e7e53651bbcb340288177cf /indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl | |
parent | 37c9fcb3dac80a41c88bba8fbd992bf08b3d2ac7 (diff) |
NORSPEC-293 better fix incorporating srgb_to_linear curve and applying texture gamma corrections to spot inputs
Diffstat (limited to 'indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl')
-rwxr-xr-x | indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl index 14f6afc8c2..0aac9d77de 100755 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl @@ -85,9 +85,19 @@ vec3 decode_normal (vec2 enc) return n; } +vec3 srgb_to_linear(vec3 cs) +{ + +/* { cs / 12.92, cs <= 0.04045 + cl = { + { ((cs + 0.055)/1.055)^2.4, cs > 0.04045*/ + + return pow((cs+vec3(0.055))/vec3(1.055), vec3(2.4)); +} + vec4 correctWithGamma(vec4 col) { - return vec4(pow(col.rgb, vec3(2.2)), col.a); + return vec4(srgb_to_linear(col.rgb), col.a); } |