From 558eaef3ea09ff560c1fead65f1d1b3b75b4bdc5 Mon Sep 17 00:00:00 2001 From: Geenz Date: Mon, 1 Apr 2019 23:09:43 -0700 Subject: Make sure that atmospheric calcs aren't done twice. The atomospherics were being applied both in the G-buffer and during the sun light pass. This ensures that is not the case. Additionally, re-enable specular on the water plane, scale the bloom factor to something more reasonable, and also someone broke specular on emissive surfaces. That's fixed too now. --- .../app_settings/shaders/class2/deferred/softenLightF.glsl | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'indra/newview/app_settings/shaders/class2') diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index 27532ce458..39776f1791 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -142,11 +142,11 @@ void main() // add the two types of shiny together vec3 spec_contrib = dumbshiny * spec.rgb; - bloom = dot(spec_contrib, spec_contrib) / 6; + bloom = dot(spec_contrib, spec_contrib) / 64; col += spec_contrib; } - col = mix(col.rgb, diffuse.rgb, diffuse.a); + col.rgb += diffuse.a * diffuse.rgb; if (envIntensity > 0.0) { //add environmentmap @@ -154,9 +154,7 @@ void main() vec3 refcol = textureCube(environmentMap, env_vec).rgb; col = mix(col.rgb, refcol, envIntensity); } - - -vec3 a = col.rgb; + if (norm.w < 0.5) { col = mix(atmosFragLighting(col, additive, atten), fullbrightAtmosTransportFrag(col, additive, atten), diffuse.a); -- cgit v1.2.3 From 6b54c48dff9a38a0a1410ed9bcd06d2667320df3 Mon Sep 17 00:00:00 2001 From: Geenz Date: Mon, 1 Apr 2019 23:25:48 -0700 Subject: Scale the specular contribution to account for brighter highlights. This is more or less to achieve the non-ALM bloom behavior in most circumstances. Why scale it? Normalized blinn-phong gets brighter the higher the specular exponent. As it stood, the old spec contribution was extremely bright despite looking "correct". This is largely eyeballed, but generally looks better for all light sources applied to the surface of the water. --- indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/app_settings/shaders/class2') diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index 39776f1791..47fc20e256 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -142,7 +142,7 @@ void main() // add the two types of shiny together vec3 spec_contrib = dumbshiny * spec.rgb; - bloom = dot(spec_contrib, spec_contrib) / 64; + bloom = dot(spec_contrib, spec_contrib) / 6; col += spec_contrib; } -- cgit v1.2.3 From f07a1741e91fe44423d27585e4eeb7b69542e299 Mon Sep 17 00:00:00 2001 From: Geenz Date: Tue, 2 Apr 2019 01:28:57 -0700 Subject: Make sure emissive is actually handled with atmospherics consistently. --- .../newview/app_settings/shaders/class2/deferred/softenLightF.glsl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/newview/app_settings/shaders/class2') diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index 47fc20e256..28248aaf6d 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -157,8 +157,10 @@ void main() if (norm.w < 0.5) { - col = mix(atmosFragLighting(col, additive, atten), fullbrightAtmosTransportFrag(col, additive, atten), diffuse.a); - col = mix(scaleSoftClipFrag(col), fullbrightScaleSoftClipFrag(col, additive, atten), diffuse.a); + //col = mix(atmosFragLighting(col, additive, atten), fullbrightAtmosTransportFrag(col, additive, atten), diffuse.a); + //col = mix(scaleSoftClipFrag(col), fullbrightScaleSoftClipFrag(col, additive, atten), diffuse.a); + col = atmosFragLighting(col, additive, atten); + col = scaleSoftClipFrag(col); } #ifdef WATER_FOG -- cgit v1.2.3