diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index efd9789169..e18f7fd048 100755
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -19780,5 +19780,16 @@ Change of this parameter will affect the layout of buttons in notification toast
Backup
0
+ FSCloudTexture
+
diff --git a/indra/newview/app_settings/windlight/clouds/Default.tga b/indra/newview/app_settings/windlight/clouds/Default.tga
new file mode 100644
index 0000000000..c95ce7fec4
Binary files /dev/null and b/indra/newview/app_settings/windlight/clouds/Default.tga differ
diff --git a/indra/newview/fspanelprefs.cpp b/indra/newview/fspanelprefs.cpp
index 1c96f12dc3..67525d9f13 100644
--- a/indra/newview/fspanelprefs.cpp
+++ b/indra/newview/fspanelprefs.cpp
@@ -12,6 +12,7 @@
#include "llvoavatar.h"
#include "llvoavatarself.h"
#include "llspinctrl.h"
+#include "lldiriterator.h" // for populating the cloud combo
static LLRegisterPanelClassWrapper t_pref_fs("panel_preference_firestorm");
@@ -45,6 +46,7 @@ BOOL PanelPreferenceFirestorm::postBuild()
getChild("UseEnvironmentFromRegionAlways")->setCommitCallback(boost::bind(&PanelPreferenceFirestorm::onUseEnvironmentFromRegionAlways, this));
// init the enable state of the related wl prefs
onUseEnvironmentFromRegionAlways();
+ populateCloudCombo();
return LLPanelPreference::postBuild();
}
@@ -252,3 +254,25 @@ void PanelPreferenceFirestorm::applyTagCombos()
if(change) LLVOAvatar::invalidateNameTags();
}
+
+void PanelPreferenceFirestorm::populateCloudCombo()
+{
+ LLComboBox* cloud_combo = getChild("cloud_combo");
+ if(cloud_combo)
+ {
+ const std::string cloudDir(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight" + gDirUtilp->getDirDelimiter() + "clouds"));
+
+ LLDirIterator dir_iter(cloudDir, "*.tga");
+ while (1)
+ {
+ std::string file;
+ if (!dir_iter.next(file))
+ {
+ break; // no more files
+ }
+
+ cloud_combo->add(file);
+ }
+ cloud_combo->setSimple(gSavedSettings.getString("FSCloudTexture"));
+ }
+}
diff --git a/indra/newview/fspanelprefs.h b/indra/newview/fspanelprefs.h
index 6259cb58c3..d5e2e136ea 100644
--- a/indra/newview/fspanelprefs.h
+++ b/indra/newview/fspanelprefs.h
@@ -23,6 +23,7 @@ public:
void refreshTagCombos();
void applyTagCombos();
+ void populateCloudCombo();
protected:
LLComboBox* m_UseLegacyClienttags;
diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp
index b5faff7968..9e6813f534 100644
--- a/indra/newview/lldrawpoolwlsky.cpp
+++ b/indra/newview/lldrawpoolwlsky.cpp
@@ -41,6 +41,7 @@
#include "llviewerregion.h"
#include "llface.h"
#include "llrender.h"
+#include "llviewercontrol.h" // Cloud noise selection
LLPointer LLDrawPoolWLSky::sCloudNoiseTexture = NULL;
@@ -53,7 +54,11 @@ static LLGLSLShader* sky_shader = NULL;
LLDrawPoolWLSky::LLDrawPoolWLSky(void) :
LLDrawPool(POOL_WL_SKY)
{
- const std::string cloudNoiseFilename(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight", "clouds2.tga"));
+// Cloud noise selection
+ //const std::string cloudNoiseFilename(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight", "clouds2.tga"));
+ static LLCachedControl cloud_texture(gSavedSettings, "FSCloudTexture", "Default.tga");
+ const std::string cloudNoiseFilename(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight" + gDirUtilp->getDirDelimiter() + "clouds", cloud_texture));
+//
llinfos << "loading WindLight cloud noise from " << cloudNoiseFilename << llendl;
LLPointer cloudNoiseFile(LLImageFormatted::createFromExtension(cloudNoiseFilename));
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_firestorm.xml b/indra/newview/skins/default/xui/en/panel_preferences_firestorm.xml
index 7263fccc36..d05e9e30f6 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_firestorm.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_firestorm.xml
@@ -1352,7 +1352,27 @@
name="FSWindlightInterpolateTime"
width="50"
tool_tip="The duration for crossfading from one preset to another [Default: 3]"/>
-
+
+ Cloud texture (restart recommended):
+
+