summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorPtolemy <ptolemy@lindenlab.com>2020-07-01 13:29:35 -0700
committerPtolemy <ptolemy@lindenlab.com>2020-07-01 13:42:23 -0700
commit9f0225abaa3011de0845a330fb6d7ef60ab20039 (patch)
tree6599f230b790fb926fabb906a9e5aa6f567721b0 /indra
parent152db2280b797117edcc0d79e0d8bec9a8dc92af (diff)
SL-12978 Add note about similar code in C++ and GLSL
Diffstat (limited to 'indra')
-rw-r--r--indra/llinventory/llsettingssky.cpp3
-rw-r--r--indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl10
2 files changed, 9 insertions, 4 deletions
diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp
index 306c732920..81937dbda5 100644
--- a/indra/llinventory/llsettingssky.cpp
+++ b/indra/llinventory/llsettingssky.cpp
@@ -1295,6 +1295,9 @@ void LLSettingsSky::clampColor(LLColor3& color, F32 gamma, F32 scale) const
color = linear;
}
+// Similar/Shared Algorithms:
+// indra\llinventory\llsettingssky.cpp -- LLSettingsSky::calculateLightSettings()
+// indra\newview\app_settings\shaders\class1\windlight\atmosphericsFuncs.glsl -- calcAtmosphericVars()
void LLSettingsSky::calculateLightSettings() const
{
// Initialize temp variables
diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl
index ac0d5f08ee..4d12c5d19a 100644
--- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl
+++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl
@@ -136,11 +136,13 @@ void calcAtmosphericVars(vec3 inPositionEye, vec3 light_dir, float ambFactor, ou
tmpAmbient = vec4(mix(ssao_effect_mat * tmpAmbient.rgb, tmpAmbient.rgb, ambFactor), tmpAmbient.a);
}
+ // Similar/Shared Algorithms:
+ // indra\llinventory\llsettingssky.cpp -- LLSettingsSky::calculateLightSettings()
+ // indra\newview\app_settings\shaders\class1\windlight\atmosphericsFuncs.glsl -- calcAtmosphericVars()
//haze color
- additive =
- vec3(blue_horizon * blue_weight * (sunlight*(1.-cloud_shadow) + tmpAmbient)
- + (haze_horizon * haze_weight) * (sunlight*(1.-cloud_shadow) * temp2.x
- + tmpAmbient));
+ vec3 cs = sunlight.rgb * (1.-cloud_shadow);
+ additive = (blue_horizon.rgb * blue_weight.rgb) * (cs + tmpAmbient.rgb)
+ + (haze_horizon * haze_weight.rgb) * (cs * temp2.x + tmpAmbient.rgb);
//brightness of surface both sunlight and ambient
sunlit = sunlight.rgb * 0.5;