diff options
Diffstat (limited to 'indra/llinventory')
| -rw-r--r-- | indra/llinventory/llsettingssky.cpp | 8 | ||||
| -rw-r--r-- | indra/llinventory/llsettingssky.h | 1 | 
2 files changed, 9 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 diff --git a/indra/llinventory/llsettingssky.h b/indra/llinventory/llsettingssky.h index 4127911643..77d9d8e87c 100644 --- a/indra/llinventory/llsettingssky.h +++ b/indra/llinventory/llsettingssky.h @@ -252,6 +252,7 @@ public:      LLColor3 getLightAttenuation(F32 distance) const;      LLColor3 getLightTransmittance(F32 distance) const; +    LLColor3 getLightTransmittanceFast(const LLColor3& total_density, const F32 density_multiplier, const F32 distance) const;      LLColor3 getTotalDensity() const;      LLColor3 gammaCorrect(const LLColor3& in) const; | 
