From 89d1bf39c5722be83924a7bb50409bf53c8a0600 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 5 Feb 2020 16:16:39 +0200 Subject: [PATCH 01/19] SL-4354 Not loaded avatars should stay cloud longer --- indra/newview/llvoavatar.cpp | 95 ++++++++++++++++++++++++++++-------- indra/newview/llvoavatar.h | 4 +- 2 files changed, 79 insertions(+), 20 deletions(-) diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index c7b35a9880..7bd0dfcfb3 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -197,6 +197,8 @@ const F32 NAMETAG_VERT_OFFSET_WEIGHT = 0.17f; const U32 LLVOAvatar::VISUAL_COMPLEXITY_UNKNOWN = 0; const F64 HUD_OVERSIZED_TEXTURE_DATA_SIZE = 1024 * 1024; +const F32 MAX_TEXTURE_WAIT_TIME_SEC = 60; + enum ERenderName { RENDER_NAME_NEVER, @@ -663,6 +665,7 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mFullyLoadedInitialized(FALSE), mVisualComplexity(VISUAL_COMPLEXITY_UNKNOWN), mLoadedCallbacksPaused(FALSE), + mLoadedCallbackTextures(0), mRenderUnloadedAvatar(LLCachedControl(gSavedSettings, "RenderUnloadedAvatar", false)), mLastRezzedStatus(-1), mIsEditingAppearance(FALSE), @@ -883,8 +886,9 @@ BOOL LLVOAvatar::hasGray() const S32 LLVOAvatar::getRezzedStatus() const { if (getIsCloud()) return 0; - if (isFullyTextured() && allBakedTexturesCompletelyDownloaded()) return 3; - if (isFullyTextured()) return 2; + bool textured = isFullyTextured(); + if (textured && allBakedTexturesCompletelyDownloaded()) return 3; + if (textured) return 2; llassert(hasGray()); return 1; // gray } @@ -5329,12 +5333,28 @@ void LLVOAvatar::checkTextureLoading() } if(mLoadedCallbacksPaused == pause) { + if (!pause && mFirstFullyVisible && mLoadedCallbackTextures < mCallbackTextureList.size()) + { + // We still need to update 'loaded' textures count to decide on 'cloud' visibility + // Alternatively this can be done on TextureLoaded callbacks, but is harder to properly track + mLoadedCallbackTextures = 0; + for (LLLoadedCallbackEntry::source_callback_list_t::iterator iter = mCallbackTextureList.begin(); + iter != mCallbackTextureList.end(); ++iter) + { + LLViewerFetchedTexture* tex = gTextureList.findImage(*iter); + if (tex && (tex->getDiscardLevel() >= 0 || tex->isMissingAsset())) + { + mLoadedCallbackTextures++; + } + } + } return ; } if(mCallbackTextureList.empty()) //when is self or no callbacks. Note: this list for self is always empty. { mLoadedCallbacksPaused = pause ; + mLoadedCallbackTextures = 0; return ; //nothing to check. } @@ -5342,7 +5362,9 @@ void LLVOAvatar::checkTextureLoading() { return ; //have not been invisible for enough time. } - + + mLoadedCallbackTextures = pause ? mCallbackTextureList.size() : 0; + for(LLLoadedCallbackEntry::source_callback_list_t::iterator iter = mCallbackTextureList.begin(); iter != mCallbackTextureList.end(); ++iter) { @@ -5363,9 +5385,15 @@ void LLVOAvatar::checkTextureLoading() tex->unpauseLoadedCallbacks(&mCallbackTextureList) ; tex->addTextureStats(START_AREA); //jump start the fetching again + + // technically shouldn't need to account for missing, but callback might not have happened yet + if (tex->getDiscardLevel() >= 0 || tex->isMissingAsset()) + { + mLoadedCallbackTextures++; // consider it loaded (we have at least some data) + } } - } - } + } + } if(!pause) { @@ -7629,14 +7657,13 @@ bool LLVOAvatar::getIsCloud() const ); } -void LLVOAvatar::updateRezzedStatusTimers() +void LLVOAvatar::updateRezzedStatusTimers(S32 rez_status) { // State machine for rezzed status. Statuses are -1 on startup, 0 // = cloud, 1 = gray, 2 = downloading, 3 = full. // Purpose is to collect time data for each it takes avatar to reach // various loading landmarks: gray, textured (partial), textured fully. - S32 rez_status = getRezzedStatus(); if (rez_status != mLastRezzedStatus) { LL_DEBUGS("Avatar") << avString() << "rez state change: " << mLastRezzedStatus << " -> " << rez_status << LL_ENDL; @@ -7806,8 +7833,21 @@ void LLVOAvatar::logMetricsTimerRecord(const std::string& phase_name, F32 elapse // returns true if the value has changed. BOOL LLVOAvatar::updateIsFullyLoaded() { - const bool loading = getIsCloud(); - updateRezzedStatusTimers(); + S32 rez_status = getRezzedStatus(); + bool loading = getIsCloud(); + if (mFirstFullyVisible && !mIsControlAvatar) + { + loading = ((rez_status < 2) + // Wait at least 60s for unfinished textures to finish on first load, + // don't wait forever, it might fail. Even if it will eventually load by + // itself and update mLoadedCallbackTextures (or fail and clean the list), + // avatars are more time-sensitive than textures and can't wait that long. + || (mLoadedCallbackTextures < mCallbackTextureList.size() && mLastTexCallbackAddedTime.getElapsedTimeF32() < MAX_TEXTURE_WAIT_TIME_SEC) + || !mPendingAttachment.empty() + || (rez_status < 3 && !isFullyBaked()) + ); + } + updateRezzedStatusTimers(rez_status); updateRuthTimer(loading); return processFullyLoadedChange(loading); } @@ -7843,13 +7883,22 @@ void LLVOAvatar::updateRuthTimer(bool loading) BOOL LLVOAvatar::processFullyLoadedChange(bool loading) { - // we wait a little bit before giving the all clear, - // to let textures settle down - const F32 PAUSE = 1.f; + // We wait a little bit before giving the 'all clear', to let things to + // settle down (models to snap into place, textures to get first packets) + const F32 LOADED_DELAY = 1.f; + const F32 FIRST_USE_DELAY = 3.f; + if (loading) mFullyLoadedTimer.reset(); - - mFullyLoaded = (mFullyLoadedTimer.getElapsedTimeF32() > PAUSE); + + if (mFirstFullyVisible) + { + mFullyLoaded = (mFullyLoadedTimer.getElapsedTimeF32() > FIRST_USE_DELAY); + } + else + { + mFullyLoaded = (mFullyLoadedTimer.getElapsedTimeF32() > LOADED_DELAY); + } if (!mPreviousFullyLoaded && !loading && mFullyLoaded) { @@ -8139,6 +8188,7 @@ void LLVOAvatar::updateMeshTextures() LLViewerTexLayerSet* layerset = getTexLayerSet(i); if (use_lkg_baked_layer[i] && !isUsingLocalAppearance() ) { + // use last known good layer (no new one) LLViewerFetchedTexture* baked_img = LLViewerTextureManager::getFetchedTexture(mBakedTextureDatas[i].mLastTextureID); mBakedTextureDatas[i].mIsUsed = TRUE; @@ -8157,6 +8207,7 @@ void LLVOAvatar::updateMeshTextures() } else if (!isUsingLocalAppearance() && is_layer_baked[i]) { + // use new layer LLViewerFetchedTexture* baked_img = LLViewerTextureManager::staticCastToFetchedTexture( getImage( mBakedTextureDatas[i].mTextureIndex, 0 ), TRUE) ; @@ -8176,10 +8227,15 @@ void LLVOAvatar::updateMeshTextures() ((i == BAKED_HEAD) || (i == BAKED_UPPER) || (i == BAKED_LOWER)) ) { baked_img->setLoadedCallback(onBakedTextureMasksLoaded, MORPH_MASK_REQUESTED_DISCARD, TRUE, TRUE, new LLTextureMaskData( mID ), - src_callback_list, paused); + src_callback_list, paused); } baked_img->setLoadedCallback(onBakedTextureLoaded, SWITCH_TO_BAKED_DISCARD, FALSE, FALSE, new LLUUID( mID ), src_callback_list, paused ); + if (baked_img->getDiscardLevel() < 0 && !paused) + { + // mLoadedCallbackTextures will be updated by checkTextureLoading() below + mLastTexCallbackAddedTime.reset(); + } // this could add paused texture callbacks mLoadedCallbacksPaused |= paused; @@ -8573,13 +8629,16 @@ void LLVOAvatar::onFirstTEMessageReceived() LL_DEBUGS("Avatar") << avString() << "layer_baked, setting onInitialBakedTextureLoaded as callback" << LL_ENDL; image->setLoadedCallback( onInitialBakedTextureLoaded, MAX_DISCARD_LEVEL, FALSE, FALSE, new LLUUID( mID ), src_callback_list, paused ); - + if (image->getDiscardLevel() < 0 && !paused) + { + mLastTexCallbackAddedTime.reset(); + } // this could add paused texture callbacks mLoadedCallbacksPaused |= paused; } } - mMeshTexturesDirty = TRUE; + mMeshTexturesDirty = TRUE; gPipeline.markGLRebuild(this); } } @@ -9226,8 +9285,6 @@ void LLVOAvatar::onBakedTextureMasksLoaded( BOOL success, LLViewerFetchedTexture // static void LLVOAvatar::onInitialBakedTextureLoaded( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata ) { - - LLUUID *avatar_idp = (LLUUID *)userdata; LLVOAvatar *selfp = (LLVOAvatar *)gObjectList.findObject(*avatar_idp); diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 00dccc5d12..ca6ac5c902 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -348,7 +348,7 @@ public: BOOL isFullyTextured() const; BOOL hasGray() const; S32 getRezzedStatus() const; // 0 = cloud, 1 = gray, 2 = textured, 3 = textured and fully downloaded. - void updateRezzedStatusTimers(); + void updateRezzedStatusTimers(S32 status); S32 mLastRezzedStatus; @@ -629,6 +629,8 @@ protected: LLLoadedCallbackEntry::source_callback_list_t mCallbackTextureList ; BOOL mLoadedCallbacksPaused; + S32 mLoadedCallbackTextures; // count of 'loaded' baked textures, filled from mCallbackTextureList + LLFrameTimer mLastTexCallbackAddedTime; std::set mTextureIDs; //-------------------------------------------------------------------- // Local Textures From 50c05006e7ad28c05cbaa1af568d3287028ee1d0 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 11 Feb 2020 19:57:29 +0200 Subject: [PATCH 02/19] SL-11932 Updated VVM --- autobuild.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index 1f1db48bdc..d760135b9b 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -3138,9 +3138,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - c5ab9d9d7482e48cd76f4bf391900a8c + 483573e5612e53b6cf8053263e4aef1f url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/43369/385585/viewer_manager-2.0.531000-darwin64-531000.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/51747/471753/viewer_manager-2.0.536513-darwin64-536513.tar.bz2 name darwin64 @@ -3162,9 +3162,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 6b10d7407686d9e12e63576256581e3e + 5abe48eb6152bdb37809261bbf16484f url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/43370/385592/viewer_manager-2.0.531000-windows-531000.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/51750/471771/viewer_manager-2.0.536513-windows-536513.tar.bz2 name windows @@ -3175,7 +3175,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors source_type hg version - 2.0.531000 + 2.0.536513 vlc-bin From 8644aa1f81cc469d34636566b9272a2e6cf2b6a4 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 11 Feb 2020 21:37:03 +0200 Subject: [PATCH 03/19] SL-11932 Updated VVM #2 Previous update handled case of user terminating updater on 'precheck', new one works for updater termination on 'leap' --- autobuild.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index d760135b9b..241fba44fd 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -3138,9 +3138,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 483573e5612e53b6cf8053263e4aef1f + 328194f93a69d21293f3805fd1ff49a4 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/51747/471753/viewer_manager-2.0.536513-darwin64-536513.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/51767/471864/viewer_manager-2.0.536528-darwin64-536528.tar.bz2 name darwin64 @@ -3162,9 +3162,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 5abe48eb6152bdb37809261bbf16484f + 200249d92112cd248e95f79c02c1dc10 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/51750/471771/viewer_manager-2.0.536513-windows-536513.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/51766/471870/viewer_manager-2.0.536528-windows-536528.tar.bz2 name windows @@ -3175,7 +3175,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors source_type hg version - 2.0.536513 + 2.0.536528 vlc-bin From fbabec1ceb2eaf44d2b20def87c632e14a664ad6 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 12 Feb 2020 14:52:07 +0200 Subject: [PATCH 04/19] SL-12616 Updated VVM Cancelable updates should not be installed if user quit without confirmation, ask again later --- autobuild.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index 241fba44fd..572d9b91da 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -3138,9 +3138,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 328194f93a69d21293f3805fd1ff49a4 + 9bb4879c1567fe9e86da7c36fdd31710 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/51767/471864/viewer_manager-2.0.536528-darwin64-536528.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/51810/472478/viewer_manager-2.0.536567-darwin64-536567.tar.bz2 name darwin64 @@ -3162,9 +3162,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 200249d92112cd248e95f79c02c1dc10 + c1d113934b8233e57c7d1b6fe1168a60 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/51766/471870/viewer_manager-2.0.536528-windows-536528.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/51811/472487/viewer_manager-2.0.536567-windows-536567.tar.bz2 name windows @@ -3175,7 +3175,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors source_type hg version - 2.0.536528 + 2.0.536567 vlc-bin From 88ae7dcb29e289631623c753366019a1a4d3a4d9 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 12 Feb 2020 14:52:07 +0200 Subject: [PATCH 05/19] SL-12678 Remove automatic retry of login --- indra/newview/lllogininstance.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index 8a69acb8dc..b7c15b3a99 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -62,7 +62,7 @@ #include #include -const S32 LOGIN_MAX_RETRIES = 3; +const S32 LOGIN_MAX_RETRIES = 1; // Viewer should not autmatically retry login const F32 LOGIN_SRV_TIMEOUT_MIN = 10; const F32 LOGIN_SRV_TIMEOUT_MAX = 120; const F32 LOGIN_DNS_TIMEOUT_FACTOR = 0.9; // make DNS wait shorter then retry time From 961f826feeb3c9619ed142a9a33f74138d300bcd Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 17 Feb 2020 16:06:43 +0200 Subject: [PATCH 06/19] SL-12198 Updated VVM - fixed .done file removal --- autobuild.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index 572d9b91da..da48e1f2cd 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -3138,9 +3138,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 9bb4879c1567fe9e86da7c36fdd31710 + 83531885d69b0e675fcbe01b41562dfc url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/51810/472478/viewer_manager-2.0.536567-darwin64-536567.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/52052/476443/viewer_manager-2.0.536777-darwin64-536777.tar.bz2 name darwin64 @@ -3162,9 +3162,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - c1d113934b8233e57c7d1b6fe1168a60 + 2e78e51c99afbf0cdaa7206d87711122 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/51811/472487/viewer_manager-2.0.536567-windows-536567.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/52051/476449/viewer_manager-2.0.536777-windows-536777.tar.bz2 name windows @@ -3175,7 +3175,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors source_type hg version - 2.0.536567 + 2.0.536777 vlc-bin From c5371bb2715325aa6d705a2fc9973510675e5e59 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 21 Feb 2020 18:51:14 +0200 Subject: [PATCH 07/19] SL-12732 Lights not working in some cases --- indra/newview/pipeline.cpp | 37 ++++++++++++++++--------------------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index bec33790bd..dcf435f78f 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -8684,29 +8684,24 @@ void LLPipeline::renderDeferredLighting() } } - const LLViewerObject *vobj = drawablep->getVObj(); - if (vobj) - { - LLVOAvatar *av = vobj->getAvatar(); - if (av) - { - if (av->isTooComplex() || av->isInMuteList() || dist_vec(av->getPosition(), LLViewerCamera::getInstance()->getOrigin()) > RenderFarClip) - { - continue; - } - } - else - { - const LLViewerObject *root_obj = drawablep->getParent() ? drawablep->getParent()->getVObj() : vobj; - if (root_obj && dist_vec(root_obj->getPosition(), LLViewerCamera::getInstance()->getOrigin()) > RenderFarClip) - { - continue; - } - } - } + const LLViewerObject *vobj = drawablep->getVObj(); + if (vobj) + { + LLVOAvatar *av = vobj->getAvatar(); + if (av && (av->isTooComplex() || av->isInMuteList())) + { + continue; + } + } + + const LLVector3 position = drawablep->getPositionAgent(); + if (dist_vec(position, LLViewerCamera::getInstance()->getOrigin()) > RenderFarClip + volume->getLightRadius()) + { + continue; + } LLVector4a center; - center.load3(drawablep->getPositionAgent().mV); + center.load3(position.mV); const F32* c = center.getF32ptr(); F32 s = volume->getLightRadius()*1.5f; From bfcb558f90d1b3108893cfcd3cc07325c47486b6 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 21 Feb 2020 23:38:39 +0200 Subject: [PATCH 08/19] SL-12678 Remove automatic retry of login --- indra/newview/lllogininstance.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index b7c15b3a99..873531ef22 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -62,7 +62,7 @@ #include #include -const S32 LOGIN_MAX_RETRIES = 1; // Viewer should not autmatically retry login +const S32 LOGIN_MAX_RETRIES = 0; // Viewer should not autmatically retry login const F32 LOGIN_SRV_TIMEOUT_MIN = 10; const F32 LOGIN_SRV_TIMEOUT_MAX = 120; const F32 LOGIN_DNS_TIMEOUT_FACTOR = 0.9; // make DNS wait shorter then retry time From 4b62779fd3379561e97fe283ffd1c80d27703e86 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 4 Mar 2020 14:58:55 +0200 Subject: [PATCH 09/19] SL-12562 Change events URL --- indra/newview/app_settings/settings.xml | 2 +- indra/newview/llfloaterevent.cpp | 2 +- indra/newview/skins/default/xui/en/menu_viewer.xml | 2 +- indra/newview/skins/default/xui/en/notifications.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index da1e87fda4..b8bc4fe0b9 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -3775,7 +3775,7 @@ Type String Value - http://events.secondlife.com/viewer/embed/event/ + https://secondlife.com/my/community/events/event.php?id= FastCacheFetchEnabled diff --git a/indra/newview/llfloaterevent.cpp b/indra/newview/llfloaterevent.cpp index 3e303e0932..a6640cc073 100644 --- a/indra/newview/llfloaterevent.cpp +++ b/indra/newview/llfloaterevent.cpp @@ -110,7 +110,7 @@ void LLFloaterEvent::setEventID(const U32 event_id) // get the search URL and expand all of the substitutions // (also adds things like [LANGUAGE], [VERSION], [OS], etc.) std::ostringstream url; - url << gSavedSettings.getString("EventURL") << event_id << "/" << std::endl; + url << gSavedSettings.getString("EventURL") << event_id << std::endl; // and load the URL in the web view mBrowser->navigateTo(url.str()); diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 04b5d808ec..6284fe9a4d 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -461,7 +461,7 @@ name="Events"> + parameter="https://secondlife.com/my/community/events"/> confirm - http://secondlife.com/events/ + https://secondlife.com/my/community/events Date: Fri, 6 Mar 2020 22:40:35 +0200 Subject: [PATCH 10/19] Removed SL-12198 --- autobuild.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index da48e1f2cd..7ca381fa1e 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -3138,9 +3138,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 83531885d69b0e675fcbe01b41562dfc + f8365276c376bb36c1ce64922958e6dc url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/52052/476443/viewer_manager-2.0.536777-darwin64-536777.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/53696/497390/viewer_manager-2.0.538124-darwin64-538124.tar.bz2 name darwin64 @@ -3162,9 +3162,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 2e78e51c99afbf0cdaa7206d87711122 + 196109ded219a66920d1abf671a2035d url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/52051/476449/viewer_manager-2.0.536777-windows-536777.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/53700/497404/viewer_manager-2.0.538124-windows-538124.tar.bz2 name windows @@ -3175,7 +3175,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors source_type hg version - 2.0.536777 + 2.0.538124 vlc-bin From 921b133bd566f80d7cb22c0280d79bcbd3b05f21 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 10 Mar 2020 13:56:11 +0200 Subject: [PATCH 11/19] Rolling back version manager changes until migration to git completes --- autobuild.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index 7ca381fa1e..1f1db48bdc 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -3138,9 +3138,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - f8365276c376bb36c1ce64922958e6dc + c5ab9d9d7482e48cd76f4bf391900a8c url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/53696/497390/viewer_manager-2.0.538124-darwin64-538124.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/43369/385585/viewer_manager-2.0.531000-darwin64-531000.tar.bz2 name darwin64 @@ -3162,9 +3162,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 196109ded219a66920d1abf671a2035d + 6b10d7407686d9e12e63576256581e3e url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/53700/497404/viewer_manager-2.0.538124-windows-538124.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/43370/385592/viewer_manager-2.0.531000-windows-531000.tar.bz2 name windows @@ -3175,7 +3175,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors source_type hg version - 2.0.538124 + 2.0.531000 vlc-bin From 24c38d822acfe37f177900014258c89cc1c237f0 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 11 Mar 2020 16:48:22 +0200 Subject: [PATCH 12/19] SL-12562 Reverted change to 'embed' link --- indra/newview/app_settings/settings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index b8bc4fe0b9..da1e87fda4 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -3775,7 +3775,7 @@ Type String Value - https://secondlife.com/my/community/events/event.php?id= + http://events.secondlife.com/viewer/embed/event/ FastCacheFetchEnabled From 7d992f2331c36e660dc167cb874bb7410efd8cb1 Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Mon, 6 Apr 2020 20:57:33 +0300 Subject: [PATCH 13/19] SL-10993 Fixed Korean font on OSX Catalina --- indra/newview/skins/default/xui/en/fonts.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/skins/default/xui/en/fonts.xml b/indra/newview/skins/default/xui/en/fonts.xml index 2d5263b78f..76df0abdfd 100644 --- a/indra/newview/skins/default/xui/en/fonts.xml +++ b/indra/newview/skins/default/xui/en/fonts.xml @@ -21,6 +21,7 @@ AppleGothic.dfont AppleGothic.ttf AppleSDGothicNeo-Regular.otf + AppleSDGothicNeo.ttc 华文细黑.ttf PingFang.ttc STIXGeneral.otf From 73733b29803c89181f9c719b3010eae05c605bff Mon Sep 17 00:00:00 2001 From: Ansariel Date: Fri, 10 Apr 2020 15:23:18 +0200 Subject: [PATCH 14/19] Sync font definitions with upstream version --- indra/newview/fonts/fonts.xml | 4 +--- indra/newview/fonts/fonts_celestia_medium_redux.xml | 4 +--- indra/newview/fonts/fonts_deja_vu_all_caps.xml | 4 +--- indra/newview/fonts/fonts_droid.xml | 4 +--- indra/newview/fonts/fonts_dyslexia.xml | 4 +--- indra/newview/fonts/fonts_liberation.xml | 4 +--- indra/newview/fonts/fonts_mobi.xml | 4 +--- indra/newview/fonts/fonts_noto.xml | 4 +--- indra/newview/fonts/fonts_roboto.xml | 4 +--- indra/newview/fonts/fonts_ubuntu.xml | 4 +--- 10 files changed, 10 insertions(+), 30 deletions(-) diff --git a/indra/newview/fonts/fonts.xml b/indra/newview/fonts/fonts.xml index 4a478c39f6..3e7eff4d4f 100644 --- a/indra/newview/fonts/fonts.xml +++ b/indra/newview/fonts/fonts.xml @@ -22,12 +22,10 @@ ヒラギノ角ゴ Pro W3.otf ヒラギノ角ゴ ProN W3.otf ヒラギノ明朝 ProN W3.ttc - - AppleSDGothicNeo.ttc - AppleGothic.dfont AppleGothic.ttf AppleSDGothicNeo-Regular.otf + AppleSDGothicNeo.ttc 华文细黑.ttf PingFang.ttc STIXGeneral.otf diff --git a/indra/newview/fonts/fonts_celestia_medium_redux.xml b/indra/newview/fonts/fonts_celestia_medium_redux.xml index 637a77b9ea..4196fbc6a0 100644 --- a/indra/newview/fonts/fonts_celestia_medium_redux.xml +++ b/indra/newview/fonts/fonts_celestia_medium_redux.xml @@ -22,12 +22,10 @@ ヒラギノ角ゴ Pro W3.otf ヒラギノ角ゴ ProN W3.otf ヒラギノ明朝 ProN W3.ttc - - AppleSDGothicNeo.ttc - AppleGothic.dfont AppleGothic.ttf AppleSDGothicNeo-Regular.otf + AppleSDGothicNeo.ttc 华文细黑.ttf PingFang.ttc STIXGeneral.otf diff --git a/indra/newview/fonts/fonts_deja_vu_all_caps.xml b/indra/newview/fonts/fonts_deja_vu_all_caps.xml index 3a52ece0ff..3210a539a4 100644 --- a/indra/newview/fonts/fonts_deja_vu_all_caps.xml +++ b/indra/newview/fonts/fonts_deja_vu_all_caps.xml @@ -22,12 +22,10 @@ ヒラギノ角ゴ Pro W3.otf ヒラギノ角ゴ ProN W3.otf ヒラギノ明朝 ProN W3.ttc - - AppleSDGothicNeo.ttc - AppleGothic.dfont AppleGothic.ttf AppleSDGothicNeo-Regular.otf + AppleSDGothicNeo.ttc 华文细黑.ttf PingFang.ttc STIXGeneral.otf diff --git a/indra/newview/fonts/fonts_droid.xml b/indra/newview/fonts/fonts_droid.xml index 3d19c7da6b..927bcdde17 100644 --- a/indra/newview/fonts/fonts_droid.xml +++ b/indra/newview/fonts/fonts_droid.xml @@ -22,12 +22,10 @@ ヒラギノ角ゴ Pro W3.otf ヒラギノ角ゴ ProN W3.otf ヒラギノ明朝 ProN W3.ttc - - AppleSDGothicNeo.ttc - AppleGothic.dfont AppleGothic.ttf AppleSDGothicNeo-Regular.otf + AppleSDGothicNeo.ttc 华文细黑.ttf PingFang.ttc STIXGeneral.otf diff --git a/indra/newview/fonts/fonts_dyslexia.xml b/indra/newview/fonts/fonts_dyslexia.xml index 97f37ee91e..9ebb445a84 100644 --- a/indra/newview/fonts/fonts_dyslexia.xml +++ b/indra/newview/fonts/fonts_dyslexia.xml @@ -22,12 +22,10 @@ ヒラギノ角ゴ Pro W3.otf ヒラギノ角ゴ ProN W3.otf ヒラギノ明朝 ProN W3.ttc - - AppleSDGothicNeo.ttc - AppleGothic.dfont AppleGothic.ttf AppleSDGothicNeo-Regular.otf + AppleSDGothicNeo.ttc 华文细黑.ttf PingFang.ttc STIXGeneral.otf diff --git a/indra/newview/fonts/fonts_liberation.xml b/indra/newview/fonts/fonts_liberation.xml index 794d78cc25..b612fe663f 100644 --- a/indra/newview/fonts/fonts_liberation.xml +++ b/indra/newview/fonts/fonts_liberation.xml @@ -22,12 +22,10 @@ ヒラギノ角ゴ Pro W3.otf ヒラギノ角ゴ ProN W3.otf ヒラギノ明朝 ProN W3.ttc - - AppleSDGothicNeo.ttc - AppleGothic.dfont AppleGothic.ttf AppleSDGothicNeo-Regular.otf + AppleSDGothicNeo.ttc 华文细黑.ttf PingFang.ttc STIXGeneral.otf diff --git a/indra/newview/fonts/fonts_mobi.xml b/indra/newview/fonts/fonts_mobi.xml index ff970a5d04..4b73ba4e1d 100644 --- a/indra/newview/fonts/fonts_mobi.xml +++ b/indra/newview/fonts/fonts_mobi.xml @@ -22,12 +22,10 @@ ヒラギノ角ゴ Pro W3.otf ヒラギノ角ゴ ProN W3.otf ヒラギノ明朝 ProN W3.ttc - - AppleSDGothicNeo.ttc - AppleGothic.dfont AppleGothic.ttf AppleSDGothicNeo-Regular.otf + AppleSDGothicNeo.ttc 华文细黑.ttf PingFang.ttc STIXGeneral.otf diff --git a/indra/newview/fonts/fonts_noto.xml b/indra/newview/fonts/fonts_noto.xml index 517a1153ab..57b3940962 100644 --- a/indra/newview/fonts/fonts_noto.xml +++ b/indra/newview/fonts/fonts_noto.xml @@ -22,12 +22,10 @@ ヒラギノ角ゴ Pro W3.otf ヒラギノ角ゴ ProN W3.otf ヒラギノ明朝 ProN W3.ttc - - AppleSDGothicNeo.ttc - AppleGothic.dfont AppleGothic.ttf AppleSDGothicNeo-Regular.otf + AppleSDGothicNeo.ttc 华文细黑.ttf PingFang.ttc STIXGeneral.otf diff --git a/indra/newview/fonts/fonts_roboto.xml b/indra/newview/fonts/fonts_roboto.xml index bf739bc285..e1c35b5332 100644 --- a/indra/newview/fonts/fonts_roboto.xml +++ b/indra/newview/fonts/fonts_roboto.xml @@ -22,12 +22,10 @@ ヒラギノ角ゴ Pro W3.otf ヒラギノ角ゴ ProN W3.otf ヒラギノ明朝 ProN W3.ttc - - AppleSDGothicNeo.ttc - AppleGothic.dfont AppleGothic.ttf AppleSDGothicNeo-Regular.otf + AppleSDGothicNeo.ttc 华文细黑.ttf PingFang.ttc STIXGeneral.otf diff --git a/indra/newview/fonts/fonts_ubuntu.xml b/indra/newview/fonts/fonts_ubuntu.xml index a3071b8fdb..f4f9cbe46a 100644 --- a/indra/newview/fonts/fonts_ubuntu.xml +++ b/indra/newview/fonts/fonts_ubuntu.xml @@ -22,12 +22,10 @@ ヒラギノ角ゴ Pro W3.otf ヒラギノ角ゴ ProN W3.otf ヒラギノ明朝 ProN W3.ttc - - AppleSDGothicNeo.ttc - AppleGothic.dfont AppleGothic.ttf AppleSDGothicNeo-Regular.otf + AppleSDGothicNeo.ttc 华文细黑.ttf PingFang.ttc STIXGeneral.otf From d9783adba73cce9a68fde4ba0ba78add28da4279 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 15 Apr 2020 19:36:37 +0300 Subject: [PATCH 15/19] SL-13040 Fixed crash at EnvironmentPersistAcrossLogin --- indra/newview/llenvironment.cpp | 8 ++++---- indra/newview/llsettingsvo.h | 3 +++ indra/newview/llstartup.cpp | 3 +-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index 0e1c4f9434..342ee3ccf5 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -2800,7 +2800,7 @@ void LLEnvironment::loadSkyWaterFromSettings(const LLSD &env_data, bool &valid, } else if (env_data.has("sky_llsd")) { - LLSettingsSky::ptr_t sky = std::make_shared(env_data["sky_llsd"]); + LLSettingsSky::ptr_t sky = LLSettingsVOSky::buildSky(env_data["sky_llsd"]); setEnvironment(ENV_LOCAL, sky); valid = true; } @@ -2814,7 +2814,7 @@ void LLEnvironment::loadSkyWaterFromSettings(const LLSD &env_data, bool &valid, } else if (env_data.has("water_llsd")) { - LLSettingsWater::ptr_t sky = std::make_shared(env_data["water_llsd"]); + LLSettingsWater::ptr_t sky = LLSettingsVOWater::buildWater(env_data["water_llsd"]); setEnvironment(ENV_LOCAL, sky); valid = true; } @@ -2899,8 +2899,8 @@ bool LLEnvironment::loadFromSettings() { S32 length = env_data["day_length"].asInteger(); S32 offset = env_data["day_offset"].asInteger(); - LLSettingsDay::ptr_t day = std::make_shared(env_data["day_llsd"]); - setEnvironment(ENV_LOCAL, day, LLSettingsDay::Seconds(length), LLSettingsDay::Seconds(offset)); + LLSettingsDay::ptr_t pday = LLSettingsVODay::buildDay(env_data["day_llsd"]); + setEnvironment(ENV_LOCAL, pday, LLSettingsDay::Seconds(length), LLSettingsDay::Seconds(offset)); valid = true; } diff --git a/indra/newview/llsettingsvo.h b/indra/newview/llsettingsvo.h index 1f29013ecf..65136ad2f5 100644 --- a/indra/newview/llsettingsvo.h +++ b/indra/newview/llsettingsvo.h @@ -158,6 +158,9 @@ class LLSettingsVODay : public LLSettingsDay public: typedef std::function asset_built_fn; + // Todo: find a way to make this cnstructor private + // It shouldn't be used outside shared_prt and LLSettingsVODay + // outside of settings only use buildDay(settings) LLSettingsVODay(const LLSD &data); static ptr_t buildDay(LLSD settings); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index a1d1e85492..7673bae725 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1879,8 +1879,7 @@ bool idle_startup() display_startup(); - // Load stored local environment if needed. Only should be done once at least - // initial region data got loaded to avoid race condition with region's environment + // Load stored local environment if needed. LLEnvironment::instance().loadFromSettings(); // *TODO : Uncomment that line once the whole grid migrated to SLM and suppress it from LLAgent::handleTeleportFinished() (llagent.cpp) From 231b51f40fd1541ba33377690989fcd49d338451 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 20 Apr 2020 22:20:16 +0300 Subject: [PATCH 16/19] Restored SL-12732 after merge conflict --- indra/newview/pipeline.cpp | 37 ++++++++++++++++--------------------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index f0ed303f66..01438bfb9f 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -8740,29 +8740,24 @@ void LLPipeline::renderDeferredLighting(LLRenderTarget* screen_target) } } - const LLViewerObject *vobj = drawablep->getVObj(); - if (vobj) - { - LLVOAvatar *av = vobj->getAvatar(); - if (av) - { - if (av->isTooComplex() || av->isInMuteList() || dist_vec(av->getPosition(), LLViewerCamera::getInstance()->getOrigin()) > RenderFarClip) - { - continue; - } - } - else - { - const LLViewerObject *root_obj = drawablep->getParent() ? drawablep->getParent()->getVObj() : vobj; - if (root_obj && dist_vec(root_obj->getPosition(), LLViewerCamera::getInstance()->getOrigin()) > RenderFarClip) - { - continue; - } - } - } + const LLViewerObject *vobj = drawablep->getVObj(); + if (vobj) + { + LLVOAvatar *av = vobj->getAvatar(); + if (av && (av->isTooComplex() || av->isInMuteList())) + { + continue; + } + } + + const LLVector3 position = drawablep->getPositionAgent(); + if (dist_vec(position, LLViewerCamera::getInstance()->getOrigin()) > RenderFarClip + volume->getLightRadius()) + { + continue; + } LLVector4a center; - center.load3(drawablep->getPositionAgent().mV); + center.load3(position.mV); const F32* c = center.getF32ptr(); F32 s = volume->getLightRadius()*1.5f; From f20b22e325ef15e0aa6eef950ba96538bb015568 Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Tue, 21 Apr 2020 00:35:19 +0300 Subject: [PATCH 17/19] AMD CPUs list update --- indra/llcommon/llprocessor.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/indra/llcommon/llprocessor.cpp b/indra/llcommon/llprocessor.cpp index a618a1cc70..5d16a4b74d 100644 --- a/indra/llcommon/llprocessor.cpp +++ b/indra/llcommon/llprocessor.cpp @@ -195,6 +195,8 @@ namespace std::string amd_CPUFamilyName(int composed_family) { + // https://en.wikipedia.org/wiki/List_of_AMD_CPU_microarchitectures + // https://developer.amd.com/resources/developer-guides-manuals/ switch(composed_family) { case 4: return "AMD 80486/5x86"; @@ -202,6 +204,13 @@ namespace case 6: return "AMD K7"; case 0xF: return "AMD K8"; case 0x10: return "AMD K8L"; + case 0x12: return "AMD K10"; + case 0x14: return "AMD Bobcat"; + case 0x15: return "AMD Bulldozer"; + case 0x16: return "AMD Jaguar"; + case 0x17: return "AMD Zen/Zen+/Zen2"; + case 0x18: return "AMD Hygon Dhyana"; + case 0x19: return "AMD Zen 3"; } return STRINGIZE("AMD "); } From ae38190e93b9b9e4b886e0321a895a6676ef4490 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Thu, 23 Apr 2020 20:22:56 +0200 Subject: [PATCH 18/19] EOL fixing --- .../shaders/class1/deferred/materialF.glsl | 878 +++++++++--------- 1 file changed, 439 insertions(+), 439 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl index 0afd1a9672..bf824b3afe 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl @@ -1,439 +1,439 @@ -/** -* @file materialF.glsl -* -* $LicenseInfo:firstyear=2007&license=viewerlgpl$ -* Second Life Viewer Source Code -* Copyright (C) 2007, Linden Research, Inc. -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; -* version 2.1 of the License only. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -* -* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA -* $/LicenseInfo$ -*/ - -/*[EXTRA_CODE_HERE]*/ - -//class1/deferred/materialF.glsl - -// This shader is used for both writing opaque/masked content to the gbuffer and writing blended content to the framebuffer during the alpha pass. - -#define DIFFUSE_ALPHA_MODE_NONE 0 -#define DIFFUSE_ALPHA_MODE_BLEND 1 -#define DIFFUSE_ALPHA_MODE_MASK 2 -#define DIFFUSE_ALPHA_MODE_EMISSIVE 3 - -uniform float emissive_brightness; // fullbright flag, 1.0 == fullbright, 0.0 otherwise -uniform int sun_up_factor; - -#ifdef WATER_FOG -vec4 applyWaterFogView(vec3 pos, vec4 color); -#endif - -vec3 atmosFragLighting(vec3 l, vec3 additive, vec3 atten); -vec3 scaleSoftClipFrag(vec3 l); - -vec3 fullbrightAtmosTransportFrag(vec3 light, vec3 additive, vec3 atten); -vec3 fullbrightScaleSoftClip(vec3 light); - -void calcAtmosphericVars(vec3 inPositionEye, vec3 light_dir, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 additive, out vec3 atten, bool use_ao); - -vec3 srgb_to_linear(vec3 cs); -vec3 linear_to_srgb(vec3 cs); - -#if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_BLEND) - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif - -#ifdef HAS_SUN_SHADOW -float sampleDirectionalShadow(vec3 pos, vec3 norm, vec2 pos_screen); -#endif - -uniform samplerCube environmentMap; -uniform sampler2D lightFunc; - -// Inputs -uniform vec4 morphFactor; -uniform vec3 camPosLocal; -uniform mat3 env_mat; - -uniform vec3 sun_dir; -uniform vec3 moon_dir; -VARYING vec2 vary_fragcoord; - -VARYING vec3 vary_position; - -uniform mat4 proj_mat; -uniform mat4 inv_proj; -uniform vec2 screen_res; - -uniform vec4 light_position[8]; -uniform vec3 light_direction[8]; -uniform vec4 light_attenuation[8]; -uniform vec3 light_diffuse[8]; - -float getAmbientClamp(); - -vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 npos, vec3 diffuse, vec4 spec, vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight, inout float glare, float ambiance) -{ - vec3 col = vec3(0); - - //get light vector - vec3 lv = lp.xyz - v; - - //get distance - float dist = length(lv); - float da = 1.0; - - dist /= la; - - if (dist > 0.0 && la > 0.0) - { - //normalize light vector - lv = normalize(lv); - - //distance attenuation - float dist_atten = clamp(1.0 - (dist - 1.0*(1.0 - fa)) / fa, 0.0, 1.0); - dist_atten *= dist_atten; - dist_atten *= 2.0f; - - if (dist_atten <= 0.0) - { - return col; - } - - // spotlight coefficient. - float spot = max(dot(-ln, lv), is_pointlight); - da *= spot*spot; // GL_SPOT_EXPONENT=2 - - //angular attenuation - da *= dot(n, lv); - - float lit = 0.0f; - - float amb_da = ambiance; - if (da >= 0) - { - lit = max(da * dist_atten, 0.0); - col = lit * light_col * diffuse; - amb_da += (da*0.5 + 0.5) * ambiance; - } - amb_da += (da*da*0.5 + 0.5) * ambiance; - amb_da *= dist_atten; - amb_da = min(amb_da, 1.0f - lit); - - // SL-10969 need to see why these are blown out - //col.rgb += amb_da * light_col * diffuse; - - if (spec.a > 0.0) - { - //vec3 ref = dot(pos+lv, norm); - vec3 h = normalize(lv + npos); - float nh = dot(n, h); - float nv = dot(n, npos); - float vh = dot(npos, h); - float sa = nh; - float fres = pow(1 - dot(h, npos), 5)*0.4 + 0.5; - - float gtdenom = 2 * nh; - float gt = max(0, min(gtdenom * nv / vh, gtdenom * da / vh)); - - if (nh > 0.0) - { - float scol = fres*texture2D(lightFunc, vec2(nh, spec.a)).r*gt / (nh*da); - vec3 speccol = lit*scol*light_col.rgb*spec.rgb; - speccol = clamp(speccol, vec3(0), vec3(1)); - col += speccol; - - float cur_glare = max(speccol.r, speccol.g); - cur_glare = max(cur_glare, speccol.b); - glare = max(glare, speccol.r); - glare += max(cur_glare, 0.0); - } - } - } - - return max(col, vec3(0.0, 0.0, 0.0)); -} - -#else -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 frag_data[3]; -#else -#define frag_data gl_FragData -#endif -#endif - -uniform sampler2D diffuseMap; //always in sRGB space - -#ifdef HAS_NORMAL_MAP -uniform sampler2D bumpMap; -#endif - -#ifdef HAS_SPECULAR_MAP -uniform sampler2D specularMap; - -VARYING vec2 vary_texcoord2; -#endif - -uniform float env_intensity; -uniform vec4 specular_color; // specular color RGB and specular exponent (glossiness) in alpha - -#if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_MASK) -uniform float minimum_alpha; -#endif - -#ifdef HAS_NORMAL_MAP -VARYING vec3 vary_mat0; -VARYING vec3 vary_mat1; -VARYING vec3 vary_mat2; -VARYING vec2 vary_texcoord1; -#else -VARYING vec3 vary_normal; -#endif - -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; - -vec2 encode_normal(vec3 n); - -void main() -{ - vec2 pos_screen = vary_texcoord0.xy; - - vec4 diffcol = texture2D(diffuseMap, vary_texcoord0.xy); - diffcol.rgb *= vertex_color.rgb; - -#if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_MASK) - - // Comparing floats cast from 8-bit values, produces acne right at the 8-bit transition points - float bias = 0.001953125; // 1/512, or half an 8-bit quantization - if (diffcol.a < minimum_alpha-bias) - { - discard; - } -#endif - -#if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_BLEND) - vec3 gamma_diff = diffcol.rgb; - diffcol.rgb = srgb_to_linear(diffcol.rgb); -#endif - -#ifdef HAS_SPECULAR_MAP - vec4 spec = texture2D(specularMap, vary_texcoord2.xy); - spec.rgb *= specular_color.rgb; -#else - vec4 spec = vec4(specular_color.rgb, 1.0); -#endif - -#ifdef HAS_NORMAL_MAP - vec4 norm = texture2D(bumpMap, vary_texcoord1.xy); - - norm.xyz = norm.xyz * 2 - 1; - - vec3 tnorm = vec3(dot(norm.xyz,vary_mat0), - dot(norm.xyz,vary_mat1), - dot(norm.xyz,vary_mat2)); -#else - vec4 norm = vec4(0,0,0,1.0); - vec3 tnorm = vary_normal; -#endif - - norm.xyz = normalize(tnorm.xyz); - - vec2 abnormal = encode_normal(norm.xyz); - - vec4 final_color = diffcol; - -#if (DIFFUSE_ALPHA_MODE != DIFFUSE_ALPHA_MODE_EMISSIVE) - final_color.a = emissive_brightness; -#else - final_color.a = max(final_color.a, emissive_brightness); -#endif - - vec4 final_specular = spec; - -#ifdef HAS_SPECULAR_MAP - vec4 final_normal = vec4(encode_normal(normalize(tnorm)), env_intensity * spec.a, 0.0); - final_specular.a = specular_color.a * norm.a; -#else - vec4 final_normal = vec4(encode_normal(normalize(tnorm)), env_intensity, 0.0); - final_specular.a = specular_color.a; -#endif - -#if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_BLEND) - - //forward rendering, output just lit sRGBA - vec3 pos = vary_position; - - float shadow = 1.0f; - -#ifdef HAS_SUN_SHADOW - shadow = sampleDirectionalShadow(pos.xyz, norm.xyz, pos_screen); -#endif - - spec = final_specular; - vec4 diffuse = final_color; - float envIntensity = final_normal.z; - - vec3 color = vec3(0,0,0); - - vec3 light_dir = (sun_up_factor == 1) ? sun_dir : moon_dir; - - float bloom = 0.0; - vec3 sunlit; - vec3 amblit; - vec3 additive; - vec3 atten; - - calcAtmosphericVars(pos.xyz, light_dir, 1.0, sunlit, amblit, additive, atten, false); - - // This call breaks the Mac GLSL compiler/linker for unknown reasons (17Mar2020) - // The call is either a no-op or a pure (pow) gamma adjustment, depending on GPU level - // TODO: determine if we want to re-apply the gamma adjustment, and if so understand & fix Mac breakage - //color = fullbrightScaleSoftClip(color); - - vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); - - //we're in sRGB space, so gamma correct this dot product so - // lighting from the sun stays sharp - float da = clamp(dot(normalize(norm.xyz), light_dir.xyz), 0.0, 1.0); - da = pow(da, 1.0 / 1.3); - - color = amblit; - - //darken ambient for normals perpendicular to light vector so surfaces in shadow - // and facing away from light still have some definition to them. - // do NOT gamma correct this dot product so ambient lighting stays soft - float ambient = min(abs(dot(norm.xyz, sun_dir.xyz)), 1.0); - ambient *= 0.5; - ambient *= ambient; - ambient = (1.0 - ambient); - - vec3 sun_contrib = min(da, shadow) * sunlit; - - color *= ambient; - - color += sun_contrib; - - color *= gamma_diff.rgb; - - float glare = 0.0; - - if (spec.a > 0.0) // specular reflection - { -#if 1 //EEP - - vec3 npos = -normalize(pos.xyz); - - //vec3 ref = dot(pos+lv, norm); - vec3 h = normalize(light_dir.xyz + npos); - float nh = dot(norm.xyz, h); - float nv = dot(norm.xyz, npos); - float vh = dot(npos, h); - float sa = nh; - float fres = pow(1 - dot(h, npos), 5)*0.4 + 0.5; - - float gtdenom = 2 * nh; - float gt = max(0, min(gtdenom * nv / vh, gtdenom * da / vh)); - - if (nh > 0.0) - { - float scol = fres*texture2D(lightFunc, vec2(nh, spec.a)).r*gt / (nh*da); - vec3 sp = sun_contrib*scol / 6.0f; - sp = clamp(sp, vec3(0), vec3(1)); - bloom = dot(sp, sp) / 4.0; - color += sp * spec.rgb; - } -#else // PRODUCTION - float sa = dot(refnormpersp, sun_dir.xyz); - vec3 dumbshiny = sunlit*shadow*(texture2D(lightFunc, vec2(sa, spec.a)).r); - - // add the two types of shiny together - vec3 spec_contrib = dumbshiny * spec.rgb; - bloom = dot(spec_contrib, spec_contrib) / 6; - - glare = max(spec_contrib.r, spec_contrib.g); - glare = max(glare, spec_contrib.b); - - color += spec_contrib; -#endif - } - - color = mix(color.rgb, diffcol.rgb, diffuse.a); - - if (envIntensity > 0.0) - { - //add environmentmap - vec3 env_vec = env_mat * refnormpersp; - - vec3 reflected_color = textureCube(environmentMap, env_vec).rgb; - - color = mix(color, reflected_color, envIntensity); - - float cur_glare = max(reflected_color.r, reflected_color.g); - cur_glare = max(cur_glare, reflected_color.b); - cur_glare *= envIntensity*4.0; - glare += cur_glare; - } - - color = atmosFragLighting(color, additive, atten); - color = scaleSoftClipFrag(color); - - //convert to linear before adding local lights - color = srgb_to_linear(color); - - vec3 npos = normalize(-pos.xyz); - - vec3 light = vec3(0, 0, 0); - -#define LIGHT_LOOP(i) light.rgb += calcPointLightOrSpotLight(light_diffuse[i].rgb, npos, diffuse.rgb, final_specular, pos.xyz, norm.xyz, light_position[i], light_direction[i].xyz, light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z, glare, light_attenuation[i].w ); - - LIGHT_LOOP(1) - LIGHT_LOOP(2) - LIGHT_LOOP(3) - LIGHT_LOOP(4) - LIGHT_LOOP(5) - LIGHT_LOOP(6) - LIGHT_LOOP(7) - - color += light; - - glare = min(glare, 1.0); - float al = max(diffcol.a, glare)*vertex_color.a; - - //convert to srgb as this color is being written post gamma correction - color = linear_to_srgb(color); - -#ifdef WATER_FOG - vec4 temp = applyWaterFogView(pos, vec4(color, al)); - color = temp.rgb; - al = temp.a; -#endif - - frag_color = vec4(color, al); - -#else // mode is not DIFFUSE_ALPHA_MODE_BLEND, encode to gbuffer - - // deferred path - frag_data[0] = final_color; //gbuffer is sRGB - frag_data[1] = final_specular; // XYZ = Specular color. W = Specular exponent. - frag_data[2] = final_normal; // XY = Normal. Z = Env. intensity. -#endif -} - +/** +* @file materialF.glsl +* +* $LicenseInfo:firstyear=2007&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2007, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + +/*[EXTRA_CODE_HERE]*/ + +//class1/deferred/materialF.glsl + +// This shader is used for both writing opaque/masked content to the gbuffer and writing blended content to the framebuffer during the alpha pass. + +#define DIFFUSE_ALPHA_MODE_NONE 0 +#define DIFFUSE_ALPHA_MODE_BLEND 1 +#define DIFFUSE_ALPHA_MODE_MASK 2 +#define DIFFUSE_ALPHA_MODE_EMISSIVE 3 + +uniform float emissive_brightness; // fullbright flag, 1.0 == fullbright, 0.0 otherwise +uniform int sun_up_factor; + +#ifdef WATER_FOG +vec4 applyWaterFogView(vec3 pos, vec4 color); +#endif + +vec3 atmosFragLighting(vec3 l, vec3 additive, vec3 atten); +vec3 scaleSoftClipFrag(vec3 l); + +vec3 fullbrightAtmosTransportFrag(vec3 light, vec3 additive, vec3 atten); +vec3 fullbrightScaleSoftClip(vec3 light); + +void calcAtmosphericVars(vec3 inPositionEye, vec3 light_dir, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 additive, out vec3 atten, bool use_ao); + +vec3 srgb_to_linear(vec3 cs); +vec3 linear_to_srgb(vec3 cs); + +#if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_BLEND) + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 frag_color; +#else +#define frag_color gl_FragColor +#endif + +#ifdef HAS_SUN_SHADOW +float sampleDirectionalShadow(vec3 pos, vec3 norm, vec2 pos_screen); +#endif + +uniform samplerCube environmentMap; +uniform sampler2D lightFunc; + +// Inputs +uniform vec4 morphFactor; +uniform vec3 camPosLocal; +uniform mat3 env_mat; + +uniform vec3 sun_dir; +uniform vec3 moon_dir; +VARYING vec2 vary_fragcoord; + +VARYING vec3 vary_position; + +uniform mat4 proj_mat; +uniform mat4 inv_proj; +uniform vec2 screen_res; + +uniform vec4 light_position[8]; +uniform vec3 light_direction[8]; +uniform vec4 light_attenuation[8]; +uniform vec3 light_diffuse[8]; + +float getAmbientClamp(); + +vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 npos, vec3 diffuse, vec4 spec, vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight, inout float glare, float ambiance) +{ + vec3 col = vec3(0); + + //get light vector + vec3 lv = lp.xyz - v; + + //get distance + float dist = length(lv); + float da = 1.0; + + dist /= la; + + if (dist > 0.0 && la > 0.0) + { + //normalize light vector + lv = normalize(lv); + + //distance attenuation + float dist_atten = clamp(1.0 - (dist - 1.0*(1.0 - fa)) / fa, 0.0, 1.0); + dist_atten *= dist_atten; + dist_atten *= 2.0f; + + if (dist_atten <= 0.0) + { + return col; + } + + // spotlight coefficient. + float spot = max(dot(-ln, lv), is_pointlight); + da *= spot*spot; // GL_SPOT_EXPONENT=2 + + //angular attenuation + da *= dot(n, lv); + + float lit = 0.0f; + + float amb_da = ambiance; + if (da >= 0) + { + lit = max(da * dist_atten, 0.0); + col = lit * light_col * diffuse; + amb_da += (da*0.5 + 0.5) * ambiance; + } + amb_da += (da*da*0.5 + 0.5) * ambiance; + amb_da *= dist_atten; + amb_da = min(amb_da, 1.0f - lit); + + // SL-10969 need to see why these are blown out + //col.rgb += amb_da * light_col * diffuse; + + if (spec.a > 0.0) + { + //vec3 ref = dot(pos+lv, norm); + vec3 h = normalize(lv + npos); + float nh = dot(n, h); + float nv = dot(n, npos); + float vh = dot(npos, h); + float sa = nh; + float fres = pow(1 - dot(h, npos), 5)*0.4 + 0.5; + + float gtdenom = 2 * nh; + float gt = max(0, min(gtdenom * nv / vh, gtdenom * da / vh)); + + if (nh > 0.0) + { + float scol = fres*texture2D(lightFunc, vec2(nh, spec.a)).r*gt / (nh*da); + vec3 speccol = lit*scol*light_col.rgb*spec.rgb; + speccol = clamp(speccol, vec3(0), vec3(1)); + col += speccol; + + float cur_glare = max(speccol.r, speccol.g); + cur_glare = max(cur_glare, speccol.b); + glare = max(glare, speccol.r); + glare += max(cur_glare, 0.0); + } + } + } + + return max(col, vec3(0.0, 0.0, 0.0)); +} + +#else +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 frag_data[3]; +#else +#define frag_data gl_FragData +#endif +#endif + +uniform sampler2D diffuseMap; //always in sRGB space + +#ifdef HAS_NORMAL_MAP +uniform sampler2D bumpMap; +#endif + +#ifdef HAS_SPECULAR_MAP +uniform sampler2D specularMap; + +VARYING vec2 vary_texcoord2; +#endif + +uniform float env_intensity; +uniform vec4 specular_color; // specular color RGB and specular exponent (glossiness) in alpha + +#if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_MASK) +uniform float minimum_alpha; +#endif + +#ifdef HAS_NORMAL_MAP +VARYING vec3 vary_mat0; +VARYING vec3 vary_mat1; +VARYING vec3 vary_mat2; +VARYING vec2 vary_texcoord1; +#else +VARYING vec3 vary_normal; +#endif + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + +vec2 encode_normal(vec3 n); + +void main() +{ + vec2 pos_screen = vary_texcoord0.xy; + + vec4 diffcol = texture2D(diffuseMap, vary_texcoord0.xy); + diffcol.rgb *= vertex_color.rgb; + +#if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_MASK) + + // Comparing floats cast from 8-bit values, produces acne right at the 8-bit transition points + float bias = 0.001953125; // 1/512, or half an 8-bit quantization + if (diffcol.a < minimum_alpha-bias) + { + discard; + } +#endif + +#if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_BLEND) + vec3 gamma_diff = diffcol.rgb; + diffcol.rgb = srgb_to_linear(diffcol.rgb); +#endif + +#ifdef HAS_SPECULAR_MAP + vec4 spec = texture2D(specularMap, vary_texcoord2.xy); + spec.rgb *= specular_color.rgb; +#else + vec4 spec = vec4(specular_color.rgb, 1.0); +#endif + +#ifdef HAS_NORMAL_MAP + vec4 norm = texture2D(bumpMap, vary_texcoord1.xy); + + norm.xyz = norm.xyz * 2 - 1; + + vec3 tnorm = vec3(dot(norm.xyz,vary_mat0), + dot(norm.xyz,vary_mat1), + dot(norm.xyz,vary_mat2)); +#else + vec4 norm = vec4(0,0,0,1.0); + vec3 tnorm = vary_normal; +#endif + + norm.xyz = normalize(tnorm.xyz); + + vec2 abnormal = encode_normal(norm.xyz); + + vec4 final_color = diffcol; + +#if (DIFFUSE_ALPHA_MODE != DIFFUSE_ALPHA_MODE_EMISSIVE) + final_color.a = emissive_brightness; +#else + final_color.a = max(final_color.a, emissive_brightness); +#endif + + vec4 final_specular = spec; + +#ifdef HAS_SPECULAR_MAP + vec4 final_normal = vec4(encode_normal(normalize(tnorm)), env_intensity * spec.a, 0.0); + final_specular.a = specular_color.a * norm.a; +#else + vec4 final_normal = vec4(encode_normal(normalize(tnorm)), env_intensity, 0.0); + final_specular.a = specular_color.a; +#endif + +#if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_BLEND) + + //forward rendering, output just lit sRGBA + vec3 pos = vary_position; + + float shadow = 1.0f; + +#ifdef HAS_SUN_SHADOW + shadow = sampleDirectionalShadow(pos.xyz, norm.xyz, pos_screen); +#endif + + spec = final_specular; + vec4 diffuse = final_color; + float envIntensity = final_normal.z; + + vec3 color = vec3(0,0,0); + + vec3 light_dir = (sun_up_factor == 1) ? sun_dir : moon_dir; + + float bloom = 0.0; + vec3 sunlit; + vec3 amblit; + vec3 additive; + vec3 atten; + + calcAtmosphericVars(pos.xyz, light_dir, 1.0, sunlit, amblit, additive, atten, false); + + // This call breaks the Mac GLSL compiler/linker for unknown reasons (17Mar2020) + // The call is either a no-op or a pure (pow) gamma adjustment, depending on GPU level + // TODO: determine if we want to re-apply the gamma adjustment, and if so understand & fix Mac breakage + //color = fullbrightScaleSoftClip(color); + + vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); + + //we're in sRGB space, so gamma correct this dot product so + // lighting from the sun stays sharp + float da = clamp(dot(normalize(norm.xyz), light_dir.xyz), 0.0, 1.0); + da = pow(da, 1.0 / 1.3); + + color = amblit; + + //darken ambient for normals perpendicular to light vector so surfaces in shadow + // and facing away from light still have some definition to them. + // do NOT gamma correct this dot product so ambient lighting stays soft + float ambient = min(abs(dot(norm.xyz, sun_dir.xyz)), 1.0); + ambient *= 0.5; + ambient *= ambient; + ambient = (1.0 - ambient); + + vec3 sun_contrib = min(da, shadow) * sunlit; + + color *= ambient; + + color += sun_contrib; + + color *= gamma_diff.rgb; + + float glare = 0.0; + + if (spec.a > 0.0) // specular reflection + { +#if 1 //EEP + + vec3 npos = -normalize(pos.xyz); + + //vec3 ref = dot(pos+lv, norm); + vec3 h = normalize(light_dir.xyz + npos); + float nh = dot(norm.xyz, h); + float nv = dot(norm.xyz, npos); + float vh = dot(npos, h); + float sa = nh; + float fres = pow(1 - dot(h, npos), 5)*0.4 + 0.5; + + float gtdenom = 2 * nh; + float gt = max(0, min(gtdenom * nv / vh, gtdenom * da / vh)); + + if (nh > 0.0) + { + float scol = fres*texture2D(lightFunc, vec2(nh, spec.a)).r*gt / (nh*da); + vec3 sp = sun_contrib*scol / 6.0f; + sp = clamp(sp, vec3(0), vec3(1)); + bloom = dot(sp, sp) / 4.0; + color += sp * spec.rgb; + } +#else // PRODUCTION + float sa = dot(refnormpersp, sun_dir.xyz); + vec3 dumbshiny = sunlit*shadow*(texture2D(lightFunc, vec2(sa, spec.a)).r); + + // add the two types of shiny together + vec3 spec_contrib = dumbshiny * spec.rgb; + bloom = dot(spec_contrib, spec_contrib) / 6; + + glare = max(spec_contrib.r, spec_contrib.g); + glare = max(glare, spec_contrib.b); + + color += spec_contrib; +#endif + } + + color = mix(color.rgb, diffcol.rgb, diffuse.a); + + if (envIntensity > 0.0) + { + //add environmentmap + vec3 env_vec = env_mat * refnormpersp; + + vec3 reflected_color = textureCube(environmentMap, env_vec).rgb; + + color = mix(color, reflected_color, envIntensity); + + float cur_glare = max(reflected_color.r, reflected_color.g); + cur_glare = max(cur_glare, reflected_color.b); + cur_glare *= envIntensity*4.0; + glare += cur_glare; + } + + color = atmosFragLighting(color, additive, atten); + color = scaleSoftClipFrag(color); + + //convert to linear before adding local lights + color = srgb_to_linear(color); + + vec3 npos = normalize(-pos.xyz); + + vec3 light = vec3(0, 0, 0); + +#define LIGHT_LOOP(i) light.rgb += calcPointLightOrSpotLight(light_diffuse[i].rgb, npos, diffuse.rgb, final_specular, pos.xyz, norm.xyz, light_position[i], light_direction[i].xyz, light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z, glare, light_attenuation[i].w ); + + LIGHT_LOOP(1) + LIGHT_LOOP(2) + LIGHT_LOOP(3) + LIGHT_LOOP(4) + LIGHT_LOOP(5) + LIGHT_LOOP(6) + LIGHT_LOOP(7) + + color += light; + + glare = min(glare, 1.0); + float al = max(diffcol.a, glare)*vertex_color.a; + + //convert to srgb as this color is being written post gamma correction + color = linear_to_srgb(color); + +#ifdef WATER_FOG + vec4 temp = applyWaterFogView(pos, vec4(color, al)); + color = temp.rgb; + al = temp.a; +#endif + + frag_color = vec4(color, al); + +#else // mode is not DIFFUSE_ALPHA_MODE_BLEND, encode to gbuffer + + // deferred path + frag_data[0] = final_color; //gbuffer is sRGB + frag_data[1] = final_specular; // XYZ = Specular color. W = Specular exponent. + frag_data[2] = final_normal; // XY = Normal. Z = Env. intensity. +#endif +} + From 4a7fd0117a43dca9e30c58c6417ebdf6862561f6 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 4 May 2020 12:15:30 -0400 Subject: [PATCH 19/19] Increment viewer version to 6.4.2 following promotion of DRTVWR-500 --- indra/newview/VIEWER_VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt index 4c77920fd2..a4c853ea2e 100644 --- a/indra/newview/VIEWER_VERSION.txt +++ b/indra/newview/VIEWER_VERSION.txt @@ -1 +1 @@ -6.4.1 +6.4.2