summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormaxim_productengine <mnikolenko@productengine.com>2019-04-22 16:02:53 +0300
committermaxim_productengine <mnikolenko@productengine.com>2019-04-22 16:02:53 +0300
commitce9cf1027f733560e29f77c4a883bd9b5338f9d8 (patch)
tree3164e2821a7359698c994972f895913cb7c99fd7
parent11d1c28d82e8c2e53a4d161eefac4c1733467fd3 (diff)
SL-10982 [EEP] Personal Lighting - Add options to select water maps / cloud textures
-rw-r--r--indra/newview/llfloaterenvironmentadjust.cpp38
-rw-r--r--indra/newview/llfloaterenvironmentadjust.h4
-rw-r--r--indra/newview/skins/default/xui/en/floater_adjust_environment.xml50
3 files changed, 79 insertions, 13 deletions
diff --git a/indra/newview/llfloaterenvironmentadjust.cpp b/indra/newview/llfloaterenvironmentadjust.cpp
index 2c646799ff..3d19d560d6 100644
--- a/indra/newview/llfloaterenvironmentadjust.cpp
+++ b/indra/newview/llfloaterenvironmentadjust.cpp
@@ -32,8 +32,10 @@
#include "llslider.h"
#include "llsliderctrl.h"
#include "llcolorswatch.h"
+#include "lltexturectrl.h"
#include "llvirtualtrackball.h"
#include "llenvironment.h"
+#include "llviewercontrol.h"
//=========================================================================
namespace
@@ -46,6 +48,8 @@ namespace
const std::string FIELD_SKY_HAZE_HORIZON("haze_horizon");
const std::string FIELD_SKY_HAZE_DENSITY("haze_density");
const std::string FIELD_SKY_CLOUD_COVERAGE("cloud_coverage");
+ const std::string FIELD_SKY_CLOUD_MAP("cloud_map");
+ const std::string FIELD_WATER_NORMAL_MAP("water_normal_map");
const std::string FIELD_SKY_CLOUD_SCALE("cloud_scale");
const std::string FIELD_SKY_SCENE_GAMMA("scene_gamma");
const std::string FIELD_SKY_SUN_ROTATION("sun_rotation");
@@ -97,6 +101,14 @@ BOOL LLFloaterEnvironmentAdjust::postBuild()
getChild<LLUICtrl>(FIELD_SKY_MOON_ROTATION)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onMoonRotationChanged(); });
getChild<LLUICtrl>(BTN_RESET)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onButtonReset(); });
+ getChild<LLTextureCtrl>(FIELD_SKY_CLOUD_MAP)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onCloudMapChanged(); });
+ getChild<LLTextureCtrl>(FIELD_SKY_CLOUD_MAP)->setDefaultImageAssetID(LLSettingsSky::GetDefaultCloudNoiseTextureId());
+ getChild<LLTextureCtrl>(FIELD_SKY_CLOUD_MAP)->setAllowNoTexture(TRUE);
+
+ getChild<LLTextureCtrl>(FIELD_WATER_NORMAL_MAP)->setDefaultImageAssetID(LLSettingsWater::GetDefaultWaterNormalAssetId());
+ getChild<LLTextureCtrl>(FIELD_WATER_NORMAL_MAP)->setBlankImageAssetID(LLUUID(gSavedSettings.getString("DefaultBlankNormalTexture")));
+ getChild<LLTextureCtrl>(FIELD_WATER_NORMAL_MAP)->setCommitCallback([this](LLUICtrl *, const LLSD &) { onWaterMapChanged(); });
+
refresh();
return TRUE;
}
@@ -115,6 +127,7 @@ void LLFloaterEnvironmentAdjust::onClose(bool app_quitting)
{
mEventConnection.disconnect();
mLiveSky.reset();
+ mLiveWater.reset();
LLFloater::onClose(app_quitting);
}
@@ -122,7 +135,7 @@ void LLFloaterEnvironmentAdjust::onClose(bool app_quitting)
//-------------------------------------------------------------------------
void LLFloaterEnvironmentAdjust::refresh()
{
- if (!mLiveSky)
+ if (!mLiveSky || !mLiveWater)
{
setAllChildrenEnabled(FALSE);
return;
@@ -142,6 +155,9 @@ void LLFloaterEnvironmentAdjust::refresh()
getChild<LLUICtrl>(FIELD_SKY_CLOUD_SCALE)->setValue(mLiveSky->getCloudScale());
getChild<LLColorSwatchCtrl>(FIELD_SKY_SUN_COLOR)->set(mLiveSky->getSunlightColor() / SLIDER_SCALE_SUN_AMBIENT);
+ getChild<LLTextureCtrl>(FIELD_SKY_CLOUD_MAP)->setValue(mLiveSky->getCloudNoiseTextureId());
+ getChild<LLTextureCtrl>(FIELD_WATER_NORMAL_MAP)->setValue(mLiveWater->getNormalMapID());
+
LLColor3 glow(mLiveSky->getGlow());
// takes 40 - 0.2 range -> 0 - 1.99 UI range
@@ -165,22 +181,26 @@ void LLFloaterEnvironmentAdjust::captureCurrentEnvironment()
if (environment.getEnvironmentDay(LLEnvironment::ENV_LOCAL))
{ // We have a full day cycle in the local environment. Freeze the sky
mLiveSky = environment.getEnvironmentFixedSky(LLEnvironment::ENV_LOCAL)->buildClone();
+ mLiveWater = environment.getEnvironmentFixedWater(LLEnvironment::ENV_LOCAL)->buildClone();
updatelocal = true;
}
else
{ // otherwise we can just use the sky.
mLiveSky = environment.getEnvironmentFixedSky(LLEnvironment::ENV_LOCAL);
+ mLiveWater = environment.getEnvironmentFixedWater(LLEnvironment::ENV_LOCAL);
}
}
else
{
mLiveSky = environment.getEnvironmentFixedSky(LLEnvironment::ENV_PARCEL, true)->buildClone();
+ mLiveWater = environment.getEnvironmentFixedWater(LLEnvironment::ENV_PARCEL, true)->buildClone();
updatelocal = true;
}
if (updatelocal)
{
environment.setEnvironment(LLEnvironment::ENV_LOCAL, mLiveSky, FLOATER_ENVIRONMENT_UPDATE);
+ environment.setEnvironment(LLEnvironment::ENV_LOCAL, mLiveWater, FLOATER_ENVIRONMENT_UPDATE);
}
environment.setSelectedEnvironment(LLEnvironment::ENV_LOCAL);
environment.updateEnvironment(LLEnvironment::TRANSITION_INSTANT);
@@ -322,6 +342,22 @@ void LLFloaterEnvironmentAdjust::onMoonRotationChanged()
mLiveSky->update();
}
+void LLFloaterEnvironmentAdjust::onCloudMapChanged()
+{
+ if (!mLiveSky)
+ return;
+ mLiveSky->setCloudNoiseTextureId(getChild<LLTextureCtrl>(FIELD_SKY_CLOUD_MAP)->getValue().asUUID());
+ mLiveSky->update();
+}
+
+void LLFloaterEnvironmentAdjust::onWaterMapChanged()
+{
+ if (!mLiveWater)
+ return;
+ mLiveWater->setNormalMapID(getChild<LLTextureCtrl>(FIELD_WATER_NORMAL_MAP)->getValue().asUUID());
+ mLiveWater->update();
+}
+
void LLFloaterEnvironmentAdjust::onSunColorChanged()
{
if (!mLiveSky)
diff --git a/indra/newview/llfloaterenvironmentadjust.h b/indra/newview/llfloaterenvironmentadjust.h
index 4876c45065..cb38dbcfa8 100644
--- a/indra/newview/llfloaterenvironmentadjust.h
+++ b/indra/newview/llfloaterenvironmentadjust.h
@@ -77,11 +77,15 @@ private:
void onMoonRotationChanged();
+ void onCloudMapChanged();
+ void onWaterMapChanged();
+
void onButtonReset();
void onEnvironmentUpdated(LLEnvironment::EnvSelection_t env, S32 version);
LLSettingsSky::ptr_t mLiveSky;
+ LLSettingsWater::ptr_t mLiveWater;
LLEnvironment::connection_t mEventConnection;
};
diff --git a/indra/newview/skins/default/xui/en/floater_adjust_environment.xml b/indra/newview/skins/default/xui/en/floater_adjust_environment.xml
index fc356c10c7..59589e3665 100644
--- a/indra/newview/skins/default/xui/en/floater_adjust_environment.xml
+++ b/indra/newview/skins/default/xui/en/floater_adjust_environment.xml
@@ -5,14 +5,14 @@
save_rect="false"
title="Personal Lighting"
width="845"
- height="230"
+ height="240"
min_width="500"
- min_height="225"
+ min_height="235"
single_instance="true"
can_resize="false">
<layout_stack name="outer_stack"
width="845"
- height="220"
+ height="230"
follows="all"
animate="false"
top="0"
@@ -47,7 +47,7 @@
width="80">Ambient:</text>
<color_swatch can_apply_immediately="true"
follows="left|top"
- height="37"
+ height="40"
label_height="0"
layout="topleft"
left_delta="0"
@@ -62,7 +62,7 @@
width="80">Blue Horizon:</text>
<color_swatch can_apply_immediately="true"
follows="left|top"
- height="37"
+ height="40"
label_height="0"
layout="topleft"
left_delta="0"
@@ -77,7 +77,7 @@
width="80">Blue Density:</text>
<color_swatch can_apply_immediately="true"
follows="left|top"
- height="37"
+ height="40"
label_height="0"
layout="topleft"
left_delta="0"
@@ -97,12 +97,12 @@
<text follows="right|top"
height="10"
layout="topleft"
- right="-10"
+ right="-12"
top="5"
width="60">Sun Color:</text>
<color_swatch can_apply_immediately="true"
follows="left|top"
- height="37"
+ height="10"
label_height="0"
layout="topleft"
left_delta="0"
@@ -113,17 +113,43 @@
height="10"
layout="topleft"
left_delta="0"
- top_pad="10"
+ top_pad="5"
width="80">Cloud Color:</text>
<color_swatch can_apply_immediately="true"
follows="left|top"
- height="37"
+ height="10"
label_height="0"
layout="topleft"
left_delta="0"
name="cloud_color"
top_pad="5"
width="60"/>
+ <text follows="left|top"
+ height="10"
+ layout="topleft"
+ left_delta="0"
+ top_pad="10"
+ name="cloud_map_label"
+ width="80">Cloud Image:</text>
+ <texture_picker height="63"
+ layout="topleft"
+ left_delta="0"
+ name="cloud_map"
+ top_pad="5"
+ width="60"/>
+ <text follows="left|top"
+ height="10"
+ layout="topleft"
+ left_delta="0"
+ top_pad="-13"
+ name="cloud_map_label"
+ width="80">Water Image:</text>
+ <texture_picker height="63"
+ layout="topleft"
+ left_delta="0"
+ name="water_normal_map"
+ top_pad="5"
+ width="60"/>
</layout_panel>
<layout_panel border="false"
bevel_style="in"
@@ -257,7 +283,7 @@
layout="topleft"
name="sunbeacon"
left_delta="55"
- bottom="-10"
+ bottom="-20"
follows="bottom|right"/>
<text follows="left|top"
height="10"
@@ -366,7 +392,7 @@
layout="topleft"
name="moonbeacon"
right="-50"
- bottom="-10"
+ bottom="-20"
follows="bottom|right"/>
</layout_panel>
</layout_stack>