diff options
author | Josh Bell <josh@lindenlab.com> | 2007-04-11 17:54:18 +0000 |
---|---|---|
committer | Josh Bell <josh@lindenlab.com> | 2007-04-11 17:54:18 +0000 |
commit | 0277259455c4354f81ea8a24c8ab93f27567bc6f (patch) | |
tree | f1411dab563dcf697f794e9e8a592a6d3e5c4d2d /indra/newview/llvosky.cpp | |
parent | 568397bbcc4fca307ebc010ec7f815422b9ba80a (diff) |
svn merge -r 59968:60342 svn+ssh://svn.lindenlab.com/svn/linden/branches/maintenance --> release
Diffstat (limited to 'indra/newview/llvosky.cpp')
-rw-r--r-- | indra/newview/llvosky.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp index 94f9f0b21f..9da6027ab5 100644 --- a/indra/newview/llvosky.cpp +++ b/indra/newview/llvosky.cpp @@ -169,7 +169,7 @@ inline F32 color_intens ( const LLColor4 &col ) inline F32 color_avg ( const LLColor3 &col ) { - return color_intens(col) / 3; + return color_intens(col) / 3.f; } inline void color_gamma_correct(LLColor3 &col) @@ -756,7 +756,7 @@ LLColor3 LLVOSky::calcSkyColorInDir(const LLVector3 &dir) { LLColor3 col, transp; - if (dir.mV[VZ] < -0.02) + if (dir.mV[VZ] < -0.02f) { col = LLColor3(llmax(mFogColor[0],0.2f), llmax(mFogColor[1],0.2f), llmax(mFogColor[2],0.27f)); float x = 1.0f-fabsf(-0.1f-dir.mV[VZ]); @@ -806,15 +806,18 @@ void LLVOSky::calcSkyColorInDir(LLColor3& res, LLColor3& transp, const LLVector3 const F32 e_pow_k = (F32)LL_FAST_EXP(K); F32 step = FIRST_STEP * (1 - 1 / e_pow_k); + // Initialize outside the loop because we write into them every iteration. JC + LLColor3 air_sca_opt_depth; + LLColor3 haze_sca_opt_depth; + LLColor3 air_transp; + for (S32 s = 0; s < NO_STEPS; ++s) { h = calcHeight(cur_pos); step *= e_pow_k; - LLColor3 air_sca_opt_depth; LLHaze::calcAirSca(h, air_sca_opt_depth); air_sca_opt_depth *= step; - LLColor3 haze_sca_opt_depth; mHaze.calcSigSca(h, haze_sca_opt_depth); haze_sca_opt_depth *= step; @@ -824,7 +827,6 @@ void LLVOSky::calcSkyColorInDir(LLColor3& res, LLColor3& transp, const LLVector3 if (calcHitsEarth(cur_pos, tosun) < 0) // calculates amount of in-scattered light from the sun { //visibility check is too expensive - LLColor3 air_transp; mTransp.calcTransp(calcUpVec(cur_pos) * tosun, h, air_transp); air_transp *= transp; res += air_sca_opt_depth * air_transp; |