summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/moonF.glsl4
-rw-r--r--indra/newview/llavataractions.cpp27
-rw-r--r--indra/newview/llavataractions.h2
-rw-r--r--indra/newview/llsettingsvo.cpp24
-rw-r--r--indra/newview/llviewershadermgr.cpp1
5 files changed, 44 insertions, 14 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/moonF.glsl b/indra/newview/app_settings/shaders/class1/deferred/moonF.glsl
index 7732cf986e..aae6158673 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/moonF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/moonF.glsl
@@ -44,6 +44,8 @@ uniform sampler2D altDiffuseMap;
uniform float blend_factor; // interp factor between moon A/B
VARYING vec2 vary_texcoord0;
+vec3 srgb_to_linear(vec3 c);
+
void main()
{
vec4 moonA = texture2D(diffuseMap, vary_texcoord0.xy);
@@ -58,6 +60,8 @@ void main()
vec3 exp = vec3(1.0 - mix * moon_brightness) * 2.0 - 1.0;
c.rgb = pow(c.rgb, exp);
+ c.rgb = srgb_to_linear(c.rgb);
+
//c.rgb *= moonlight_color.rgb;
frag_data[0] = vec4(c.rgb, c.a);
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index f0b74e7439..1797d2dd6e 100644
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -626,10 +626,10 @@ namespace action_give_inventory
* Checks My Inventory visibility.
*/
- static bool is_give_inventory_acceptable()
+ static bool is_give_inventory_acceptable(LLInventoryPanel* panel = NULL)
{
// check selection in the panel
- const std::set<LLUUID> inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs();
+ const std::set<LLUUID> inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs(panel);
if (inventory_selected_uuids.empty()) return false; // nothing selected
bool acceptable = false;
@@ -694,7 +694,7 @@ namespace action_give_inventory
uuid_vec_t mAvatarUuids;
};
- static void give_inventory_cb(const LLSD& notification, const LLSD& response)
+ static void give_inventory_cb(const LLSD& notification, const LLSD& response, std::set<LLUUID> inventory_selected_uuids)
{
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
// if Cancel pressed
@@ -703,7 +703,6 @@ namespace action_give_inventory
return;
}
- const std::set<LLUUID> inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs();
if (inventory_selected_uuids.empty())
{
return;
@@ -786,11 +785,11 @@ namespace action_give_inventory
* @param avatar_names - avatar names request to be sent.
* @param avatar_uuids - avatar names request to be sent.
*/
- static void give_inventory(const uuid_vec_t& avatar_uuids, const std::vector<LLAvatarName> avatar_names)
+ static void give_inventory(const uuid_vec_t& avatar_uuids, const std::vector<LLAvatarName> avatar_names, LLInventoryPanel* panel = NULL)
{
llassert(avatar_names.size() == avatar_uuids.size());
- const std::set<LLUUID> inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs();
+ const std::set<LLUUID> inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs(panel);
if (inventory_selected_uuids.empty())
{
return;
@@ -824,7 +823,7 @@ namespace action_give_inventory
substitutions["ITEMS"] = items;
LLShareInfo::instance().mAvatarNames = avatar_names;
LLShareInfo::instance().mAvatarUuids = avatar_uuids;
- LLNotificationsUtil::add(notification, substitutions, LLSD(), &give_inventory_cb);
+ LLNotificationsUtil::add(notification, substitutions, LLSD(), boost::bind(&give_inventory_cb, _1, _2, inventory_selected_uuids));
}
}
@@ -877,11 +876,14 @@ void LLAvatarActions::buildResidentsString(const uuid_vec_t& avatar_uuids, std::
}
//static
-std::set<LLUUID> LLAvatarActions::getInventorySelectedUUIDs()
+std::set<LLUUID> LLAvatarActions::getInventorySelectedUUIDs(LLInventoryPanel* active_panel)
{
std::set<LLFolderViewItem*> inventory_selected;
- LLInventoryPanel* active_panel = action_give_inventory::get_active_inventory_panel();
+ if (!active_panel)
+ {
+ active_panel = action_give_inventory::get_active_inventory_panel();
+ }
if (active_panel)
{
inventory_selected= active_panel->getRootFolder()->getSelectionList();
@@ -911,15 +913,16 @@ void LLAvatarActions::shareWithAvatars(LLView * panel)
{
using namespace action_give_inventory;
- LLFloater* root_floater = gFloaterView->getParentFloater(panel);
+ LLFloater* root_floater = gFloaterView->getParentFloater(panel);
+ LLInventoryPanel* inv_panel = dynamic_cast<LLInventoryPanel*>(panel);
LLFloaterAvatarPicker* picker =
- LLFloaterAvatarPicker::show(boost::bind(give_inventory, _1, _2), TRUE, FALSE, FALSE, root_floater->getName());
+ LLFloaterAvatarPicker::show(boost::bind(give_inventory, _1, _2, inv_panel), TRUE, FALSE, FALSE, root_floater->getName());
if (!picker)
{
return;
}
- picker->setOkBtnEnableCb(boost::bind(is_give_inventory_acceptable));
+ picker->setOkBtnEnableCb(boost::bind(is_give_inventory_acceptable, inv_panel));
picker->openFriendsTab();
if (root_floater)
diff --git a/indra/newview/llavataractions.h b/indra/newview/llavataractions.h
index b56d5b0fb9..7c721076c8 100644
--- a/indra/newview/llavataractions.h
+++ b/indra/newview/llavataractions.h
@@ -244,7 +244,7 @@ public:
*/
static void viewChatHistory(const LLUUID& id);
- static std::set<LLUUID> getInventorySelectedUUIDs();
+ static std::set<LLUUID> getInventorySelectedUUIDs(LLInventoryPanel* active_panel = NULL);
private:
static bool callbackAddFriendWithMessage(const LLSD& notification, const LLSD& response);
diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp
index eb92c11952..628666c3ed 100644
--- a/indra/newview/llsettingsvo.cpp
+++ b/indra/newview/llsettingsvo.cpp
@@ -685,6 +685,28 @@ void LLSettingsVOSky::applySpecial(void *ptarget)
LLVector4 vect_c_p_d1(mSettings[SETTING_CLOUD_POS_DENSITY1]);
vect_c_p_d1 += LLVector4(LLEnvironment::instance().getCloudScrollDelta());
shader->uniform4fv(LLShaderMgr::CLOUD_POS_DENSITY1, 1, vect_c_p_d1.mV);
+
+ LLSettingsSky::ptr_t psky = LLEnvironment::instance().getCurrentSky();
+
+ LLColor4 sunDiffuse = psky->getSunDiffuse();
+ LLColor4 moonDiffuse = psky->getMoonDiffuse();
+
+ F32 max_color = llmax(sunDiffuse.mV[0], sunDiffuse.mV[1], sunDiffuse.mV[2]);
+ if (max_color > 1.f)
+ {
+ sunDiffuse *= 1.f/max_color;
+ }
+ sunDiffuse.clamp();
+
+ max_color = llmax(moonDiffuse.mV[0], moonDiffuse.mV[1], moonDiffuse.mV[2]);
+ if (max_color > 1.f)
+ {
+ moonDiffuse *= 1.f/max_color;
+ }
+ moonDiffuse.clamp();
+
+ shader->uniform4fv(LLShaderMgr::SUNLIGHT_COLOR, 1, sunDiffuse.mV);
+ shader->uniform4fv(LLShaderMgr::MOONLIGHT_COLOR, 1, moonDiffuse.mV);
}
F32 g = getGamma();
@@ -721,7 +743,7 @@ LLSettingsSky::parammapping_t LLSettingsVOSky::getParameterMap() const
param_map[SETTING_CLOUD_VARIANCE] = DefaultParam(LLShaderMgr::CLOUD_VARIANCE, sky_defaults[SETTING_CLOUD_VARIANCE]);
param_map[SETTING_GLOW] = DefaultParam(LLShaderMgr::GLOW, sky_defaults[SETTING_GLOW]);
param_map[SETTING_MAX_Y] = DefaultParam(LLShaderMgr::MAX_Y, sky_defaults[SETTING_MAX_Y]);
- param_map[SETTING_SUNLIGHT_COLOR] = DefaultParam(LLShaderMgr::SUNLIGHT_COLOR, sky_defaults[SETTING_SUNLIGHT_COLOR]);
+ //param_map[SETTING_SUNLIGHT_COLOR] = DefaultParam(LLShaderMgr::SUNLIGHT_COLOR, sky_defaults[SETTING_SUNLIGHT_COLOR]);
param_map[SETTING_MOON_BRIGHTNESS] = DefaultParam(LLShaderMgr::MOON_BRIGHTNESS, sky_defaults[SETTING_MOON_BRIGHTNESS]);
param_map[SETTING_SKY_MOISTURE_LEVEL] = DefaultParam(LLShaderMgr::MOISTURE_LEVEL, sky_defaults[SETTING_SKY_MOISTURE_LEVEL]);
param_map[SETTING_SKY_DROPLET_RADIUS] = DefaultParam(LLShaderMgr::DROPLET_RADIUS, sky_defaults[SETTING_SKY_DROPLET_RADIUS]);
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index da25001d8c..1b1759aeaf 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -2525,6 +2525,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
gDeferredWLMoonProgram.mFeatures.hasTransport = true;
gDeferredWLMoonProgram.mFeatures.hasGamma = true;
gDeferredWLMoonProgram.mFeatures.hasAtmospherics = true;
+ gDeferredWLMoonProgram.mFeatures.hasSrgb = true;
gDeferredWLMoonProgram.mFeatures.isFullbright = true;
gDeferredWLMoonProgram.mFeatures.disableTextureIndex = true;