aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llvosky.h
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:44:54 -0500
committerJacek Antonelli2008-08-15 23:44:54 -0500
commitb2afb8800bb033a04bb3ecdf0363068d56648ef1 (patch)
tree3568129b5bbddb47cd39d622b4137a8fbff4abaf /linden/indra/newview/llvosky.h
parentSecond Life viewer sources 1.14.0.1 (diff)
downloadmeta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.zip
meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.tar.gz
meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.tar.bz2
meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.tar.xz
Second Life viewer sources 1.15.0.2
Diffstat (limited to 'linden/indra/newview/llvosky.h')
-rw-r--r--linden/indra/newview/llvosky.h22
1 files changed, 8 insertions, 14 deletions
diff --git a/linden/indra/newview/llvosky.h b/linden/indra/newview/llvosky.h
index 0ca56dc..568e924 100644
--- a/linden/indra/newview/llvosky.h
+++ b/linden/indra/newview/llvosky.h
@@ -4,6 +4,7 @@
4 * 4 *
5 * Copyright (c) 2001-2007, Linden Research, Inc. 5 * Copyright (c) 2001-2007, Linden Research, Inc.
6 * 6 *
7 * Second Life Viewer Source Code
7 * The source code in this file ("Source Code") is provided by Linden Lab 8 * The source code in this file ("Source Code") is provided by Linden Lab
8 * to you under the terms of the GNU General Public License, version 2.0 9 * to you under the terms of the GNU General Public License, version 2.0
9 * ("GPL"), unless you have obtained a separate licensing agreement 10 * ("GPL"), unless you have obtained a separate licensing agreement
@@ -61,19 +62,12 @@ const F32 INV_NO_STEPS = 1.f/NO_STEPS;
61 62
62// constants used in calculation of scattering coeff of clear air 63// constants used in calculation of scattering coeff of clear air
63const F32 sigma = 0.035f; 64const F32 sigma = 0.035f;
64const F32 fsigma = (6+3*sigma)/(6.f-7.f*sigma); 65const F32 fsigma = (6.f + 3.f * sigma) / (6.f-7.f*sigma);
65const F64 Ndens = 2.55e25; 66const F64 Ndens = 2.55e25;
66const F64 Ndens2 = Ndens*Ndens; 67const F64 Ndens2 = Ndens*Ndens;
67 68
68// !!! *FIX: This #define should be in llcommon somewhere...
69// We should not be #defining anything with leading underscores and
70// much less double leading underscores since that is always vendor
71// specific. Change this to something like LL_FORCE_INLINE.
72#ifdef __GNUC__
73#define __forceinline inline __attribute__((always_inline))
74#endif
75 69
76__forceinline LLColor3 color_div(const LLColor3 &col1, const LLColor3 &col2) 70LL_FORCE_INLINE LLColor3 color_div(const LLColor3 &col1, const LLColor3 &col2)
77{ 71{
78 return LLColor3( 72 return LLColor3(
79 col1.mV[0] / col2.mV[0], 73 col1.mV[0] / col2.mV[0],
@@ -140,7 +134,7 @@ private:
140public: 134public:
141 static F32 getInterpVal() { return sInterpVal; } 135 static F32 getInterpVal() { return sInterpVal; }
142 static void setInterpVal(const F32 v) { sInterpVal = v; } 136 static void setInterpVal(const F32 v) { sInterpVal = v; }
143 static BOOL doInterpolate() { return sInterpVal > 0.001; } 137 static BOOL doInterpolate() { return sInterpVal > 0.001f; }
144 138
145 void bindTexture(BOOL curr = TRUE); 139 void bindTexture(BOOL curr = TRUE);
146 140
@@ -311,7 +305,7 @@ public:
311}; 305};
312 306
313 307
314__forceinline LLColor3 refr_ind_calc(const LLColor3 &wave_length) 308LL_FORCE_INLINE LLColor3 refr_ind_calc(const LLColor3 &wave_length)
315{ 309{
316 LLColor3 refr_ind; 310 LLColor3 refr_ind;
317 for (S32 i = 0; i < 3; ++i) 311 for (S32 i = 0; i < 3; ++i)
@@ -325,7 +319,7 @@ __forceinline LLColor3 refr_ind_calc(const LLColor3 &wave_length)
325} 319}
326 320
327 321
328__forceinline LLColor3 calc_air_sca_sea_level() 322LL_FORCE_INLINE LLColor3 calc_air_sca_sea_level()
329{ 323{
330 const static LLColor3 WAVE_LEN(675, 520, 445); 324 const static LLColor3 WAVE_LEN(675, 520, 445);
331 const static LLColor3 refr_ind = refr_ind_calc(WAVE_LEN); 325 const static LLColor3 refr_ind = refr_ind_calc(WAVE_LEN);
@@ -690,6 +684,7 @@ public:
690 684
691public: 685public:
692 static F32 sNighttimeBrightness; // [0,2] default = 1.0 686 static F32 sNighttimeBrightness; // [0,2] default = 1.0
687 LLFace *mFace[FACE_COUNT];
693 688
694protected: 689protected:
695 LLPointer<LLViewerImage> mSunTexturep; 690 LLPointer<LLViewerImage> mSunTexturep;
@@ -719,8 +714,7 @@ protected:
719 BOOL mWeatherChange; 714 BOOL mWeatherChange;
720 F32 mCloudDensity; 715 F32 mCloudDensity;
721 F32 mWind; 716 F32 mWind;
722 LLFace *mFace[FACE_COUNT]; 717
723
724 BOOL mInitialized; 718 BOOL mInitialized;
725 BOOL mForceUpdate; //flag to force instantaneous update of cubemap 719 BOOL mForceUpdate; //flag to force instantaneous update of cubemap
726 LLVector3 mLastLightingDirection; 720 LLVector3 mLastLightingDirection;