diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2020-04-21 15:37:25 +0300 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2020-04-21 15:37:25 +0300 |
commit | 4cf42435733a111610a13620c56728b1b659b1e9 (patch) | |
tree | 5ac5ac10070448dcfdf38bf36e23ea9b6b766f95 /indra/newview/llvosky.h | |
parent | dcb6b5489d2c3cfdb13d5862f8cb29fee06745a7 (diff) | |
parent | d7f1c88c35849e56f5b352f13c16a08467d1533b (diff) |
Merge branch 'master' into DRTVWR-483
# Conflicts:
# indra/newview/CMakeLists.txt
# indra/newview/llviewerfloaterreg.cpp
# indra/newview/skins/default/xui/de/floater_preview_texture.xml
# indra/newview/skins/default/xui/es/floater_preview_texture.xml
# indra/newview/skins/default/xui/fr/floater_preview_texture.xml
# indra/newview/skins/default/xui/it/floater_preview_texture.xml
# indra/newview/skins/default/xui/ja/panel_edit_classified.xml
# indra/newview/skins/default/xui/ja/panel_me.xml
# indra/newview/skins/default/xui/ru/floater_preview_texture.xml
# indra/newview/skins/default/xui/tr/floater_picks.xml
# indra/newview/skins/default/xui/tr/floater_preview_texture.xml
# indra/newview/skins/default/xui/tr/panel_edit_classified.xml
# indra/newview/skins/default/xui/tr/panel_me.xml
# indra/newview/skins/default/xui/zh/floater_preview_texture.xml
Diffstat (limited to 'indra/newview/llvosky.h')
-rw-r--r-- | indra/newview/llvosky.h | 526 |
1 files changed, 120 insertions, 406 deletions
diff --git a/indra/newview/llvosky.h b/indra/newview/llvosky.h index 9cfb9773bd..39e42bbb24 100644 --- a/indra/newview/llvosky.h +++ b/indra/newview/llvosky.h @@ -30,86 +30,22 @@ #include "stdtypes.h" #include "v3color.h" #include "v4coloru.h" +#include "llquaternion.h" #include "llviewertexture.h" #include "llviewerobject.h" #include "llframetimer.h" +#include "v3colorutil.h" +#include "llsettingssky.h" +#include "lllegacyatmospherics.h" - -////////////////////////////////// -// -// Lots of constants -// -// Will clean these up at some point... -// - -const F32 HORIZON_DIST = 1024.0f; const F32 SKY_BOX_MULT = 16.0f; -const F32 HEAVENLY_BODY_DIST = HORIZON_DIST - 10.f; +const F32 HEAVENLY_BODY_DIST = HORIZON_DIST - 20.f; const F32 HEAVENLY_BODY_FACTOR = 0.1f; const F32 HEAVENLY_BODY_SCALE = HEAVENLY_BODY_DIST * HEAVENLY_BODY_FACTOR; -const F32 EARTH_RADIUS = 6.4e6f; // exact radius = 6.37 x 10^6 m -const F32 ATM_EXP_FALLOFF = 0.000126f; -const F32 ATM_SEA_LEVEL_NDENS = 2.55e25f; -// Somewhat arbitrary: -const F32 ATM_HEIGHT = 100000.f; - -const F32 FIRST_STEP = 5000.f; -const F32 INV_FIRST_STEP = 1.f/FIRST_STEP; -const S32 NO_STEPS = 15; -const F32 INV_NO_STEPS = 1.f/NO_STEPS; - - -// constants used in calculation of scattering coeff of clear air -const F32 sigma = 0.035f; -const F32 fsigma = (6.f + 3.f * sigma) / (6.f-7.f*sigma); -const F64 Ndens = 2.55e25; -const F64 Ndens2 = Ndens*Ndens; - -// HACK: Allow server to change sun and moon IDs. -// I can't figure out how to pass the appropriate -// information into the LLVOSky constructor. JC -extern LLUUID gSunTextureID; -extern LLUUID gMoonTextureID; - - -LL_FORCE_INLINE LLColor3 color_div(const LLColor3 &col1, const LLColor3 &col2) -{ - return LLColor3( - col1.mV[0] / col2.mV[0], - col1.mV[1] / col2.mV[1], - col1.mV[2] / col2.mV[2] ); -} - -LLColor3 color_norm(const LLColor3 &col); -BOOL clip_quad_to_horizon(F32& t_left, F32& t_right, LLVector3 v_clipped[4], - const LLVector3 v_corner[4], const F32 cos_max_angle); -F32 clip_side_to_horizon(const LLVector3& v0, const LLVector3& v1, const F32 cos_max_angle); - -inline F32 color_intens ( const LLColor3 &col ) -{ - return col.mV[0] + col.mV[1] + col.mV[2]; -} - -inline F32 color_max(const LLColor3 &col) -{ - return llmax(col.mV[0], col.mV[1], col.mV[2]); -} - -inline F32 color_max(const LLColor4 &col) -{ - return llmax(col.mV[0], col.mV[1], col.mV[2]); -} - - -inline F32 color_min(const LLColor3 &col) -{ - return llmin(col.mV[0], col.mV[1], col.mV[2]); -} class LLFace; class LLHaze; - class LLSkyTex { friend class LLVOSky; @@ -121,33 +57,28 @@ private: LLColor4 *mSkyData; LLVector3 *mSkyDirs; // Cache of sky direction vectors static S32 sCurrent; - static F32 sInterpVal; public: - static F32 getInterpVal() { return sInterpVal; } - static void setInterpVal(const F32 v) { sInterpVal = v; } - static BOOL doInterpolate() { return sInterpVal > 0.001f; } - void bindTexture(BOOL curr = TRUE); protected: LLSkyTex(); - void init(); + void init(bool isShiny); void cleanupGL(); void restoreGL(); ~LLSkyTex(); - static S32 getResolution() { return sResolution; } - static S32 getCurrent() { return sCurrent; } - static S32 stepCurrent() { sCurrent++; sCurrent &= 1; return sCurrent; } - static S32 getNext() { return ((sCurrent+1) & 1); } - static S32 getWhich(const BOOL curr) { return curr ? sCurrent : getNext(); } + static S32 getResolution(); + static S32 getCurrent(); + static S32 stepCurrent(); + static S32 getNext(); + static S32 getWhich(const BOOL curr); void initEmpty(const S32 tex); - void create(F32 brightness); + void create(); void setDir(const LLVector3 &dir, const S32 i, const S32 j) { @@ -183,8 +114,10 @@ protected: return col; } - LLImageRaw* getImageRaw(BOOL curr=TRUE) { return mImageRaw[getWhich(curr)]; } + LLImageRaw* getImageRaw(BOOL curr=TRUE); void createGLImage(BOOL curr=TRUE); + + bool mIsShiny; }; /// TODO Move into the stars draw pool (and rename them appropriately). @@ -197,244 +130,70 @@ protected: LLColor3 mColorCached; F32 mIntensity; LLVector3 mDirection; // direction of the local heavenly body + LLQuaternion mRotation; LLVector3 mAngularVelocity; // velocity of the local heavenly body F32 mDiskRadius; - BOOL mDraw; // FALSE - do not draw. + bool mDraw; // FALSE - do not draw. F32 mHorizonVisibility; // number [0, 1] due to how horizon F32 mVisibility; // same but due to other objects being in throng. - BOOL mVisible; + bool mVisible; static F32 sInterpVal; LLVector3 mQuadCorner[4]; - LLVector3 mU; - LLVector3 mV; LLVector3 mO; public: - LLHeavenBody(const F32 rad) : - mDirectionCached(LLVector3(0,0,0)), - mDirection(LLVector3(0,0,0)), - mIntensity(0.f), - mDiskRadius(rad), mDraw(FALSE), - mHorizonVisibility(1.f), mVisibility(1.f), - mVisible(FALSE) - { - mColor.setToBlack(); - mColorCached.setToBlack(); - } + LLHeavenBody(const F32 rad); ~LLHeavenBody() {} - const LLVector3& getDirection() const { return mDirection; } - void setDirection(const LLVector3 &direction) { mDirection = direction; } - void setAngularVelocity(const LLVector3 &ang_vel) { mAngularVelocity = ang_vel; } - const LLVector3& getAngularVelocity() const { return mAngularVelocity; } - - const LLVector3& getDirectionCached() const { return mDirectionCached; } - void renewDirection() { mDirectionCached = mDirection; } - - const LLColor3& getColorCached() const { return mColorCached; } - void setColorCached(const LLColor3& c) { mColorCached = c; } - const LLColor3& getColor() const { return mColor; } - void setColor(const LLColor3& c) { mColor = c; } - - void renewColor() { mColorCached = mColor; } - - static F32 interpVal() { return sInterpVal; } - static void setInterpVal(const F32 v) { sInterpVal = v; } - - LLColor3 getInterpColor() const - { - return sInterpVal * mColor + (1 - sInterpVal) * mColorCached; - } - - const F32& getHorizonVisibility() const { return mHorizonVisibility; } - void setHorizonVisibility(const F32 c = 1) { mHorizonVisibility = c; } - const F32& getVisibility() const { return mVisibility; } - void setVisibility(const F32 c = 1) { mVisibility = c; } - F32 getHaloBrighness() const - { - return llmax(0.f, llmin(0.9f, mHorizonVisibility)) * mVisibility; - } - BOOL isVisible() const { return mVisible; } - void setVisible(const BOOL v) { mVisible = v; } - - const F32& getIntensity() const { return mIntensity; } - void setIntensity(const F32 c) { mIntensity = c; } - - void setDiskRadius(const F32 radius) { mDiskRadius = radius; } - F32 getDiskRadius() const { return mDiskRadius; } - - void setDraw(const BOOL draw) { mDraw = draw; } - BOOL getDraw() const { return mDraw; } + const LLQuaternion& getRotation() const; + void setRotation(const LLQuaternion& rot); - const LLVector3& corner(const S32 n) const { return mQuadCorner[n]; } - LLVector3& corner(const S32 n) { return mQuadCorner[n]; } - const LLVector3* corners() const { return mQuadCorner; } - - const LLVector3& getU() const { return mU; } - const LLVector3& getV() const { return mV; } - void setU(const LLVector3& u) { mU = u; } - void setV(const LLVector3& v) { mV = v; } -}; + const LLVector3& getDirection() const; + void setDirection(const LLVector3 &direction); + void setAngularVelocity(const LLVector3 &ang_vel); + const LLVector3& getAngularVelocity() const; + const LLVector3& getDirectionCached() const; + void renewDirection(); -LL_FORCE_INLINE LLColor3 refr_ind_calc(const LLColor3 &wave_length) -{ - LLColor3 refr_ind; - for (S32 i = 0; i < 3; ++i) - { - const F32 wl2 = wave_length.mV[i] * wave_length.mV[i] * 1e-6f; - refr_ind.mV[i] = 6.43e3f + ( 2.95e6f / ( 146.0f - 1.f/wl2 ) ) + ( 2.55e4f / ( 41.0f - 1.f/wl2 ) ); - refr_ind.mV[i] *= 1.0e-8f; - refr_ind.mV[i] += 1.f; - } - return refr_ind; -} - - -class LLHaze -{ -public: - LLHaze() : mG(0), mFalloff(1), mAbsCoef(0.f) {mSigSca.setToBlack();} - LLHaze(const F32 g, const LLColor3& sca, const F32 fo = 2.f) : - mG(g), mSigSca(0.25f/F_PI * sca), mFalloff(fo), mAbsCoef(0.f) - { - mAbsCoef = color_intens(mSigSca) / sAirScaIntense; - } - - LLHaze(const F32 g, const F32 sca, const F32 fo = 2.f) : mG(g), - mSigSca(0.25f/F_PI * LLColor3(sca, sca, sca)), mFalloff(fo) - { - mAbsCoef = 0.01f * sca / sAirScaAvg; - } - - F32 getG() const { return mG; } + const LLColor3& getColorCached() const; + void setColorCached(const LLColor3& c); + const LLColor3& getColor() const; + void setColor(const LLColor3& c); - void setG(const F32 g) - { - mG = g; - } + void renewColor(); - const LLColor3& getSigSca() const // sea level - { - return mSigSca; - } + static F32 interpVal(); + static void setInterpVal(const F32 v); - void setSigSca(const LLColor3& s) - { - mSigSca = s; - mAbsCoef = 0.01f * color_intens(mSigSca) / sAirScaIntense; - } + LLColor3 getInterpColor() const; - void setSigSca(const F32 s0, const F32 s1, const F32 s2) - { - mSigSca = sAirScaAvg * LLColor3 (s0, s1, s2); - mAbsCoef = 0.01f * (s0 + s1 + s2) / 3; - } + const F32& getVisibility() const; + void setVisibility(const F32 c = 1); - F32 getFalloff() const - { - return mFalloff; - } + bool isVisible() const; + void setVisible(const bool v); - void setFalloff(const F32 fo) - { - mFalloff = fo; - } + const F32& getIntensity() const; + void setIntensity(const F32 c); - F32 getAbsCoef() const - { - return mAbsCoef; - } + void setDiskRadius(const F32 radius); + F32 getDiskRadius() const; - inline static F32 calcFalloff(const F32 h) - { - return (h <= 0) ? 1.0f : (F32)LL_FAST_EXP(-ATM_EXP_FALLOFF * h); - } + void setDraw(const bool draw); + bool getDraw() const; - inline LLColor3 calcSigSca(const F32 h) const - { - return calcFalloff(h * mFalloff) * mSigSca; - } - - inline void calcSigSca(const F32 h, LLColor3 &result) const - { - result = mSigSca; - result *= calcFalloff(h * mFalloff); - } - - LLColor3 calcSigExt(const F32 h) const - { - return calcFalloff(h * mFalloff) * (1 + mAbsCoef) * mSigSca; - } - - F32 calcPhase(const F32 cos_theta) const; - - static inline LLColor3 calcAirSca(const F32 h); - static inline void calcAirSca(const F32 h, LLColor3 &result); - -private: - static LLColor3 const sAirScaSeaLevel; - static F32 const sAirScaIntense; - static F32 const sAirScaAvg; - -protected: - F32 mG; - LLColor3 mSigSca; - F32 mFalloff; // 1 - slow, >1 - faster - F32 mAbsCoef; + const LLVector3& corner(const S32 n) const; + LLVector3& corner(const S32 n); + const LLVector3* corners() const; }; - class LLCubeMap; -// turn on floating point precision -// in vs2003 for this class. Otherwise -// black dots go everywhere from 7:10 - 8:50 -#if LL_MSVC && __MSVC_VER__ < 8 -#pragma optimize("p", on) -#endif - - class LLVOSky : public LLStaticViewerObject { -public: - /// WL PARAMS - F32 dome_radius; - F32 dome_offset_ratio; - LLColor3 sunlight_color; - LLColor3 ambient; - F32 gamma; - LLVector4 lightnorm; - LLVector4 unclamped_lightnorm; - LLColor3 blue_density; - LLColor3 blue_horizon; - F32 haze_density; - F32 haze_horizon; - F32 density_multiplier; - F32 max_y; - LLColor3 glow; - F32 cloud_shadow; - LLColor3 cloud_color; - F32 cloud_scale; - LLColor3 cloud_pos_density1; - LLColor3 cloud_pos_density2; - -public: - void initAtmospherics(void); - void calcAtmospherics(void); - LLColor3 createDiffuseFromWL(LLColor3 diffuse, LLColor3 ambient, LLColor3 sundiffuse, LLColor3 sunambient); - LLColor3 createAmbientFromWL(LLColor3 ambient, LLColor3 sundiffuse, LLColor3 sunambient); - - void calcSkyColorWLVert(LLVector3 & Pn, LLColor3 & vary_HazeColor, LLColor3 & vary_CloudColorSun, - LLColor3 & vary_CloudColorAmbient, F32 & vary_CloudDensity, - LLVector2 vary_HorizontalProjection[2]); - - LLColor3 calcSkyColorWLFrag(LLVector3 & Pn, LLColor3 & vary_HazeColor, LLColor3 & vary_CloudColorSun, - LLColor3 & vary_CloudColorAmbient, F32 & vary_CloudDensity, - LLVector2 vary_HorizontalProjection[2]); - -public: +public: enum { FACE_SIDE0, @@ -447,7 +206,6 @@ public: FACE_MOON, // was 7 FACE_BLOOM, // was 8 FACE_REFLECTION, // was 10 - FACE_DUMMY, //for an ATI bug --bao FACE_COUNT }; @@ -461,8 +219,10 @@ public: void cleanupGL(); void restoreGL(); + void calc(); + /*virtual*/ void idleUpdate(LLAgent &agent, const F64 &time); - BOOL updateSky(); + bool updateSky(); // Graphical stuff for objects - maybe broken out into render class // later? @@ -470,65 +230,31 @@ public: /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline); /*virtual*/ BOOL updateGeometry(LLDrawable *drawable); - void initSkyTextureDirs(const S32 side, const S32 tile); - void createSkyTexture(const S32 side, const S32 tile); - - LLColor4 calcSkyColorInDir(const LLVector3& dir, bool isShiny = false); - - LLColor3 calcRadianceAtPoint(const LLVector3& pos) const - { - F32 radiance = mBrightnessScaleGuess * mSun.getIntensity(); - return LLColor3(radiance, radiance, radiance); - } - - const LLHeavenBody& getSun() const { return mSun; } + const LLHeavenBody& getSun() const { return mSun; } const LLHeavenBody& getMoon() const { return mMoon; } - const LLVector3& getToSunLast() const { return mSun.getDirectionCached(); } - const LLVector3& getToSun() const { return mSun.getDirection(); } - const LLVector3& getToMoon() const { return mMoon.getDirection(); } - const LLVector3& getToMoonLast() const { return mMoon.getDirectionCached(); } - BOOL isSunUp() const { return mSun.getDirectionCached().mV[2] > -0.05f; } - void calculateColors(); - - LLColor3 getSunDiffuseColor() const { return mSunDiffuse; } - LLColor3 getMoonDiffuseColor() const { return mMoonDiffuse; } - LLColor4 getSunAmbientColor() const { return mSunAmbient; } - LLColor4 getMoonAmbientColor() const { return mMoonAmbient; } - const LLColor4& getTotalAmbientColor() const { return mTotalAmbient; } - LLColor4 getFogColor() const { return mFogColor; } - LLColor4 getGLFogColor() const { return mGLFogCol; } - - BOOL isSameFace(S32 idx, const LLFace* face) const { return mFace[idx] == face; } - - void initSunDirection(const LLVector3 &sun_dir, const LLVector3 &sun_ang_velocity); - - void setSunDirection(const LLVector3 &sun_dir, const LLVector3 &sun_ang_velocity); + bool isSameFace(S32 idx, const LLFace* face) const { return mFace[idx] == face; } - BOOL updateHeavenlyBodyGeometry(LLDrawable *drawable, const S32 side, const BOOL is_sun, - LLHeavenBody& hb, const F32 sin_max_angle, - const LLVector3 &up, const LLVector3 &right); + // directions provided should already be in CFR coord sys (+x at, +z up, +y right) + void setSunAndMoonDirectionsCFR(const LLVector3 &sun_dir, const LLVector3 &moon_dir); + void setSunDirectionCFR(const LLVector3 &sun_direction); + void setMoonDirectionCFR(const LLVector3 &moon_direction); - F32 cosHorizon(const F32 delta = 0) const - { - const F32 sin_angle = EARTH_RADIUS/(EARTH_RADIUS + mCameraPosAgent.mV[2]); - return delta - (F32)sqrt(1.f - sin_angle * sin_angle); - } - - void updateSunHaloGeometry(LLDrawable *drawable); + bool updateHeavenlyBodyGeometry(LLDrawable *drawable, F32 scale, const S32 side, LLHeavenBody& hb, const LLVector3 &up, const LLVector3 &right); void updateReflectionGeometry(LLDrawable *drawable, F32 H, const LLHeavenBody& HB); - - const LLHaze& getHaze() const { return mHaze; } - LLHaze& getHaze() { return mHaze; } - F32 getHazeConcentration() const { return mHazeConcentration; } - void setHaze(const LLHaze& h) { mHaze = h; } F32 getWorldScale() const { return mWorldScale; } void setWorldScale(const F32 s) { mWorldScale = s; } void updateFog(const F32 distance); - void setFogRatio(const F32 fog_ratio) { mFogRatio = fog_ratio; } - LLColor4U getFadeColor() const { return mFadeColor; } - F32 getFogRatio() const { return mFogRatio; } + + void setFogRatio(const F32 fog_ratio) { m_legacyAtmospherics.setFogRatio(fog_ratio); } + F32 getFogRatio() const { return m_legacyAtmospherics.getFogRatio(); } + + LLColor4 getSkyFogColor() const { return m_legacyAtmospherics.getFogColor(); } + LLColor4 getGLFogColor() const { return m_legacyAtmospherics.getGLFogColor(); } + + LLColor4U getFadeColor() const; + void setCloudDensity(F32 cloud_density) { mCloudDensity = cloud_density; } void setWind ( const LLVector3& wind ) { mWind = wind.length(); } @@ -538,24 +264,55 @@ public: LLCubeMap *getCubeMap() const { return mCubeMap; } S32 getDrawRefl() const { return mDrawRefl; } void setDrawRefl(const S32 r) { mDrawRefl = r; } - BOOL isReflFace(const LLFace* face) const { return face == mFace[FACE_REFLECTION]; } + bool isReflFace(const LLFace* face) const { return face == mFace[FACE_REFLECTION]; } LLFace* getReflFace() const { return mFace[FACE_REFLECTION]; } - LLViewerTexture* getSunTex() const { return mSunTexturep; } - LLViewerTexture* getMoonTex() const { return mMoonTexturep; } - LLViewerTexture* getBloomTex() const { return mBloomTexturep; } - void forceSkyUpdate(void) { mForceUpdate = TRUE; } + LLViewerTexture* getSunTex() const { return mSunTexturep[0]; } + LLViewerTexture* getMoonTex() const { return mMoonTexturep[0]; } + LLViewerTexture* getBloomTex() const { return mBloomTexturep[0]; } + LLViewerTexture* getCloudNoiseTex() const { return mCloudNoiseTexturep[0]; } + + LLViewerTexture* getRainbowTex() const { return mRainbowMap; } + LLViewerTexture* getHaloTex() const { return mHaloMap; } + + LLViewerTexture* getSunTexNext() const { return mSunTexturep[1]; } + LLViewerTexture* getMoonTexNext() const { return mMoonTexturep[1]; } + LLViewerTexture* getBloomTexNext() const { return mBloomTexturep[1]; } + LLViewerTexture* getCloudNoiseTexNext() const { return mCloudNoiseTexturep[1]; } + + void setSunTextures(const LLUUID& sun_texture, const LLUUID& sun_texture_next); + void setMoonTextures(const LLUUID& moon_texture, const LLUUID& moon_texture_next); + void setCloudNoiseTextures(const LLUUID& cloud_noise_texture, const LLUUID& cloud_noise_texture_next); + void setBloomTextures(const LLUUID& bloom_texture, const LLUUID& bloom_texture_next); + + void setSunScale(F32 sun_scale); + void setMoonScale(F32 sun_scale); + + void forceSkyUpdate(void); public: LLFace *mFace[FACE_COUNT]; LLVector3 mBumpSunDir; + F32 getInterpVal() const { return mInterpVal; } + protected: ~LLVOSky(); - LLPointer<LLViewerFetchedTexture> mSunTexturep; - LLPointer<LLViewerFetchedTexture> mMoonTexturep; - LLPointer<LLViewerFetchedTexture> mBloomTexturep; + void updateDirections(void); + + void initSkyTextureDirs(const S32 side, const S32 tile); + void createSkyTexture(AtmosphericsVars& vars, const S32 side, const S32 tile); + + LLPointer<LLViewerFetchedTexture> mSunTexturep[2]; + LLPointer<LLViewerFetchedTexture> mMoonTexturep[2]; + LLPointer<LLViewerFetchedTexture> mCloudNoiseTexturep[2]; + LLPointer<LLViewerFetchedTexture> mBloomTexturep[2]; + LLPointer<LLViewerFetchedTexture> mRainbowMap; + LLPointer<LLViewerFetchedTexture> mHaloMap; + + F32 mSunScale = 1.0f; + F32 mMoonScale = 1.0f; static S32 sResolution; static S32 sTileResX; @@ -575,73 +332,30 @@ protected: LLColor3 mBrightestPointNew; F32 mBrightnessScaleGuess; LLColor3 mBrightestPointGuess; - LLHaze mHaze; - F32 mHazeConcentration; - BOOL mWeatherChange; + bool mWeatherChange; F32 mCloudDensity; F32 mWind; - BOOL mInitialized; - BOOL mForceUpdate; //flag to force instantaneous update of cubemap - LLVector3 mLastLightingDirection; - LLColor3 mLastTotalAmbient; + bool mInitialized; + bool mForceUpdate; + bool mNeedUpdate; // flag to force update of cubemap + S32 mCubeMapUpdateStage; // state of cubemap uodate: -1 idle; 0-5 per-face updates; 6 finalizing + F32 mAmbientScale; LLColor3 mNightColorShift; F32 mInterpVal; - - LLColor4 mFogColor; - LLColor4 mGLFogCol; - - F32 mFogRatio; F32 mWorldScale; - LLColor4 mSunAmbient; - LLColor4 mMoonAmbient; - LLColor4 mTotalAmbient; - LLColor3 mSunDiffuse; - LLColor3 mMoonDiffuse; - LLColor4U mFadeColor; // Color to fade in from - - LLPointer<LLCubeMap> mCubeMap; // Cube map for the environment - S32 mDrawRefl; + LLPointer<LLCubeMap> mCubeMap; // Cube map for the environment + S32 mDrawRefl; LLFrameTimer mUpdateTimer; + LLTimer mForceUpdateThrottle; + bool mHeavenlyBodyUpdated ; -public: - //by bao - //fake vertex buffer updating - //to guarantee at least updating one VBO buffer every frame - //to work around the bug caused by ATI card --> DEV-3855 - // - void createDummyVertexBuffer() ; - void updateDummyVertexBuffer() ; - - BOOL mHeavenlyBodyUpdated ; + AtmosphericsVars m_atmosphericsVars; + AtmosphericsVars m_lastAtmosphericsVars; + LLAtmospherics m_legacyAtmospherics; }; -// turn it off -#if LL_MSVC && __MSVC_VER__ < 8 -#pragma optimize("p", off) -#endif - -// Utility functions -F32 azimuth(const LLVector3 &v); -F32 color_norm_pow(LLColor3& col, F32 e, BOOL postmultiply = FALSE); - - -/* Proportion of light that is scattered into 'path' from 'in' over distance dt. */ -/* assumes that vectors 'path' and 'in' are normalized. Scattering coef / 2pi */ - -inline LLColor3 LLHaze::calcAirSca(const F32 h) -{ - return calcFalloff(h) * sAirScaSeaLevel; -} - -inline void LLHaze::calcAirSca(const F32 h, LLColor3 &result) -{ - result = sAirScaSeaLevel; - result *= calcFalloff(h); -} - - #endif |