aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llwaterparammanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llwaterparammanager.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/linden/indra/newview/llwaterparammanager.cpp b/linden/indra/newview/llwaterparammanager.cpp
index f121d46..fb09fd8 100644
--- a/linden/indra/newview/llwaterparammanager.cpp
+++ b/linden/indra/newview/llwaterparammanager.cpp
@@ -75,7 +75,8 @@ LLWaterParamManager::LLWaterParamManager() :
75 mBlurMultiplier(0.1f, "blurMultiplier"), 75 mBlurMultiplier(0.1f, "blurMultiplier"),
76 mWave1Dir(.5f, .5f, "wave1Dir"), 76 mWave1Dir(.5f, .5f, "wave1Dir"),
77 mWave2Dir(.5f, .5f, "wave2Dir"), 77 mWave2Dir(.5f, .5f, "wave2Dir"),
78 mDensitySliderValue(1.0f) 78 mDensitySliderValue(1.0f),
79 mWaterFogKS(1.0f)
79{ 80{
80} 81}
81 82
@@ -86,7 +87,7 @@ LLWaterParamManager::~LLWaterParamManager()
86void LLWaterParamManager::loadAllPresets(const LLString& file_name) 87void LLWaterParamManager::loadAllPresets(const LLString& file_name)
87{ 88{
88 LLString path_name(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight/water", "")); 89 LLString path_name(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight/water", ""));
89 llinfos << "Loading water settings from " << path_name << llendl; 90 LL_INFOS2("AppInit", "Shaders") << "Loading water settings from " << path_name << LL_ENDL;
90 91
91 //mParamList.clear(); 92 //mParamList.clear();
92 93
@@ -96,7 +97,7 @@ void LLWaterParamManager::loadAllPresets(const LLString& file_name)
96 std::string name; 97 std::string name;
97 found = gDirUtilp->getNextFileInDir(path_name, "*.xml", name, false); 98 found = gDirUtilp->getNextFileInDir(path_name, "*.xml", name, false);
98 99
99 llinfos << "name: " << name << llendl; 100 LL_DEBUGS2("AppInit", "Shaders") << "name: " << name << LL_ENDL;
100 101
101 // if we have one 102 // if we have one
102 if(found) 103 if(found)
@@ -111,7 +112,7 @@ void LLWaterParamManager::loadAllPresets(const LLString& file_name)
111 std::string water_name = unescaped_name.substr(0, unescaped_name.size() - 4); 112 std::string water_name = unescaped_name.substr(0, unescaped_name.size() - 4);
112 113
113 LLString cur_path(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight/water", name)); 114 LLString cur_path(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight/water", name));
114 llinfos << "Loading water from " << cur_path << llendl; 115 LL_DEBUGS2("AppInit", "Shaders") << "Loading water from " << cur_path << LL_ENDL;
115 116
116 std::ifstream water_xml(cur_path.c_str()); 117 std::ifstream water_xml(cur_path.c_str());
117 if (water_xml) 118 if (water_xml)
@@ -255,8 +256,8 @@ void LLWaterParamManager::update(LLViewerCamera * cam)
255 if(gPipeline.canUseVertexShaders()) 256 if(gPipeline.canUseVertexShaders())
256 { 257 {
257 //transform water plane to eye space 258 //transform water plane to eye space
258 glh::vec3f norm(0, 0, 1); 259 glh::vec3f norm(0.f, 0.f, 1.f);
259 glh::vec3f p(0, 0, gAgent.getRegion()->getWaterHeight()+0.1f); 260 glh::vec3f p(0.f, 0.f, gAgent.getRegion()->getWaterHeight()+0.1f);
260 261
261 F32 modelView[16]; 262 F32 modelView[16];
262 for (U32 i = 0; i < 16; i++) 263 for (U32 i = 0; i < 16; i++)
@@ -406,7 +407,7 @@ F32 LLWaterParamManager::getFogDensity(void)
406 F32 fogDensity = mCurParams.getFloat("waterFogDensity", err); 407 F32 fogDensity = mCurParams.getFloat("waterFogDensity", err);
407 408
408 // modify if we're underwater 409 // modify if we're underwater
409 const F32 water_height = gAgent.getRegion()->getWaterHeight(); 410 const F32 water_height = gAgent.getRegion() ? gAgent.getRegion()->getWaterHeight() : 0.f;
410 F32 camera_height = gAgent.getCameraPositionAgent().mV[2]; 411 F32 camera_height = gAgent.getCameraPositionAgent().mV[2];
411 if(camera_height <= water_height) 412 if(camera_height <= water_height)
412 { 413 {