diff options
author | Graham Linden <graham@lindenlab.com> | 2019-05-21 16:00:45 -0700 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2019-05-21 16:00:45 -0700 |
commit | e9dbee00262a437e4b3f971b37ea636e92032133 (patch) | |
tree | 57f79641ee532f3f80b0fbd89d3a1f42de398829 /indra/newview/app_settings/shaders/class1 | |
parent | 78e62fe0f16d95a2afb6c4205b121db189c297b9 (diff) |
SL-11238
Fix ambient light inputs to the renderer.
Fix 3rd sky shader w/ mistaken density mod conversion.
Make ambient clamp apply to all modes.
Tune ALM ambient clamp to match non-ALM.
Diffstat (limited to 'indra/newview/app_settings/shaders/class1')
5 files changed, 19 insertions, 7 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl index b439fbbff6..e0bf58a5c2 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl @@ -223,7 +223,9 @@ void main() float ambient = da; ambient *= 0.5; ambient *= ambient; - ambient = min(getAmbientClamp(), 1.0 - ambient); + + float ambient_clamp = getAmbientClamp() + 0.2; + ambient = (1.0 - ambient) * ambient_clamp; vec3 sun_contrib = min(final_da, shadow) * sunlit; diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl index 0880a73b26..b9c16bfa11 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl @@ -320,7 +320,9 @@ void main() float ambient = da; ambient *= 0.5; ambient *= ambient; - ambient = min(getAmbientClamp(), 1.0 - ambient); + + float ambient_clamp = getAmbientClamp() + 0.2; + ambient = (1.0 - ambient) * ambient_clamp; vec3 sun_contrib = min(final_da, shadow) * sunlit; diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index c81d0f97da..40bb705326 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -106,7 +106,10 @@ void main() float ambient = da; ambient *= 0.5; ambient *= ambient; - ambient = min(getAmbientClamp(), 1.0 - ambient); + + ambient = (1.0 - ambient); + float ambient_clamp = getAmbientClamp() + 0.1; + ambient *= ambient_clamp; vec3 sun_contrib = final_da * sunlit; @@ -179,11 +182,10 @@ vec3 post_atmo = color.rgb; bloom = fogged.a; #endif +// srgb colorspace debuggables //color.rgb = amblit; -//color.rgb = vec3(ambient); //color.rgb = sunlit; //color.rgb = post_ambient; -//color.rgb = vec3(final_da); //color.rgb = sun_contrib; //color.rgb = post_sunlight; //color.rgb = diffuse_srgb.rgb; @@ -197,6 +199,11 @@ vec3 post_atmo = color.rgb; color.rgb = srgb_to_linear(color.rgb); } +// linear debuggables +//color.rgb = vec3(final_da); +//color.rgb = vec3(ambient); +//color.rgb = vec3(scol); + frag_color.rgb = color.rgb; frag_color.a = bloom; } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightV.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightV.glsl index 38230836eb..cf635ffa3f 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightV.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightV.glsl @@ -28,11 +28,12 @@ // All lights, no specular highlights vec3 atmosAmbient(); vec4 sumLights(vec3 pos, vec3 norm, vec4 color); +float getAmbientClamp(); vec4 calcLighting(vec3 pos, vec3 norm, vec4 color) { vec4 c = sumLights(pos, norm, color); - c.rgb += atmosAmbient() * color.rgb * 0.5; + c.rgb += atmosAmbient() * color.rgb * 0.5 * getAmbientClamp(); return c; } diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl index 68eb671e7c..55ffbdcc46 100644 --- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl +++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl @@ -44,7 +44,7 @@ uniform float sun_moon_glow_factor; float getAmbientClamp() { - return 0.45f; + return 0.9; } void calcAtmosphericVars(vec3 inPositionEye, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 additive, out vec3 atten) { |