diff options
author | Graham Madarasz <graham@lindenlab.com> | 2019-05-09 23:44:40 +0000 |
---|---|---|
committer | Graham Madarasz <graham@lindenlab.com> | 2019-05-09 23:44:40 +0000 |
commit | f9b6293e85062eaec12e20e55df1f8d705829d85 (patch) | |
tree | 39940c702c85fc8fea45af09acbf2738ce9bc668 | |
parent | 50779d12f3fe2b7190b9f0e53a01336289b0006a (diff) | |
parent | 17655e576fc261bb3a9d42542a37eb319510e4d3 (diff) |
Merged in graham_linden/viewer-eep-g (pull request #388)
SL-11149
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl | 6 | ||||
-rw-r--r-- | indra/newview/app_settings/shaders/class2/windlight/transportF.glsl | 6 |
2 files changed, 9 insertions, 3 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl index f98fc0d518..c104dc884f 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl @@ -45,6 +45,8 @@ VARYING vec2 vary_texcoord0; vec4 applyWaterFogView(vec3 pos, vec4 color); #endif +vec3 srgb_to_linear(vec3 cs); +vec3 linear_to_srgb(vec3 cl); vec3 fullbrightAtmosTransport(vec3 light); vec3 fullbrightScaleSoftClip(vec3 light); @@ -70,15 +72,17 @@ void main() #endif color.rgb *= vertex_color.rgb; - + #ifdef WATER_FOG vec3 pos = vary_position; vec4 fogged = applyWaterFogView(pos, vec4(color.rgb, final_alpha)); color.rgb = fogged.rgb; color.a = fogged.a; #else + color.rgb = srgb_to_linear(color.rgb); color.rgb = fullbrightAtmosTransport(color.rgb); color.rgb = fullbrightScaleSoftClip(color.rgb); + color.rgb = linear_to_srgb(color.rgb); color.a = final_alpha; #endif diff --git a/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl b/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl index 9cb9c723a2..2683b06e1b 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl @@ -50,10 +50,12 @@ vec3 atmosTransport(vec3 light) vec3 fullbrightAtmosTransport(vec3 light) { - return atmosTransportFrag(light,getAdditiveColor(), getAtmosAttenuation()); + float brightness = dot(light.rgb, vec3(0.33333)); + return atmosTransportFrag(light, getAdditiveColor() * (brightness * 0.5 + 0.5), getAtmosAttenuation()); } vec3 fullbrightShinyAtmosTransport(vec3 light) { - return atmosTransportFrag(light,getAdditiveColor(), getAtmosAttenuation()); + float brightness = dot(light.rgb, vec3(0.33333)); + return atmosTransportFrag(light, getAdditiveColor() * (brightness * 0.5 + 0.5), getAtmosAttenuation()); } |