diff options
author | Michael Pohoreski <ptolemy@lindenlab.com> | 2021-10-27 15:59:53 +0000 |
---|---|---|
committer | Michael Pohoreski <ptolemy@lindenlab.com> | 2021-10-27 15:59:53 +0000 |
commit | aa7ca0aea134c9c40a0d4d1450cc64b7831d005f (patch) | |
tree | 9b8d588ba6058192add90579350d47114db09e7e /indra/llinventory/llsettingssky.cpp | |
parent | c907d067f41930bd6a4bbef9903febfab1090982 (diff) | |
parent | 26e8d2d8c7328878cb6bc83eb6b3b7b5b1462f17 (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.cpp | 8 |
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 |