From b660db7324387e2fcc55312e2c4f05897ca2c0eb Mon Sep 17 00:00:00 2001 From: Ansariel Date: Tue, 27 Aug 2019 19:21:05 +0200 Subject: [PATCH 01/14] Merge fix --- indra/newview/lltexturectrl.cpp | 59 ++------------------------------- 1 file changed, 2 insertions(+), 57 deletions(-) diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index e0ae8aaacb..ab7d1b26ed 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -438,63 +438,8 @@ BOOL LLFloaterTexturePicker::postBuild() // virtual void LLFloaterTexturePicker::draw() { - static const F32 CONTEXT_CONE_IN_ALPHA = 0.0f; - static const F32 CONTEXT_CONE_OUT_ALPHA = 1.f; - static const F32 CONTEXT_FADE_TIME = 0.08f; - - if (mOwner) - { - // draw cone of context pointing back to texture swatch - LLRect owner_rect; - mOwner->localRectToOtherView(mOwner->getLocalRect(), &owner_rect, this); - LLRect local_rect = getLocalRect(); - if (gFocusMgr.childHasKeyboardFocus(this) && mOwner->isInVisibleChain() && mContextConeOpacity > 0.001f) - { - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - LLGLEnable(GL_CULL_FACE); - gGL.begin(LLRender::QUADS); - { - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); - gGL.vertex2i(owner_rect.mLeft, owner_rect.mTop); - gGL.vertex2i(owner_rect.mRight, owner_rect.mTop); - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); - gGL.vertex2i(local_rect.mRight, local_rect.mTop); - gGL.vertex2i(local_rect.mLeft, local_rect.mTop); - - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); - gGL.vertex2i(local_rect.mLeft, local_rect.mTop); - gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); - gGL.vertex2i(owner_rect.mLeft, owner_rect.mBottom); - gGL.vertex2i(owner_rect.mLeft, owner_rect.mTop); - - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); - gGL.vertex2i(local_rect.mRight, local_rect.mBottom); - gGL.vertex2i(local_rect.mRight, local_rect.mTop); - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); - gGL.vertex2i(owner_rect.mRight, owner_rect.mTop); - gGL.vertex2i(owner_rect.mRight, owner_rect.mBottom); - - - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); - gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); - gGL.vertex2i(local_rect.mRight, local_rect.mBottom); - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); - gGL.vertex2i(owner_rect.mRight, owner_rect.mBottom); - gGL.vertex2i(owner_rect.mLeft, owner_rect.mBottom); - } - gGL.end(); - } - } - - if (gFocusMgr.childHasMouseCapture(getDragHandle())) - { - mContextConeOpacity = lerp(mContextConeOpacity, gSavedSettings.getF32("PickerContextOpacity"), LLSmoothInterpolation::getInterpolant(CONTEXT_FADE_TIME)); - } - else - { - mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLSmoothInterpolation::getInterpolant(CONTEXT_FADE_TIME)); - } + static LLCachedControl max_opacity(gSavedSettings, "PickerContextOpacity", 0.4f); + drawConeToOwner(mContextConeOpacity, max_opacity, mOwner); updateImageStats(); From ad26896a1086536cf47d3cb0041b0410aebf2119 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 27 Aug 2019 12:49:18 -0700 Subject: [PATCH 02/14] SL-11055 Remedy cloud_shadow and hack halving being done twice to ambient in some cases (i.e. artificial dimunition of necessary bullshit factor). --- indra/llinventory/llsettingsbase.h | 2 +- indra/llinventory/llsettingssky.cpp | 20 ++--------- indra/newview/llsettingsvo.cpp | 56 +++++++++++++---------------- indra/newview/llsettingsvo.h | 8 ++--- indra/newview/pipeline.cpp | 19 +++++----- 5 files changed, 41 insertions(+), 64 deletions(-) diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index 8b969d81a6..26e2901968 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -353,7 +353,7 @@ protected: virtual validation_list_t getValidationList() const = 0; // Apply any settings that need special handling. - virtual void applySpecial(void *) { }; + virtual void applySpecial(void *, bool force = false) { }; virtual parammapping_t getParameterMap() const { return parammapping_t(); } diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp index 9bbeb00efe..c4ce3af157 100644 --- a/indra/llinventory/llsettingssky.cpp +++ b/indra/llinventory/llsettingssky.cpp @@ -1326,26 +1326,13 @@ void LLSettingsSky::calculateLightSettings() const componentMultBy(sunlight, componentExp((light_atten * -1.f) * lighty)); componentMultBy(sunlight, light_transmittance); - //F32 max_color = llmax(sunlight.mV[0], sunlight.mV[1], sunlight.mV[2]); - //if (max_color > 1.0f) - //{ - // sunlight *= 1.0f/max_color; - //} - //increase ambient when there are more clouds LLColor3 tmpAmbient = ambient + (smear(1.f) - ambient) * cloud_shadow * 0.5; - componentMultBy(tmpAmbient, light_transmittance); - - //tmpAmbient = LLColor3::clamp(tmpAmbient, getGamma(), 1.0f); - //max_color = llmax(tmpAmbient.mV[0], tmpAmbient.mV[1], tmpAmbient.mV[2]); - //if (max_color > 1.0f) - //{ - // tmpAmbient *= 1.0f/max_color; - //} //brightness of surface both sunlight and ambient mSunDiffuse = sunlight; mSunAmbient = tmpAmbient; + F32 haze_horizon = getHazeHorizon(); sunlight *= 1.0 - cloud_shadow; @@ -1360,12 +1347,11 @@ void LLSettingsSky::calculateLightSettings() const LLColor3 moonlight_b(0.66, 0.66, 1.2); // scotopic ambient value componentMultBy(moonlight, componentExp((light_atten * -1.f) * lighty)); - //clampColor(moonlight, getGamma(), 1.0f); mMoonDiffuse = componentMult(moonlight, light_transmittance) * moon_brightness; - mMoonAmbient = componentMult(moonlight_b, light_transmittance) * 0.0125f; + mMoonAmbient = moonlight_b * 0.0125f; - mTotalAmbient = mSunAmbient; + mTotalAmbient = ambient; } LLUUID LLSettingsSky::GetDefaultAssetId() diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp index 11bb732be8..bbee94287d 100644 --- a/indra/newview/llsettingsvo.cpp +++ b/indra/newview/llsettingsvo.cpp @@ -663,7 +663,7 @@ void LLSettingsVOSky::updateSettings() gSky.setMoonScale(getMoonScale()); } -void LLSettingsVOSky::applySpecial(void *ptarget) +void LLSettingsVOSky::applySpecial(void *ptarget, bool force) { LLGLSLShader *shader = (LLGLSLShader *)ptarget; @@ -671,46 +671,38 @@ void LLSettingsVOSky::applySpecial(void *ptarget) if (shader->mShaderGroup == LLGLSLShader::SG_DEFAULT) { - shader->uniform4fv(LLViewerShaderMgr::LIGHTNORM, 1, light_direction.mV); - shader->uniform3fv(LLShaderMgr::WL_CAMPOSLOCAL, 1, LLViewerCamera::getInstance()->getOrigin().mV); + shader->uniform4fv(LLViewerShaderMgr::LIGHTNORM, 1, light_direction.mV); + shader->uniform3fv(LLShaderMgr::WL_CAMPOSLOCAL, 1, LLViewerCamera::getInstance()->getOrigin().mV); } else if (shader->mShaderGroup == LLGLSLShader::SG_SKY) { - shader->uniform4fv(LLViewerShaderMgr::LIGHTNORM, 1, light_direction.mV); + shader->uniform4fv(LLViewerShaderMgr::LIGHTNORM, 1, light_direction.mV); - 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); + 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(); + LLSettingsSky::ptr_t psky = LLEnvironment::instance().getCurrentSky(); - LLColor4 sunDiffuse = psky->getSunlightColor(); - LLColor4 moonDiffuse = psky->getMoonlightColor(); + LLColor4 sunDiffuse = psky->getSunlightColor(); + LLColor4 moonDiffuse = psky->getMoonlightColor(); - 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(); + shader->uniform4fv(LLShaderMgr::SUNLIGHT_COLOR, 1, sunDiffuse.mV); + shader->uniform4fv(LLShaderMgr::MOONLIGHT_COLOR, 1, moonDiffuse.mV); - 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); - - LLColor4 cloud_color(psky->getCloudColor(), 1.0); - shader->uniform4fv(LLShaderMgr::CLOUD_COLOR, 1, cloud_color.mV); + LLColor4 cloud_color(psky->getCloudColor(), 1.0); + shader->uniform4fv(LLShaderMgr::CLOUD_COLOR, 1, cloud_color.mV); } - - shader->uniform1f(LLShaderMgr::SCENE_LIGHT_STRENGTH, mSceneLightStrength); + + LLColor4 ambient(getTotalAmbient()); + shader->uniform4fv(LLShaderMgr::AMBIENT, 1, ambient.mV); + + shader->uniform1i(LLShaderMgr::SUN_UP_FACTOR, getIsSunUp() ? 1 : 0); + shader->uniform1f(LLShaderMgr::SUN_MOON_GLOW_FACTOR, getSunMoonGlowFactor()); + shader->uniform1f(LLShaderMgr::DENSITY_MULTIPLIER, getDensityMultiplier()); + shader->uniform1f(LLShaderMgr::DISTANCE_MULTIPLIER, getDistanceMultiplier()); F32 g = getGamma(); F32 display_gamma = gSavedSettings.getF32("RenderDeferredDisplayGamma"); @@ -904,13 +896,13 @@ LLSD LLSettingsVOWater::convertToLegacy(const LLSettingsWater::ptr_t &pwater) } //------------------------------------------------------------------------- //------------------------------------------------------------------------- -void LLSettingsVOWater::applySpecial(void *ptarget) +void LLSettingsVOWater::applySpecial(void *ptarget, bool force) { LLGLSLShader *shader = (LLGLSLShader *)ptarget; LLEnvironment& env = LLEnvironment::instance(); - if (shader->mShaderGroup == LLGLSLShader::SG_WATER) + if (force || (shader->mShaderGroup == LLGLSLShader::SG_WATER)) { F32 water_height = env.getWaterHeight(); diff --git a/indra/newview/llsettingsvo.h b/indra/newview/llsettingsvo.h index 6f105c9d61..1f29013ecf 100644 --- a/indra/newview/llsettingsvo.h +++ b/indra/newview/llsettingsvo.h @@ -102,7 +102,7 @@ public: bool isAdvanced() const { return m_isAdvanced; } - virtual void updateShader(LLGLSLShader* shader) { applySpecial(shader); } + virtual void updateShader(LLGLSLShader* shader) { applySpecial(shader, true); } protected: LLSettingsVOSky(); @@ -112,7 +112,7 @@ protected: virtual void updateSettings() override; - virtual void applySpecial(void *) override; + virtual void applySpecial(void *, bool) override; virtual parammapping_t getParameterMap() const override; @@ -136,13 +136,13 @@ public: static LLSD convertToLegacy(const ptr_t &); - virtual void updateShader(LLGLSLShader* shader) { applySpecial(shader); } + virtual void updateShader(LLGLSLShader* shader) { applySpecial(shader, true); } protected: LLSettingsVOWater(); virtual void updateSettings() override; - virtual void applySpecial(void *) override; + virtual void applySpecial(void *, bool) override; virtual parammapping_t getParameterMap() const override; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 7048b921b0..33847b097b 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -116,6 +116,7 @@ #include "llcleanup.h" #include "llenvironment.h" +#include "llsettingsvo.h" #ifdef _DEBUG // Debug indices is disabled for now for debug performance - djs 4/24/02 @@ -8424,21 +8425,19 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, LLRenderTarget* light_ shader.uniform1f(LLShaderMgr::DEFERRED_DEPTH_CUTOFF, RenderEdgeDepthCutoff); shader.uniform1f(LLShaderMgr::DEFERRED_NORM_CUTOFF, RenderEdgeNormCutoff); - shader.uniform4fv(LLShaderMgr::SUNLIGHT_COLOR, 1, mSunDiffuse.mV); - shader.uniform4fv(LLShaderMgr::MOONLIGHT_COLOR, 1, mMoonDiffuse.mV); - - - LLEnvironment& environment = LLEnvironment::instance(); - LLColor4 ambient(environment.getCurrentSky()->getTotalAmbient()); - shader.uniform4fv(LLShaderMgr::AMBIENT, 1, ambient.mV); - shader.uniform1i(LLShaderMgr::SUN_UP_FACTOR, environment.getIsSunUp() ? 1 : 0); - shader.uniform1f(LLShaderMgr::SUN_MOON_GLOW_FACTOR, environment.getCurrentSky()->getSunMoonGlowFactor()); - if (shader.getUniformLocation(LLShaderMgr::DEFERRED_NORM_MATRIX) >= 0) { glh::matrix4f norm_mat = get_current_modelview().inverse().transpose(); shader.uniformMatrix4fv(LLShaderMgr::DEFERRED_NORM_MATRIX, 1, FALSE, norm_mat.m); } + + shader.uniform4fv(LLShaderMgr::SUNLIGHT_COLOR, 1, mSunDiffuse.mV); + shader.uniform4fv(LLShaderMgr::MOONLIGHT_COLOR, 1, mMoonDiffuse.mV); + + LLEnvironment& environment = LLEnvironment::instance(); + LLSettingsSky::ptr_t sky = environment.getCurrentSky(); + + static_cast(sky.get())->updateShader(&shader); } LLColor3 pow3f(LLColor3 v, F32 f) From 24537889fb444315b4074195f25d91919fbea36f Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 27 Aug 2019 13:05:04 -0700 Subject: [PATCH 03/14] SL-11550 Restore mul by light_transmittance in CPU version of atmospherics. --- indra/newview/lllegacyatmospherics.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/newview/lllegacyatmospherics.cpp b/indra/newview/lllegacyatmospherics.cpp index a1093df7e1..13d5eb96c4 100644 --- a/indra/newview/lllegacyatmospherics.cpp +++ b/indra/newview/lllegacyatmospherics.cpp @@ -329,7 +329,7 @@ void LLAtmospherics::calcSkyColorWLVert(LLVector3 & Pn, AtmosphericsVars& vars) temp2.mV[1] = 1.f / temp2.mV[1]; componentMultBy(sunlight, componentExp((light_atten * -1.f) * temp2.mV[1])); - //componentMultBy(sunlight, light_transmittance); + componentMultBy(sunlight, light_transmittance); // Distance temp2.mV[2] = Plen * density_multiplier; @@ -445,8 +445,8 @@ void LLAtmospherics::updateFog(const F32 distance, const LLVector3& tosun_in) vars.distance_multiplier = psky->getDistanceMultiplier(); vars.max_y = psky->getMaxY(); vars.sun_norm = LLEnvironment::instance().getSunDirectionCFR(); - vars.sunlight = psky->getSunlightColorClamped(); - vars.ambient = psky->getAmbientColorClamped(); + vars.sunlight = psky->getSunlightColor(); + vars.ambient = psky->getAmbientColor(); vars.glow = psky->getGlow(); vars.cloud_shadow = psky->getCloudShadow(); vars.dome_radius = psky->getDomeRadius(); From e2a84c9d105b90836cb85aa03a16f36f77604cb0 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 27 Aug 2019 13:17:26 -0700 Subject: [PATCH 04/14] SL-11519 Remove code for fixing 11370. We *do* want objects in distortion map in Low-Mid after all. --- indra/newview/pipeline.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 33847b097b..99d11b7104 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -9495,14 +9495,6 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) clip_plane.disable(); } - // SL-11370 prevent Low/Low-Mid graphics from rendering distortion map contents it should not - if (!canUseWindLightShaders()) - { - clearRenderTypeMask(LLPipeline::RENDER_TYPE_PARTICLES, END_RENDER_TYPES); - clearRenderTypeMask(LLPipeline::RENDER_TYPE_AVATAR, END_RENDER_TYPES); - clearRenderTypeMask(LLPipeline::RENDER_TYPE_VOLUME, END_RENDER_TYPES); - } - updateCull(camera, mRefractedObjects, water_clip, &plane); stateSort(camera, mRefractedObjects); renderGeom(camera); From e5879090a72cfb3139b6c6734f4a823ef54dfbf4 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Wed, 28 Aug 2019 11:17:01 +0300 Subject: [PATCH 05/14] SL-11795 Rename Load/Clone/Clear buttons --- .../default/xui/en/floater_edit_ext_day_cycle.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml b/indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml index 4332e0565b..18ab69bd5e 100644 --- a/indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml +++ b/indra/newview/skins/default/xui/en/floater_edit_ext_day_cycle.xml @@ -287,24 +287,24 @@