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 | 25 |
1 files changed, 17 insertions, 8 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..82e1d7fe35 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl @@ -33,21 +33,30 @@ vec3 getAtmosAttenuation(); uniform sampler2D cloudMap; uniform vec4 cloud_pos_density1; -vec3 atmosTransport(vec3 light) { - light *= getAtmosAttenuation().r; - light += getAdditiveColor() * 2.0; +vec3 atmosFragTransport(vec3 light, vec3 atten, vec3 additive) { + light *= atten.r; + light += additive * 2.0; return light; } -vec3 fullbrightAtmosTransport(vec3 light) { +vec3 fullbrightFragAtmosTransport(vec3 light, vec3 atten, vec3 additive) { float brightness = dot(light.rgb, vec3(0.33333)); - - return mix(atmosTransport(light.rgb), light.rgb + getAdditiveColor().rgb, brightness * brightness); + return mix(atmosFragTransport(light.rgb, atten, additive), light.rgb + additive.rgb, brightness * brightness); } -vec3 fullbrightShinyAtmosTransport(vec3 light) { +vec3 fullbrightFragShinyAtmosTransport(vec3 light, vec3 atten, vec3 additive) { 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(atmosTransport(light.rgb), (light.rgb + getAdditiveColor().rgb) * (2.0 - brightness), brightness * brightness); +vec3 atmosTransport(vec3 light) { + return atmosFragTransport(light, getAtmosAttenuation(), getAdditiveColor()); } +vec3 fullbrightAtmosTransport(vec3 light) { + return fullbrightFragAtmosTransport(light, getAtmosAttenuation(), getAdditiveColor()); +} + +vec3 fullbrightShinyAtmosTransport(vec3 light) { + return fullbrightFragShinyAtmosTransport(light, getAtmosAttenuation(), getAdditiveColor()); +} |