diff options
Diffstat (limited to 'indra/newview/app_settings/shaders/class2/windlight/transportF.glsl')
-rw-r--r-- | indra/newview/app_settings/shaders/class2/windlight/transportF.glsl | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl b/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl index 8a8e4cb0f6..b53a2e237f 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl @@ -1,5 +1,5 @@ /** - * @file transportF.glsl + * @file class2\wl\transportF.glsl * * $LicenseInfo:firstyear=2007&license=viewerlgpl$ * Second Life Viewer Source Code @@ -30,24 +30,33 @@ vec3 getAdditiveColor(); vec3 getAtmosAttenuation(); -uniform sampler2D cloudMap; -uniform vec4 cloud_pos_density1; +uniform int no_atmo; -vec3 atmosTransport(vec3 light) { - light *= getAtmosAttenuation().r; - light += getAdditiveColor() * 2.0; +vec3 atmosTransportFrag(vec3 light, vec3 additive, vec3 atten) +{ + light *= atten.r; + light += additive * 2.0; return light; } -vec3 fullbrightAtmosTransport(vec3 light) { - float brightness = dot(light.rgb, vec3(0.33333)); - - return mix(atmosTransport(light.rgb), light.rgb + getAdditiveColor().rgb, brightness * brightness); +vec3 atmosTransport(vec3 light) +{ + return atmosTransportFrag(light, getAdditiveColor(), getAtmosAttenuation()); } -vec3 fullbrightShinyAtmosTransport(vec3 light) { - float brightness = dot(light.rgb, vec3(0.33333)); +vec3 fullbrightAtmosTransportFrag(vec3 light, vec3 additive, vec3 atten) +{ + float brightness = dot(light.rgb * 0.5, vec3(0.3333)) + 0.1; + return mix(atmosTransportFrag(light.rgb, additive, atten), light.rgb + additive, brightness * brightness); +} - return mix(atmosTransport(light.rgb), (light.rgb + getAdditiveColor().rgb) * (2.0 - brightness), brightness * brightness); +vec3 fullbrightAtmosTransport(vec3 light) +{ + return fullbrightAtmosTransportFrag(light, getAdditiveColor(), getAtmosAttenuation()); } +vec3 fullbrightShinyAtmosTransport(vec3 light) +{ + float brightness = dot(light.rgb, vec3(0.33333)); + return mix(atmosTransport(light.rgb), (light.rgb + getAdditiveColor().rgb) * (2.0 - brightness), brightness * brightness); +} |