From 2929998982f37221a58b9fa8037748a2e905f4b1 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 6 Nov 2018 19:33:04 +0000 Subject: Move to using a shared deferredUtil object for getting pos/norm from gbuffer. Eliminate 20+ callsites with copy-paste of getPosition and/or getNorm code. Make pipeline use getShadowTarget/releaseShadowTarget consistently. --- .../shaders/class2/windlight/transportF.glsl | 26 +++++++++++++--------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'indra/newview/app_settings/shaders/class2/windlight') diff --git a/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl b/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl index bf64605014..75d1bb0cd5 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl @@ -32,7 +32,7 @@ vec3 getAtmosAttenuation(); uniform int no_atmo; -vec3 atmosFragTransport(vec3 light, vec3 atten, vec3 additive) +vec3 atmosTransportFrag(vec3 light, vec3 additive, vec3 atten) { if (no_atmo == 1) { @@ -41,32 +41,36 @@ vec3 atmosFragTransport(vec3 light, vec3 atten, vec3 additive) return (light + additive) * atten * 2.0; } -vec3 fullbrightFragAtmosTransport(vec3 light, vec3 atten, vec3 additive) { +vec3 fullbrightAtmosTransportFrag(vec3 light, vec3 additive, vec3 atten) +{ if (no_atmo == 1) { return light; } float brightness = dot(light.rgb, vec3(0.33333)); - return mix(atmosFragTransport(light.rgb, atten, additive), light.rgb + additive.rgb, brightness * brightness); + return mix(atmosTransportFrag(light.rgb, additive, atten), light.rgb + additive.rgb, brightness * brightness); } -vec3 fullbrightFragShinyAtmosTransport(vec3 light, vec3 atten, vec3 additive) { +vec3 fullbrightShinyAtmosTransportFrag(vec3 light, vec3 atten, vec3 additive) { if (no_atmo == 1) { return light; } float brightness = dot(light.rgb, vec3(0.33333)); - return mix(atmosFragTransport(light.rgb, atten, additive), (light.rgb + additive.rgb) * (2.0 - brightness), brightness * brightness); + return mix(atmosTransportFrag(light.rgb, additive, atten), (light.rgb + additive.rgb) * (2.0 - brightness), brightness * brightness); } -vec3 atmosTransport(vec3 light) { - return (no_atmo == 1) ? light : atmosFragTransport(light, getAtmosAttenuation(), getAdditiveColor()); +vec3 atmosTransport(vec3 light) +{ + return atmosTransportFrag(light, getAdditiveColor(), getAtmosAttenuation()); } -vec3 fullbrightAtmosTransport(vec3 light) { - return (no_atmo == 1) ? light : fullbrightFragAtmosTransport(light, getAtmosAttenuation(), getAdditiveColor()); +vec3 fullbrightAtmosTransport(vec3 light) +{ + return fullbrightAtmosTransportFrag(light,getAdditiveColor(), getAtmosAttenuation()); } -vec3 fullbrightShinyAtmosTransport(vec3 light) { - return (no_atmo == 1) ? light : fullbrightFragShinyAtmosTransport(light, getAtmosAttenuation(), getAdditiveColor()); +vec3 fullbrightShinyAtmosTransport(vec3 light) +{ + return fullbrightShinyAtmosTransportFrag(light,getAdditiveColor(), getAtmosAttenuation()); } -- cgit v1.2.3