diff options
author | Graham Linden <graham@lindenlab.com> | 2019-04-26 16:02:21 -0700 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2019-04-26 16:02:21 -0700 |
commit | f133be068a4aa23c02c47348f5c7d4a28e1d5c37 (patch) | |
tree | 948e7fc0ed5fc01acb466f137e088a0d87ca6b64 /indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl | |
parent | 9d314074c9e3c898436321bdb90d3bf0d10c0079 (diff) |
Lighting WIP
Consistency across class2/3/ALM lighting.
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl')
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index 83006c8916..e0fe6cfae1 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -74,6 +74,8 @@ float getAmbientClamp(); void calcAtmosphericVars(vec3 inPositionEye, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 additive, out vec3 atten); vec3 scaleSoftClipFrag(vec3 l); +vec3 srgb_to_linear(vec3 c); +vec3 linear_to_srgb(vec3 c); vec4 getPositionWithDepth(vec2 pos_screen, float depth); @@ -96,7 +98,9 @@ void main() final_da = clamp(final_da, 0.0, 1.0); //final_da = pow(final_da, light_gamma); - vec4 diffuse = texture2DRect(diffuseRect, tc); + vec4 gamma_diff = texture2DRect(diffuseRect, tc); + vec4 diffuse = gamma_diff; + diffuse.rgb = srgb_to_linear(gamma_diff.rgb); vec4 spec = texture2DRect(specularRect, vary_fragcoord.xy); vec3 col; @@ -126,7 +130,7 @@ vec3 post_ambient = col.rgb; vec3 post_sunlight = col.rgb; - col.rgb *= diffuse.rgb; + col.rgb *= gamma_diff.rgb; vec3 post_diffuse = col.rgb; @@ -177,8 +181,6 @@ vec3 post_diffuse = col.rgb; col = fogged.rgb; bloom = fogged.a; #endif - -//col.rgb = vec3(final_da); } frag_color.rgb = col.rgb; |