diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2020-04-20 21:21:12 +0300 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2020-04-20 21:21:12 +0300 |
commit | 7a311fe30ee3c4a4de0149822b0670f612eb4a67 (patch) | |
tree | aacf08a74bf2214c17d6de7c5edaa1a6da8d9eec /indra/newview/app_settings/shaders/class1/deferred/skyF.glsl | |
parent | 6666fdb5d6f52df3d68bed35a4ad05139f49f93c (diff) | |
parent | d7f1c88c35849e56f5b352f13c16a08467d1533b (diff) |
Merge branch 'master' into DRTVWR-497
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/skyF.glsl')
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/skyF.glsl | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl b/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl index 22f4729e2e..331249dc33 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl @@ -1,5 +1,5 @@ /** - * @file WLSkyF.glsl + * @file class1/deferred/skyF.glsl * * $LicenseInfo:firstyear=2005&license=viewerlgpl$ * Second Life Viewer Source Code @@ -23,6 +23,8 @@ * $/LicenseInfo$ */ +/*[EXTRA_CODE_HERE]*/ + #ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_data[3]; #else @@ -35,32 +37,28 @@ out vec4 frag_data[3]; VARYING vec4 vary_HazeColor; -uniform sampler2D cloud_noise_texture; -uniform vec4 gamma; - /// Soft clips the light with a gamma correction -vec3 scaleSoftClip(vec3 light) { - //soft clip effect: - light = 1. - clamp(light, vec3(0.), vec3(1.)); - light = 1. - pow(light, gamma.xxx); - - return light; -} +vec3 scaleSoftClip(vec3 light); +vec3 srgb_to_linear(vec3 c); void main() { - // Potential Fill-rate optimization. Add cloud calculation - // back in and output alpha of 0 (so that alpha culling kills - // the fragment) if the sky wouldn't show up because the clouds - // are fully opaque. + // Potential Fill-rate optimization. Add cloud calculation + // back in and output alpha of 0 (so that alpha culling kills + // the fragment) if the sky wouldn't show up because the clouds + // are fully opaque. + + vec4 color; + color = vary_HazeColor; + + color.rgb *= 2.; + color.rgb = scaleSoftClip(color.rgb); - vec4 color; - color = vary_HazeColor; - color *= 2.; + /// Gamma correct for WL (soft clip effect). + frag_data[0] = vec4(color.rgb, 0.0); + frag_data[1] = vec4(0.0,0.0,0.0,0.0); + frag_data[2] = vec4(0.0,0.0,0.0,1.0); //1.0 in norm.w masks off fog - /// Gamma correct for WL (soft clip effect). - frag_data[0] = vec4(scaleSoftClip(color.rgb), 1.0); - frag_data[1] = vec4(0.0,0.0,0.0,0.0); - frag_data[2] = vec4(0.5,0.5,0.0,1.0); //1.0 in norm.w masks off fog + gl_FragDepth = 0.99999f; } |