diff options
| author | Ptolemy <ptolemy@lindenlab.com> | 2021-10-21 16:46:06 -0700 |
|---|---|---|
| committer | Ptolemy <ptolemy@lindenlab.com> | 2021-10-21 16:46:06 -0700 |
| commit | a172c9d9cf358c3d9329a1777e30f627f50d5aaa (patch) | |
| tree | b19f7aadc61f73d173d071fbe9503bea80ab8f87 /indra/llinventory/llsettingssky.cpp | |
| parent | 851767b808c3cb05d718538389ccc1ed3c95d1a1 (diff) | |
SL-16127: Replace slow getLightTransmittance with faster version
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 81937dbda5..69b4a4929d 100644 --- a/indra/llinventory/llsettingssky.cpp +++ b/indra/llinventory/llsettingssky.cpp @@ -1206,6 +1206,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 |
