summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2019-02-26 10:16:52 -0800
committerGraham Linden <graham@lindenlab.com>2019-02-26 10:16:52 -0800
commit982b8cdef280469d6c04ce9886a8cadaf6d8350c (patch)
treec9d927b3b903d9351a67f7bab23e33a35f11d2b8
parentf9896dc100ccd6dd2d92610cb4f71f61284f76a6 (diff)
parentb6d08e489c1e80ba474060d0968db11fe18249ea (diff)
Merge
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/sunDiscF.glsl1
-rw-r--r--indra/newview/app_settings/shaders/class1/windlight/sunDiscF.glsl2
-rw-r--r--indra/newview/lldrawpoolwater.cpp2
-rw-r--r--indra/newview/llfloatereditextdaycycle.cpp114
-rw-r--r--indra/newview/llfloatereditextdaycycle.h5
-rw-r--r--indra/newview/lltrackpicker.cpp10
-rw-r--r--indra/newview/pipeline.h3
7 files changed, 99 insertions, 38 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunDiscF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunDiscF.glsl
index 17494361f0..1fb337498c 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/sunDiscF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/sunDiscF.glsl
@@ -52,6 +52,7 @@ void main()
c.rgb = fullbrightAtmosTransport(c.rgb);
c.rgb = fullbrightScaleSoftClip(c.rgb);
+ // SL-9806 stars poke through
//c.a *= sun_fade;
frag_data[0] = c;
diff --git a/indra/newview/app_settings/shaders/class1/windlight/sunDiscF.glsl b/indra/newview/app_settings/shaders/class1/windlight/sunDiscF.glsl
index 5b6fefcad9..d85ce004a5 100644
--- a/indra/newview/app_settings/shaders/class1/windlight/sunDiscF.glsl
+++ b/indra/newview/app_settings/shaders/class1/windlight/sunDiscF.glsl
@@ -48,7 +48,7 @@ void main()
vec4 sunB = texture2D(altDiffuseMap, vary_texcoord0.xy);
vec4 c = mix(sunA, sunB, blend_factor);
-// SL-9806
+// SL-9806 stars poke through
// c.a *= sun_fade;
c.rgb = pow(c.rgb, vec3(0.7f));
diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp
index b2f0d956c4..f5a41fd5f6 100644
--- a/indra/newview/lldrawpoolwater.cpp
+++ b/indra/newview/lldrawpoolwater.cpp
@@ -619,8 +619,6 @@ void LLDrawPoolWater::shade2(bool edge, LLGLSLShader* shader, const LLColor3& li
{
LLGLDisable cullface(GL_CULL_FACE);
-
-
sNeedsReflectionUpdate = TRUE;
sNeedsDistortionUpdate = TRUE;
diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp
index 18f22bf2d2..3f2a89be88 100644
--- a/indra/newview/llfloatereditextdaycycle.cpp
+++ b/indra/newview/llfloatereditextdaycycle.cpp
@@ -555,7 +555,11 @@ void LLFloaterEditExtDayCycle::setEditName(const std::string &name)
/* virtual */
BOOL LLFloaterEditExtDayCycle::handleKeyUp(KEY key, MASK mask, BOOL called_from_parent)
{
- if (mask == MASK_SHIFT && mShiftCopyEnabled)
+ if (!mEditDay)
+ {
+ mShiftCopyEnabled = false;
+ }
+ else if (mask == MASK_SHIFT && mShiftCopyEnabled)
{
mShiftCopyEnabled = false;
std::string curslider = mFramesSlider->getCurSlider();
@@ -770,6 +774,11 @@ void LLFloaterEditExtDayCycle::onAddFrame()
{
LLSettingsBase::Seconds frame(mTimeSlider->getCurSliderValue());
LLSettingsBase::ptr_t setting;
+ if (!mEditDay)
+ {
+ LL_WARNS("ENVDAYEDIT") << "Attempt to add new frame while waiting for day(asset) to load." << LL_ENDL;
+ return;
+ }
if ((mEditDay->getSettingsNearKeyframe(frame, mCurrentTrack, LLSettingsDay::DEFAULT_FRAME_SLOP_FACTOR)).second)
{
LL_WARNS("ENVDAYEDIT") << "Attempt to add new frame too close to existing frame." << LL_ENDL;
@@ -815,6 +824,11 @@ void LLFloaterEditExtDayCycle::onRemoveFrame()
void LLFloaterEditExtDayCycle::onCloneTrack()
{
+ if (!mEditDay)
+ {
+ LL_WARNS("ENVDAYEDIT") << "Attempt to copy track while waiting for day(asset) to load." << LL_ENDL;
+ return;
+ }
const LLEnvironment::altitude_list_t &altitudes = LLEnvironment::instance().getRegionAltitudes();
bool use_altitudes = altitudes.size() > 0 && ((mEditContext == CONTEXT_PARCEL) || (mEditContext == CONTEXT_REGION));
@@ -865,6 +879,12 @@ void LLFloaterEditExtDayCycle::onLoadTrack()
void LLFloaterEditExtDayCycle::onClearTrack()
{
+ if (!mEditDay)
+ {
+ LL_WARNS("ENVDAYEDIT") << "Attempt to clear track while waiting for day(asset) to load." << LL_ENDL;
+ return;
+ }
+
if (mCurrentTrack > 1)
mEditDay->getCycleTrack(mCurrentTrack).clear();
else
@@ -887,6 +907,12 @@ void LLFloaterEditExtDayCycle::onClearTrack()
void LLFloaterEditExtDayCycle::onCommitName(class LLLineEditor* caller, void* user_data)
{
+ if (!mEditDay)
+ {
+ LL_WARNS("ENVDAYEDIT") << "Attempt to rename day while waiting for day(asset) to load." << LL_ENDL;
+ return;
+ }
+
mEditDay->setName(caller->getText());
}
@@ -1274,37 +1300,36 @@ void LLFloaterEditExtDayCycle::updateButtons()
// This logic appears to work in reverse, the add frame button
// is only enabled when you're on an existing frame and disabled
// in all the interim positions where you'd want to add a frame...
- //LLSettingsBase::Seconds frame(mTimeSlider->getCurSliderValue());
- //LLSettingsBase::ptr_t settings = mEditDay->getSettingsAtKeyframe(frame, mCurrentTrack);
- //bool can_add = static_cast<bool>(settings);
- //mAddFrameButton->setEnabled(can_add);
- //mDeleteFrameButton->setEnabled(!can_add);
- mAddFrameButton->setEnabled(!mIsPlaying && isAddingFrameAllowed() && mCanMod);
- mDeleteFrameButton->setEnabled(!mIsPlaying && isRemovingFrameAllowed() && mCanMod);
- mLoadFrame->setEnabled(!mIsPlaying && mCanMod);
+ bool can_manipulate = mEditDay && !mIsPlaying && mCanMod;
bool can_clone(false);
- bool can_load(true);
- bool can_clear(true);
+ bool can_clear(false);
- if (mCurrentTrack == 0)
- {
- can_clone = false;
- }
- else
+ if (can_manipulate)
{
- for (S32 track = 1; track < LLSettingsDay::TRACK_MAX; ++track)
+ if (mCurrentTrack == 0)
{
- if (track == mCurrentTrack)
- continue;
- can_clone |= !mEditDay->getCycleTrack(track).empty();
+ can_clone = false;
}
+ else
+ {
+ for (S32 track = 1; track < LLSettingsDay::TRACK_MAX; ++track)
+ {
+ if (track == mCurrentTrack)
+ continue;
+ can_clone |= !mEditDay->getCycleTrack(track).empty();
+ }
+ }
+
+ can_clear = (mCurrentTrack > 1) ? (!mEditDay->getCycleTrack(mCurrentTrack).empty()) : (mEditDay->getCycleTrack(mCurrentTrack).size() > 1);
}
- can_clear = (mCurrentTrack > 1) ? (!mEditDay->getCycleTrack(mCurrentTrack).empty()) : (mEditDay->getCycleTrack(mCurrentTrack).size() > 1);
mCloneTrack->setEnabled(can_clone);
- mLoadTrack->setEnabled(can_load);
+ mLoadTrack->setEnabled(can_manipulate);
mClearTrack->setEnabled(can_clear);
+ mAddFrameButton->setEnabled(can_manipulate && isAddingFrameAllowed());
+ mDeleteFrameButton->setEnabled(can_manipulate && isRemovingFrameAllowed());
+ mLoadFrame->setEnabled(can_manipulate);
// update track buttons
bool extended_env = LLEnvironment::instance().isExtendedEnvironmentEnabled();
@@ -1322,6 +1347,12 @@ void LLFloaterEditExtDayCycle::updateSlider()
mFramesSlider->clear();
mSliderKeyMap.clear();
+ if (!mEditDay)
+ {
+ // floater is waiting for asset
+ return;
+ }
+
LLSettingsDay::CycleTrack_t track = mEditDay->getCycleTrack(mCurrentTrack);
for (auto &track_frame : track)
{
@@ -1368,7 +1399,7 @@ void LLFloaterEditExtDayCycle::updateTimeAndLabel()
// Update blender here:
}
-void LLFloaterEditExtDayCycle::addSliderFrame(const F32 frame, const LLSettingsBase::ptr_t &setting, bool update_ui)
+void LLFloaterEditExtDayCycle::addSliderFrame(F32 frame, const LLSettingsBase::ptr_t &setting, bool update_ui)
{
// multi slider distinguishes elements by key/name in string format
// store names to map to be able to recall dependencies
@@ -1408,6 +1439,19 @@ void LLFloaterEditExtDayCycle::removeCurrentSliderFrame()
updateTabs();
}
+void LLFloaterEditExtDayCycle::removeSliderFrame(F32 frame)
+{
+ keymap_t::iterator it = std::find_if(mSliderKeyMap.begin(), mSliderKeyMap.end(),
+ [frame](const keymap_t::value_type &value) { return fabs(value.second.mFrame - frame) < LLSettingsDay::DEFAULT_FRAME_SLOP_FACTOR; });
+
+ if (it != mSliderKeyMap.end())
+ {
+ mFramesSlider->deleteSlider((*it).first);
+ mSliderKeyMap.erase(it);
+ }
+
+}
+
//-------------------------------------------------------------------------
LLFloaterEditExtDayCycle::connection_t LLFloaterEditExtDayCycle::setEditCommitSignal(LLFloaterEditExtDayCycle::edit_commit_signal_t::slot_type cb)
@@ -1723,7 +1767,7 @@ bool LLFloaterEditExtDayCycle::isRemovingFrameAllowed()
bool LLFloaterEditExtDayCycle::isAddingFrameAllowed()
{
- if (!mFramesSlider->getCurSlider().empty()) return false;
+ if (!mFramesSlider->getCurSlider().empty() || !mEditDay) return false;
LLSettingsBase::Seconds frame(mTimeSlider->getCurSliderValue());
if ((mEditDay->getSettingsNearKeyframe(frame, mCurrentTrack, LLSettingsDay::DEFAULT_FRAME_SLOP_FACTOR)).second)
@@ -1997,18 +2041,20 @@ void LLFloaterEditExtDayCycle::onAssetLoadedForInsertion(LLUUID item_id, LLUUID
}
else
{
- // load single frame
-
- if ((mEditDay->getSettingsNearKeyframe(frame, dest_track, LLSettingsDay::DEFAULT_FRAME_SLOP_FACTOR)).second)
- {
- LL_WARNS("ENVDAYEDIT") << "Attempt to add new frame too close to existing frame." << LL_ENDL;
- return;
- }
if (!mFramesSlider->canAddSliders())
{
LL_WARNS("ENVDAYEDIT") << "Attempt to add new frame when slider is full." << LL_ENDL;
return;
}
+
+ // load or replace single frame
+ LLSettingsDay::CycleTrack_t::value_type nearest = mEditDay->getSettingsNearKeyframe(frame, dest_track, LLSettingsDay::DEFAULT_FRAME_SLOP_FACTOR);
+ if (nearest.first != LLSettingsDay::INVALID_TRACKPOS)
+ { // There is already a frame near the target location. Remove it so we can put the new one in its place.
+ mEditDay->removeTrackKeyframe(dest_track, nearest.first);
+ removeSliderFrame(nearest.first);
+ }
+
// Don't forget to clone (we might reuse/load it couple times)
if (settings->getSettingsType() == "sky")
{
@@ -2047,6 +2093,12 @@ void LLFloaterEditExtDayCycle::onAssetLoadedForInsertion(LLUUID item_id, LLUUID
return;
}
+ if (!mEditDay)
+ {
+ // day got reset while we were waiting for response
+ return;
+ }
+
LLInventoryItem *inv_item = gInventory.getItem(item_id);
if (inv_item && !inv_item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID()))
diff --git a/indra/newview/llfloatereditextdaycycle.h b/indra/newview/llfloatereditextdaycycle.h
index 311bbd52dc..c271f15840 100644
--- a/indra/newview/llfloatereditextdaycycle.h
+++ b/indra/newview/llfloatereditextdaycycle.h
@@ -144,8 +144,9 @@ private:
void updateLabels();
void updateSlider(); //generate sliders from current track
void updateTimeAndLabel();
- void addSliderFrame(const F32 frame, const LLSettingsBase::ptr_t &setting, bool update_ui = true);
- void removeCurrentSliderFrame();
+ void addSliderFrame(F32 frame, const LLSettingsBase::ptr_t &setting, bool update_ui = true);
+ void removeCurrentSliderFrame();
+ void removeSliderFrame(F32 frame);
void loadInventoryItem(const LLUUID &inventoryId);
void onAssetLoaded(LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status);
diff --git a/indra/newview/lltrackpicker.cpp b/indra/newview/lltrackpicker.cpp
index bc918f4bd7..fe6256a8a9 100644
--- a/indra/newview/lltrackpicker.cpp
+++ b/indra/newview/lltrackpicker.cpp
@@ -81,13 +81,21 @@ void LLFloaterTrackPicker::showPicker(const LLSD &args)
LLSD::array_const_iterator iter;
LLSD::array_const_iterator end = args.endArray();
+ bool select_item = true;
for (iter = args.beginArray(); iter != end; ++iter)
{
S32 track_id = (*iter)["id"].asInteger();
bool can_enable = (*iter)["enabled"].asBoolean();
- LLView *view = getChild<LLCheckBoxCtrl>(RDO_TRACK_PREFIX + llformat("%d", track_id), true);
+ LLCheckBoxCtrl *view = getChild<LLCheckBoxCtrl>(RDO_TRACK_PREFIX + llformat("%d", track_id), true);
view->setEnabled(can_enable);
view->setLabelArg("[ALT]", (*iter).has("altitude") ? ((*iter)["altitude"].asString() + "m") : " ");
+
+ // Mark first avaliable item as selected
+ if (can_enable && select_item)
+ {
+ select_item = false;
+ getChild<LLRadioGroup>(RDO_TRACK_SELECTION, true)->setSelectedByValue(LLSD(track_id), TRUE);
+ }
}
openFloater(getKey());
diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h
index 5be6b73cc4..b3aa48e39f 100644
--- a/indra/newview/pipeline.h
+++ b/indra/newview/pipeline.h
@@ -281,7 +281,8 @@ public:
void unbindDeferredShader(LLGLSLShader& shader);
void renderDeferredLighting(LLRenderTarget* light_target);
-
+ void postDeferredGammaCorrect(LLRenderTarget* screen_target);
+
void generateWaterReflection(LLCamera& camera);
void generateSunShadow(LLCamera& camera);
LLRenderTarget* getShadowTarget(U32 i);