diff options
Diffstat (limited to 'indra/newview/llenvironment.h')
-rw-r--r-- | indra/newview/llenvironment.h | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/indra/newview/llenvironment.h b/indra/newview/llenvironment.h index 7cbf2d25bb..330de2bea8 100644 --- a/indra/newview/llenvironment.h +++ b/indra/newview/llenvironment.h @@ -38,20 +38,21 @@ #include "llatmosphere.h" +#include "llglslshader.h" + #include <boost/signals2.hpp> //------------------------------------------------------------------------- class LLViewerCamera; -class LLGLSLShader; class LLParcel; //------------------------------------------------------------------------- -class LLEnvironment : public LLSingleton<LLEnvironment> +class LLEnvironment : public LLSimpleton<LLEnvironment> { - LLSINGLETON_C11(LLEnvironment); LOG_CLASS(LLEnvironment); - public: + LLEnvironment(); + static const F64Seconds TRANSITION_INSTANT; static const F64Seconds TRANSITION_FAST; static const F64Seconds TRANSITION_DEFAULT; @@ -114,7 +115,7 @@ public: typedef std::array<F32, 4> altitude_list_t; typedef std::vector<F32> altitudes_vect_t; - virtual ~LLEnvironment(); + ~LLEnvironment(); bool canEdit() const; bool isExtendedEnvironmentEnabled() const; @@ -131,9 +132,14 @@ public: void update(const LLViewerCamera * cam); - static void updateGLVariablesForSettings(LLGLSLShader *shader, const LLSettingsBase::ptr_t &psetting); + static void updateGLVariablesForSettings(LLShaderUniforms* uniforms, const LLSettingsBase::ptr_t &psetting); + + // apply current sky settings to given shader void updateShaderUniforms(LLGLSLShader *shader); + // prepare settings to be applied to shaders (call whenever settings are updated) + void updateSettingsUniforms(); + void setSelectedEnvironment(EnvSelection_t env, LLSettingsBase::Seconds transition = TRANSITION_DEFAULT, bool forced = false); EnvSelection_t getSelectedEnvironment() const { return mSelectedEnvironment; } @@ -152,6 +158,8 @@ public: static void logEnvironment(EnvSelection_t env, const LLSettingsBase::ptr_t &settings, S32 env_version = NO_VERSION); + void setCurrentEnvironmentSelection(LLEnvironment::EnvSelection_t env); + LLSettingsDay::ptr_t getEnvironmentDay(EnvSelection_t env); LLSettingsDay::Seconds getEnvironmentDayLength(EnvSelection_t env); @@ -234,6 +242,11 @@ public: void handleEnvironmentPush(LLSD &message); + //cached uniform values from LLSD values + LLShaderUniforms mWaterUniforms[LLGLSLShader::SG_COUNT]; + LLShaderUniforms mSkyUniforms[LLGLSLShader::SG_COUNT]; + // ======================================================================================= + class DayInstance: public std::enable_shared_from_this<DayInstance> { public: @@ -288,6 +301,7 @@ public: LLSettingsDay::ptr_t mDayCycle; LLSettingsSky::ptr_t mSky; LLSettingsWater::ptr_t mWater; + S32 mSkyTrack; bool mInitialized; @@ -325,9 +339,10 @@ public: DayInstance::ptr_t getSelectedEnvironmentInstance(); DayInstance::ptr_t getSharedEnvironmentInstance(); + void initSingleton(); + protected: - virtual void initSingleton() override; - virtual void cleanupSingleton() override; + void cleanupSingleton(); private: |