summaryrefslogtreecommitdiff
path: root/indra/llinventory/llsettingssky.cpp
diff options
context:
space:
mode:
authorMichael Pohoreski <ptolemy@lindenlab.com>2021-10-27 15:59:53 +0000
committerMichael Pohoreski <ptolemy@lindenlab.com>2021-10-27 15:59:53 +0000
commitaa7ca0aea134c9c40a0d4d1450cc64b7831d005f (patch)
tree9b8d588ba6058192add90579350d47114db09e7e /indra/llinventory/llsettingssky.cpp
parentc907d067f41930bd6a4bbef9903febfab1090982 (diff)
parent26e8d2d8c7328878cb6bc83eb6b3b7b5b1462f17 (diff)
Merged in SL-16127 (pull request #741)
SL-16127 Approved-by: Euclid Linden Approved-by: Dave Parks
Diffstat (limited to 'indra/llinventory/llsettingssky.cpp')
-rw-r--r--indra/llinventory/llsettingssky.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp
index 00c1edb55a..82c67a1066 100644
--- a/indra/llinventory/llsettingssky.cpp
+++ b/indra/llinventory/llsettingssky.cpp
@@ -1209,6 +1209,14 @@ LLColor3 LLSettingsSky::getLightTransmittance(F32 distance) const
return transmittance;
}
+// SL-16127: getTotalDensity() and getDensityMultiplier() call LLSettingsSky::getColor() and LLSettingsSky::getFloat() respectively which are S-L-O-W
+LLColor3 LLSettingsSky::getLightTransmittanceFast( const LLColor3& total_density, const F32 density_multiplier, const F32 distance ) const
+{
+ // Transparency (-> density) from Beer's law
+ LLColor3 transmittance = componentExp(total_density * -(density_multiplier * distance));
+ return transmittance;
+}
+
// performs soft scale clip and gamma correction ala the shader implementation
// scales colors down to 0 - 1 range preserving relative ratios
LLColor3 LLSettingsSky::gammaCorrect(const LLColor3& in) const