diff options
author | Graham Linden <graham@lindenlab.com> | 2019-06-11 13:03:06 -0700 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2019-06-11 13:03:06 -0700 |
commit | 653133b9c035e7c34563b199e991189ca3046092 (patch) | |
tree | b5d7b99fc3cacb7f887263edf744463006d9eb1a /indra/newview/app_settings/shaders/class2 | |
parent | c15baecbfbc9baffdeb6ec53b7e4090470514657 (diff) |
SL-11370, SL-11372, SL-11337
Fix culling on Low+ water reflection pass.
Make Mid+ / High use class1 deferred sky again (no rainbows, but faster!).
Fix setting of cloud color for deferred sky/cloud shaders.
Put water reflections back in wrong colorspace for consistency with release.
Diffstat (limited to 'indra/newview/app_settings/shaders/class2')
4 files changed, 13 insertions, 10 deletions
diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl index bcce4c041a..8cad21d5b4 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl @@ -191,7 +191,8 @@ void main() float da = dot(norm, lv); vec3 diff_tex = texture2DRect(diffuseRect, frag.xy).rgb; - + diff_tex.rgb = srgb_to_linear(diff_tex.rgb); + vec4 spec = texture2DRect(specularRect, frag.xy); vec3 dlit = vec3(0, 0, 0); diff --git a/indra/newview/app_settings/shaders/class2/deferred/skyF.glsl b/indra/newview/app_settings/shaders/class2/deferred/skyF.glsl index 921f87cf14..0f33bac3c6 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/skyF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/skyF.glsl @@ -88,7 +88,6 @@ vec3 halo22(float d) /// Soft clips the light with a gamma correction vec3 scaleSoftClip(vec3 light); -vec3 srgb_to_linear(vec3 c); void main() { @@ -198,7 +197,6 @@ void main() color.rgb *= 2.; color.rgb = scaleSoftClip(color.rgb); - color.rgb = srgb_to_linear(color.rgb); /// Gamma correct for WL (soft clip effect). frag_data[0] = vec4(color.rgb, 1.0); diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index da85786317..53cdce4cb1 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -91,8 +91,8 @@ void main() float final_da = da; final_da = clamp(final_da, 0.0, 1.0); - vec4 diffuse_linear = texture2DRect(diffuseRect, tc); - vec4 diffuse_srgb = vec4(linear_to_srgb(diffuse_linear.rgb), diffuse_linear.a); + vec4 diffuse_srgb = texture2DRect(diffuseRect, tc); + vec4 diffuse_linear = vec4(srgb_to_linear(diffuse_srgb.rgb), diffuse_srgb.a); // clamping to alpha value kills underwater shadows... //scol = max(scol_ambocc.r, diffuse_linear.a); @@ -120,7 +120,7 @@ void main() #if !defined(AMBIENT_KILL) color.rgb = amblit * 2.0; - color.rgb *= ambient; + color.rgb *= ambient * 0.5; #endif vec3 post_ambient = color.rgb; @@ -131,7 +131,7 @@ vec3 post_ambient = color.rgb; vec3 post_sunlight = color.rgb; - color.rgb *= diffuse_linear.rgb; + color.rgb *= diffuse_srgb.rgb; vec3 post_diffuse = color.rgb; @@ -183,8 +183,10 @@ vec3 post_env = color.rgb; if (norm.w < 1) { +#if !defined(SUNLIGHT_KILL) color = atmosFragLighting(color, additive, atten); color = scaleSoftClipFrag(color); +#endif } vec3 post_atmo = color.rgb; @@ -216,6 +218,7 @@ vec3 post_atmo = color.rgb; //color.rgb = vec3(final_da); //color.rgb = vec3(ambient); //color.rgb = vec3(scol); +//color.rgb = diffuse_linear.rgb; frag_color.rgb = color.rgb; frag_color.a = bloom; diff --git a/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl b/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl index 396ceacd19..e7ae2d52e3 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl @@ -123,11 +123,12 @@ void main() // Combine vec4 color; color = (cloudColorSun*(1.-alpha2) + cloudColorAmbient); - color *= 2.; + color.rgb *= 2.; + color.rgb = scaleSoftClip(color.rgb); /// Gamma correct for WL (soft clip effect). - frag_data[0] = vec4(scaleSoftClip(color.rgb), alpha1); + frag_data[0] = vec4(color.rgb, alpha1); frag_data[1] = vec4(0.0,0.0,0.0,0.0); - frag_data[2] = vec4(0,0,1,0); + frag_data[2] = vec4(0,0,0,1); } |