From c0e16b28001e4b34511d84537155f0c8b9d692d7 Mon Sep 17 00:00:00 2001 From: "Graham Linden graham@lindenlab.com" Date: Wed, 11 Apr 2018 20:14:33 +0100 Subject: Add stats for tex cache read / decode / fetch latency for comparison of old cache code with TCO. --- indra/newview/lltexturefetch.cpp | 72 ++++++++++++++++++++++++--------------- indra/newview/lltexturefetch.h | 9 +++-- indra/newview/lltextureview.cpp | 44 +++++++++++++++++++++--- indra/newview/llviewertexture.cpp | 8 +++++ 4 files changed, 97 insertions(+), 36 deletions(-) diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 1f7796e6d0..3a515dd611 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -60,13 +60,16 @@ #include "bufferarray.h" #include "bufferstream.h" #include "llcorehttputil.h" - #include "llhttpretrypolicy.h" bool LLTextureFetchDebugger::sDebuggerEnabled = false ; -LLTrace::EventStatHandle > LLTextureFetch::sCacheHitRate("texture_cache_hits"); -LLTrace::EventStatHandle LLTextureFetch::sCacheReadLatency("texture_cache_read_latency"); +LLTrace::CountStatHandle LLTextureFetch::sCacheHit("texture_cache_hit"); +LLTrace::CountStatHandle LLTextureFetch::sCacheAttempt("texture_cache_attempt"); + +LLTrace::SampleStatHandle LLTextureFetch::sCacheReadLatency("texture_cache_read_latency"); +LLTrace::SampleStatHandle LLTextureFetch::sTexDecodeLatency("texture_decode_latency"); +LLTrace::SampleStatHandle LLTextureFetch::sTexFetchLatency("texture_fetch_latency"); ////////////////////////////////////////////////////////////////////////////// // @@ -564,15 +567,21 @@ private: F32 mImagePriority; U32 mWorkPriority; F32 mRequestedPriority; - S32 mDesiredDiscard, - mSimRequestedDiscard, - mRequestedDiscard, - mLoadedDiscard, - mDecodedDiscard; - LLFrameTimer mRequestedTimer, - mFetchTimer; - LLTimer mCacheReadTimer; - F32 mCacheReadTime; + S32 mDesiredDiscard; + S32 mSimRequestedDiscard; + S32 mRequestedDiscard; + S32 mLoadedDiscard; + S32 mDecodedDiscard; + S32 mFullWidth; + S32 mFullHeight; + LLFrameTimer mRequestedDeltaTimer; + LLFrameTimer mFetchDeltaTimer; + LLTimer mCacheReadTimer; + LLTimer mDecodeTimer; + LLTimer mFetchTimer; + F32 mCacheReadTime; // time for cache read only + F32 mDecodeTime; // time for decode only + F32 mFetchTime; // total time from req to finished fetch LLTextureCache::handle_t mCacheReadHandle, mCacheWriteHandle; S32 mRequestedSize, @@ -906,6 +915,8 @@ LLTextureFetchWorker::LLTextureFetchWorker(LLTextureFetch* fetcher, mLoadedDiscard(-1), mDecodedDiscard(-1), mCacheReadTime(0.f), + mDecodeTime(0.f), + mFetchTime(0.f), mCacheReadHandle(LLTextureCache::nullHandle()), mCacheWriteHandle(LLTextureCache::nullHandle()), mRequestedSize(0), @@ -1167,7 +1178,7 @@ bool LLTextureFetchWorker::doWork(S32 param) if (mState != DONE) { - mFetchTimer.reset(); + mFetchDeltaTimer.reset(); } if (mState == INIT) @@ -1218,7 +1229,9 @@ bool LLTextureFetchWorker::doWork(S32 param) } mFileSize = 0; mLoaded = FALSE; - + + add(LLTextureFetch::sCacheAttempt, 1.0); + if (mUrl.compare(0, 7, "file://") == 0) { setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority); // Set priority first since Responder may change it @@ -1229,7 +1242,7 @@ bool LLTextureFetchWorker::doWork(S32 param) CacheReadResponder* responder = new CacheReadResponder(mFetcher, mID, mFormattedImage); mCacheReadHandle = mFetcher->mTextureCache->readFromCache(filename, mID, cache_priority, offset, size, responder); - mCacheReadTimer.reset(); + mCacheReadTimer.reset(); } else if ((mUrl.empty() || mFTType==FTT_SERVER_BAKE) && mFetcher->canLoadFromCache()) { @@ -1260,6 +1273,7 @@ bool LLTextureFetchWorker::doWork(S32 param) { mCacheReadHandle = LLTextureCache::nullHandle(); setState(CACHE_POST); + add(LLTextureFetch::sCacheHit, 1.0); // fall through } else @@ -1297,7 +1311,6 @@ bool LLTextureFetchWorker::doWork(S32 param) LL_DEBUGS(LOG_TXT) << mID << ": Cached. Bytes: " << mFormattedImage->getDataSize() << " Size: " << llformat("%dx%d",mFormattedImage->getWidth(),mFormattedImage->getHeight()) << " Desired Discard: " << mDesiredDiscard << " Desired Size: " << mDesiredSize << LL_ENDL; - record(LLTextureFetch::sCacheHitRate, LLUnits::Ratio::fromValue(1)); } else { @@ -1315,7 +1328,6 @@ bool LLTextureFetchWorker::doWork(S32 param) } // fall through - record(LLTextureFetch::sCacheHitRate, LLUnits::Ratio::fromValue(0)); } } @@ -1571,7 +1583,7 @@ bool LLTextureFetchWorker::doWork(S32 param) return true; // failed } - mRequestedTimer.reset(); + mRequestedDeltaTimer.reset(); mLoaded = FALSE; mGetStatus = LLCore::HttpStatus(); mGetReason.clear(); @@ -1898,6 +1910,8 @@ bool LLTextureFetchWorker::doWork(S32 param) mFetcher->getFetchDebugger()->addHistoryEntry(this); } + mDecodeTime = mDecodeTimer.getElapsedTimeF32(); + if (mDecodedDiscard < 0) { if (mCachedSize > 0 && !mInLocalCache && mRetryAttempt == 0) @@ -2002,6 +2016,7 @@ bool LLTextureFetchWorker::doWork(S32 param) else { setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority); + mFetchTime = mFetchTimer.getElapsedTimeF32(); return true; } } @@ -2945,11 +2960,12 @@ bool LLTextureFetch::getRequestFinished(const LLUUID& id, S32& discard_level, discard_level = worker->mDecodedDiscard; raw = worker->mRawImage; aux = worker->mAuxImage; - F32Seconds cache_read_time(worker->mCacheReadTime); - if (cache_read_time != (F32Seconds)0.f) - { - record(sCacheReadLatency, cache_read_time); - } + sample(sTexDecodeLatency, worker->mDecodeTime); + sample(sTexFetchLatency, worker->mFetchTime); + sample(sCacheReadLatency, worker->mCacheReadTime); + worker->mCacheReadTimer.reset(); + worker->mDecodeTimer.reset(); + worker->mFetchTimer.reset(); res = true; LL_DEBUGS(LOG_TXT) << id << ": Request Finished. State: " << worker->mState << " Discard: " << discard_level << LL_ENDL; worker->unlockWorkMutex(); // -Mw @@ -3253,7 +3269,7 @@ void LLTextureFetch::sendRequestListToSimulators() // req->setPriority(LLWorkerThread::PRIORITY_HIGH | req->mWorkPriority); continue; } - F32 elapsed = req->mRequestedTimer.getElapsedTimeF32(); + F32 elapsed = req->mRequestedDeltaTimer.getElapsedTimeF32(); { F32 delta_priority = llabs(req->mRequestedPriority - req->mImagePriority); if ((req->mSimRequestedDiscard != req->mDesiredDiscard) || @@ -3322,7 +3338,7 @@ void LLTextureFetch::sendRequestListToSimulators() req->mSentRequest = LLTextureFetchWorker::SENT_SIM; req->mSimRequestedDiscard = req->mDesiredDiscard; req->mRequestedPriority = req->mImagePriority; - req->mRequestedTimer.reset(); + req->mRequestedDeltaTimer.reset(); req->unlockWorkMutex(); // -Mw sim_request_count++; if (sim_request_count >= IMAGES_PER_REQUEST) @@ -3397,7 +3413,7 @@ void LLTextureFetch::sendRequestListToSimulators() // Locks: Mw bool LLTextureFetchWorker::insertPacket(S32 index, U8* data, S32 size) { - mRequestedTimer.reset(); + mRequestedDeltaTimer.reset(); if (index >= mTotalPackets) { // LL_WARNS(LOG_TXT) << "Received Image Packet " << index << " > max: " << mTotalPackets << " for image: " << mID << LL_ENDL; @@ -3606,8 +3622,8 @@ S32 LLTextureFetch::getFetchState(const LLUUID& id, F32& data_progress_p, F32& r { worker->lockWorkMutex(); // +Mw state = worker->mState; - fetch_dtime = worker->mFetchTimer.getElapsedTimeF32(); - request_dtime = worker->mRequestedTimer.getElapsedTimeF32(); + fetch_dtime = worker->mFetchDeltaTimer.getElapsedTimeF32(); + request_dtime = worker->mRequestedDeltaTimer.getElapsedTimeF32(); if (worker->mFileSize > 0) { if (state == LLTextureFetchWorker::LOAD_FROM_SIMULATOR) diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index cfa312ccd9..a2155bde1f 100644 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -308,13 +308,16 @@ public: S32 mPacketCount; S32 mBadPacketCount; + static LLTrace::CountStatHandle sCacheHit; + static LLTrace::CountStatHandle sCacheAttempt; + static LLTrace::SampleStatHandle sCacheReadLatency; + static LLTrace::SampleStatHandle sTexDecodeLatency; + static LLTrace::SampleStatHandle sTexFetchLatency; + private: LLMutex mQueueMutex; //to protect mRequestMap and mCommands only LLMutex mNetworkQueueMutex; //to protect mNetworkQueue, mHTTPTextureQueue and mCancelQueue. - static LLTrace::EventStatHandle > sCacheHitRate; - static LLTrace::EventStatHandle sCacheReadLatency; - LLTextureCache* mTextureCache; LLImageDecodeThread* mImageDecodeThread; diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp index b7786bcdd7..95ecef6be8 100644 --- a/indra/newview/lltextureview.cpp +++ b/indra/newview/lltextureview.cpp @@ -240,9 +240,9 @@ void LLTextureBar::draw() { "REQ", LLColor4::yellow },// SEND_HTTP_REQ { "HTP", LLColor4::green }, // WAIT_HTTP_REQ { "DEC", LLColor4::yellow },// DECODE_IMAGE - { "DEC", LLColor4::green }, // DECODE_IMAGE_UPDATE + { "DEU", LLColor4::green }, // DECODE_IMAGE_UPDATE { "WRT", LLColor4::purple },// WRITE_TO_CACHE - { "WRT", LLColor4::orange },// WAIT_ON_WRITE + { "WWT", LLColor4::orange },// WAIT_ON_WRITE { "END", LLColor4::red }, // DONE #define LAST_STATE 14 { "CRE", LLColor4::magenta }, // LAST_STATE+1 @@ -530,6 +530,25 @@ void LLGLTexMemBar::draw() LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, v_offset + line_height*6, text_color, LLFontGL::LEFT, LLFontGL::TOP); + LLTrace::Recording& recording = LLViewerStats::instance().getRecording(); + + F64 cacheHits = recording.getSampleCount(LLTextureFetch::sCacheHit); + F64 cacheAttempts = recording.getSampleCount(LLTextureFetch::sCacheAttempt); + + F32 cacheHitRate = (cacheAttempts > 0.0) ? F32((cacheHits / cacheAttempts) * 100.0f) : 0.0f; + + U32 cacheReadLatMin = U32(recording.getMin(LLTextureFetch::sCacheReadLatency).value() * 1000.0f); + U32 cacheReadLatMed = U32(recording.getMean(LLTextureFetch::sCacheReadLatency).value() * 1000.0f); + U32 cacheReadLatMax = U32(recording.getMax(LLTextureFetch::sCacheReadLatency).value() * 1000.0f); + + U32 texDecodeLatMin = U32(recording.getMin(LLTextureFetch::sTexDecodeLatency).value() * 1000.0f); + U32 texDecodeLatMed = U32(recording.getMean(LLTextureFetch::sTexDecodeLatency).value() * 1000.0f); + U32 texDecodeLatMax = U32(recording.getMax(LLTextureFetch::sTexDecodeLatency).value() * 1000.0f); + + U32 texFetchLatMin = U32(recording.getMin(LLTextureFetch::sTexFetchLatency).value() * 1000.0f); + U32 texFetchLatMed = U32(recording.getMean(LLTextureFetch::sTexFetchLatency).value() * 1000.0f); + U32 texFetchLatMax = U32(recording.getMax(LLTextureFetch::sTexFetchLatency).value() * 1000.0f); + text = llformat("GL Tot: %d/%d MB Bound: %d/%d MB FBO: %d MB Raw Tot: %d MB Bias: %.2f Cache: %.1f/%.1f MB", total_mem.value(), max_total_mem.value(), @@ -542,7 +561,7 @@ void LLGLTexMemBar::draw() cache_max_usage); //, cache_entries, cache_max_entries - LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, v_offset + line_height*5, + LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, v_offset + line_height*6, text_color, LLFontGL::LEFT, LLFontGL::TOP); U32 cache_read(0U), cache_write(0U), res_wait(0U); @@ -558,6 +577,21 @@ void LLGLTexMemBar::draw() cache_write, res_wait); + LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, v_offset + line_height*5, + text_color, LLFontGL::LEFT, LLFontGL::TOP); + + text = llformat("CacheHitRate: %3.2f Read: %d/%d/%d Decode: %d/%d/%d Fetch: %d/%d/%d", + cacheHitRate, + cacheReadLatMin, + cacheReadLatMed, + cacheReadLatMax, + texDecodeLatMin, + texDecodeLatMed, + texDecodeLatMax, + texFetchLatMin, + texFetchLatMed, + texFetchLatMax); + LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, v_offset + line_height*4, text_color, LLFontGL::LEFT, LLFontGL::TOP); @@ -640,7 +674,7 @@ BOOL LLGLTexMemBar::handleMouseDown(S32 x, S32 y, MASK mask) LLRect LLGLTexMemBar::getRequiredRect() { LLRect rect; - rect.mTop = 68; //LLFontGL::getFontMonospace()->getLineHeight() * 6; + rect.mTop = 78; //LLFontGL::getFontMonospace()->getLineHeight() * 6; return rect; } @@ -736,7 +770,7 @@ LLTextureView::~LLTextureView() typedef std::pair decode_pair_t; struct compare_decode_pair { - bool operator()(const decode_pair_t& a, const decode_pair_t& b) + bool operator()(const decode_pair_t& a, const decode_pair_t& b) const { return a.first > b.first; } diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index e5a1bed48c..6e5193f6a3 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1178,9 +1178,17 @@ void LLViewerFetchedTexture::loadFromFastCache() } mInFastCacheList = FALSE; + add(LLTextureFetch::sCacheAttempt, 1.0); + + LLTimer fastCacheTimer; mRawImage = LLAppViewer::getTextureCache()->readFromFastCache(getID(), mRawDiscardLevel); if(mRawImage.notNull()) { + F32 cachReadTime = fastCacheTimer.getElapsedTimeF32(); + + add(LLTextureFetch::sCacheHit, 1.0); + sample(LLTextureFetch::sCacheReadLatency, cachReadTime); + mFullWidth = mRawImage->getWidth() << mRawDiscardLevel; mFullHeight = mRawImage->getHeight() << mRawDiscardLevel; setTexelsPerImage(); -- cgit v1.2.3 From b0e5bee0b41e050e14d4e315ffa967ba43f96feb Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Thu, 7 Jun 2018 18:46:03 +0300 Subject: MAINT-8723 - Selecting mesh objects make several HUD-related items invisible FIXED (from FS Ansariel patches) --- doc/contributions.txt | 1 + indra/newview/llhudeffectlookat.cpp | 2 ++ indra/newview/llhudeffectpointat.cpp | 1 + indra/newview/llhudicon.cpp | 1 + indra/newview/llhudnametag.cpp | 1 + indra/newview/llhudtext.cpp | 1 + indra/newview/llvoicevisualizer.cpp | 1 + 7 files changed, 8 insertions(+) diff --git a/doc/contributions.txt b/doc/contributions.txt index 90bbb1c2c6..d823e37dbd 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -220,6 +220,7 @@ Ansariel Hiller STORM-2151 MAINT-6917 MAINT-8085 + MAINT-8723 Aralara Rajal Arare Chantilly CHUIBUG-191 diff --git a/indra/newview/llhudeffectlookat.cpp b/indra/newview/llhudeffectlookat.cpp index 73120a0242..f46152dcec 100644 --- a/indra/newview/llhudeffectlookat.cpp +++ b/indra/newview/llhudeffectlookat.cpp @@ -495,6 +495,8 @@ void LLHUDEffectLookAt::render() { gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + LLGLDisable gls_stencil(GL_STENCIL_TEST); + LLVector3 target = mTargetPos + ((LLVOAvatar*)(LLViewerObject*)mSourceObject)->mHeadp->getWorldPosition(); gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.pushMatrix(); diff --git a/indra/newview/llhudeffectpointat.cpp b/indra/newview/llhudeffectpointat.cpp index 44c8db19c0..cc772c8f5c 100644 --- a/indra/newview/llhudeffectpointat.cpp +++ b/indra/newview/llhudeffectpointat.cpp @@ -322,6 +322,7 @@ void LLHUDEffectPointAt::render() update(); if (sDebugPointAt && mTargetType != POINTAT_TARGET_NONE) { + LLGLDisable gls_stencil(GL_STENCIL_TEST); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); LLVector3 target = mTargetPos + mSourceObject->getRenderPosition(); diff --git a/indra/newview/llhudicon.cpp b/indra/newview/llhudicon.cpp index 825c2b31be..85a878c4a2 100644 --- a/indra/newview/llhudicon.cpp +++ b/indra/newview/llhudicon.cpp @@ -80,6 +80,7 @@ void LLHUDIcon::renderIcon(BOOL for_select) { LLGLSUIDefault texture_state; LLGLDepthTest gls_depth(GL_TRUE); + LLGLDisable gls_stencil(GL_STENCIL_TEST); if (for_select) { gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); diff --git a/indra/newview/llhudnametag.cpp b/indra/newview/llhudnametag.cpp index c7d108b6de..81d862a827 100644 --- a/indra/newview/llhudnametag.cpp +++ b/indra/newview/llhudnametag.cpp @@ -224,6 +224,7 @@ void LLHUDNameTag::render() if (sDisplayText) { LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); + LLGLDisable gls_stencil(GL_STENCIL_TEST); renderText(FALSE); } } diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp index 6b1e196182..ef3b234f50 100644 --- a/indra/newview/llhudtext.cpp +++ b/indra/newview/llhudtext.cpp @@ -102,6 +102,7 @@ void LLHUDText::render() if (!mOnHUDAttachment && sDisplayText) { LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); + LLGLDisable gls_stencil(GL_STENCIL_TEST); renderText(); } } diff --git a/indra/newview/llvoicevisualizer.cpp b/indra/newview/llvoicevisualizer.cpp index cb83cf8fdf..6e08a2ff12 100644 --- a/indra/newview/llvoicevisualizer.cpp +++ b/indra/newview/llvoicevisualizer.cpp @@ -356,6 +356,7 @@ void LLVoiceVisualizer::render() //--------------------------------------------------------------- LLGLSPipelineAlpha alpha_blend; LLGLDepthTest depth(GL_TRUE, GL_FALSE); + LLGLDisable gls_stencil(GL_STENCIL_TEST); //------------------------------------------------------------- // create coordinates of the geometry for the dot -- cgit v1.2.3 From 0aa2e5b1a36f917512c054414d97c5a4d3a4d544 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Thu, 28 Jun 2018 19:30:19 +0100 Subject: Replace cache hit info in tex fetch debug display. Silence launcher warning for devs. Work-around path gen deciding to gen NaNs for some flexi prims. --- indra/llmath/llvolume.cpp | 7 +++++++ indra/newview/llappviewer.cpp | 3 +++ indra/newview/lltextureview.cpp | 42 +++++++++++++++++++++++++++++++++++++---- 3 files changed, 48 insertions(+), 4 deletions(-) diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 6b6cd65ce2..a34999b6fd 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -2192,6 +2192,13 @@ BOOL LLVolume::generate() LLVector4a* end_profile = profile+sizeT; LLVector4a offset = mPathp->mPath[s].mPos; + // hack to work around MAINT-5660 for debug until we can suss out + // what is wrong with the path generated that inserts NaNs... + if (!offset.isFinite3()) + { + offset.clear(); + } + LLVector4a tmp; // Run along the profile. diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index f705084bdb..261a78b2dc 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1082,6 +1082,8 @@ bool LLAppViewer::init() } } +// do not pester devs who need to run the executable directly to debug +#if LL_RELEASE_FOR_DOWNLOAD // MAINT-8305: If we're processing a SLURL, skip the launcher check. if (gSavedSettings.getString("CmdLineLoginLocation").empty()) { @@ -1098,6 +1100,7 @@ bool LLAppViewer::init() LLNotificationsUtil::add("RunLauncher"); } } +#endif #if LL_WINDOWS if (gGLManager.mGLVersion < LLFeatureManager::getInstance()->getExpectedGLVersion()) diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp index d7b95db94f..0d2edc0268 100644 --- a/indra/newview/lltextureview.cpp +++ b/indra/newview/lltextureview.cpp @@ -240,9 +240,9 @@ void LLTextureBar::draw() { "REQ", LLColor4::yellow },// SEND_HTTP_REQ { "HTP", LLColor4::green }, // WAIT_HTTP_REQ { "DEC", LLColor4::yellow },// DECODE_IMAGE - { "DEC", LLColor4::green }, // DECODE_IMAGE_UPDATE + { "DEU", LLColor4::green }, // DECODE_IMAGE_UPDATE { "WRT", LLColor4::purple },// WRITE_TO_CACHE - { "WRT", LLColor4::orange },// WAIT_ON_WRITE + { "WWT", LLColor4::orange },// WAIT_ON_WRITE { "END", LLColor4::red }, // DONE #define LAST_STATE 14 { "CRE", LLColor4::magenta }, // LAST_STATE+1 @@ -530,6 +530,25 @@ void LLGLTexMemBar::draw() LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, v_offset + line_height*6, text_color, LLFontGL::LEFT, LLFontGL::TOP); + LLTrace::Recording& recording = LLViewerStats::instance().getRecording(); + + F64 cacheHits = recording.getSampleCount(LLTextureFetch::sCacheHit); + F64 cacheAttempts = recording.getSampleCount(LLTextureFetch::sCacheAttempt); + + F32 cacheHitRate = (cacheAttempts > 0.0) ? F32((cacheHits / cacheAttempts) * 100.0f) : 0.0f; + + U32 cacheReadLatMin = U32(recording.getMin(LLTextureFetch::sCacheReadLatency).value() * 1000.0f); + U32 cacheReadLatMed = U32(recording.getMean(LLTextureFetch::sCacheReadLatency).value() * 1000.0f); + U32 cacheReadLatMax = U32(recording.getMax(LLTextureFetch::sCacheReadLatency).value() * 1000.0f); + + U32 texDecodeLatMin = U32(recording.getMin(LLTextureFetch::sTexDecodeLatency).value() * 1000.0f); + U32 texDecodeLatMed = U32(recording.getMean(LLTextureFetch::sTexDecodeLatency).value() * 1000.0f); + U32 texDecodeLatMax = U32(recording.getMax(LLTextureFetch::sTexDecodeLatency).value() * 1000.0f); + + U32 texFetchLatMin = U32(recording.getMin(LLTextureFetch::sTexFetchLatency).value() * 1000.0f); + U32 texFetchLatMed = U32(recording.getMean(LLTextureFetch::sTexFetchLatency).value() * 1000.0f); + U32 texFetchLatMax = U32(recording.getMax(LLTextureFetch::sTexFetchLatency).value() * 1000.0f); + text = llformat("GL Tot: %d/%d MB Bound: %d/%d MB FBO: %d MB Raw Tot: %d MB Bias: %.2f Cache: %.1f/%.1f MB", total_mem.value(), max_total_mem.value(), @@ -542,7 +561,7 @@ void LLGLTexMemBar::draw() cache_max_usage); //, cache_entries, cache_max_entries - LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, v_offset + line_height*5, + LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, v_offset + line_height*6, text_color, LLFontGL::LEFT, LLFontGL::TOP); U32 cache_read(0U), cache_write(0U), res_wait(0U); @@ -558,6 +577,21 @@ void LLGLTexMemBar::draw() cache_write, res_wait); + LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, v_offset + line_height*5, + text_color, LLFontGL::LEFT, LLFontGL::TOP); + + text = llformat("CacheHitRate: %3.2f Read: %d/%d/%d Decode: %d/%d/%d Fetch: %d/%d/%d", + cacheHitRate, + cacheReadLatMin, + cacheReadLatMed, + cacheReadLatMax, + texDecodeLatMin, + texDecodeLatMed, + texDecodeLatMax, + texFetchLatMin, + texFetchLatMed, + texFetchLatMax); + LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, v_offset + line_height*4, text_color, LLFontGL::LEFT, LLFontGL::TOP); @@ -640,7 +674,7 @@ BOOL LLGLTexMemBar::handleMouseDown(S32 x, S32 y, MASK mask) LLRect LLGLTexMemBar::getRequiredRect() { LLRect rect; - rect.mTop = 68; //LLFontGL::getFontMonospace()->getLineHeight() * 6; + rect.mTop = 78; //LLFontGL::getFontMonospace()->getLineHeight() * 6; return rect; } -- cgit v1.2.3 From 27679824ff756279f035c4c7f11fe7dfacc25754 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Fri, 29 Jun 2018 00:16:32 +0100 Subject: Handle grids.xml w/ single entry instead of an array. Fix crash when no login URIs are found for a given grid (does not happen after fixing above, but should not crash either). --- indra/newview/lllogininstance.cpp | 5 +++++ indra/newview/llviewernetwork.cpp | 19 +++++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index bc93fa2c20..deef3dbce7 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -113,6 +113,11 @@ void LLLoginInstance::connect(LLPointer credentials) { std::vector uris; LLGridManager::getInstance()->getLoginURIs(uris); + if (uris.size() < 1) + { + LL_WARNS() << "Failed to get login URIs during connect. No connect for you!" << LL_ENDL; + return; + } connect(uris.front(), credentials); } diff --git a/indra/newview/llviewernetwork.cpp b/indra/newview/llviewernetwork.cpp index 6937d064f9..0072baa02c 100644 --- a/indra/newview/llviewernetwork.cpp +++ b/indra/newview/llviewernetwork.cpp @@ -484,12 +484,19 @@ void LLGridManager::getLoginURIs(const std::string& grid, std::vectorasString()); - } + if (mGridList[grid_name][GRID_LOGIN_URI_VALUE].isArray()) + { + for (LLSD::array_iterator llsd_uri = mGridList[grid_name][GRID_LOGIN_URI_VALUE].beginArray(); + llsd_uri != mGridList[grid_name][GRID_LOGIN_URI_VALUE].endArray(); + llsd_uri++) + { + uris.push_back(llsd_uri->asString()); + } + } + else + { + uris.push_back(mGridList[grid_name][GRID_LOGIN_URI_VALUE].asString()); + } } else { -- cgit v1.2.3 From 82a097b06f2f89e04e99a84a237ffced1c41e5d6 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Fri, 29 Jun 2018 00:47:13 +0100 Subject: MAINT-8676 modify XUI to allow negative offsets again and fix up material handling of normal/specular offsets --- indra/llprimitive/llmaterial.cpp | 273 +++++++++++++++++++-- indra/llprimitive/llmaterial.h | 105 ++++---- .../skins/default/xui/en/panel_tools_texture.xml | 25 +- 3 files changed, 324 insertions(+), 79 deletions(-) diff --git a/indra/llprimitive/llmaterial.cpp b/indra/llprimitive/llmaterial.cpp index 57ceb3e11b..282bf6ca6b 100644 --- a/indra/llprimitive/llmaterial.cpp +++ b/indra/llprimitive/llmaterial.cpp @@ -114,23 +114,249 @@ LLMaterial::LLMaterial(const LLSD& material_data) fromLLSD(material_data); } +const LLUUID& LLMaterial::getNormalID() const +{ + return mNormalID; +} + +void LLMaterial::setNormalID(const LLUUID& normal_id) +{ + mNormalID = normal_id; +} + +void LLMaterial::getNormalOffset(F32& offset_x, F32& offset_y) const +{ + offset_x = mNormalOffsetX; + offset_y = mNormalOffsetY; +} + +F32 LLMaterial::getNormalOffsetX() const +{ + return mNormalOffsetX; +} + +F32 LLMaterial::getNormalOffsetY() const +{ + return mNormalOffsetY; +} + +void LLMaterial::setNormalOffset(F32 offset_x, F32 offset_y) +{ + mNormalOffsetX = offset_x; + mNormalOffsetY = offset_y; +} + +void LLMaterial::setNormalOffsetX(F32 offset_x) +{ + mNormalOffsetX = offset_x; +} + +void LLMaterial::setNormalOffsetY(F32 offset_y) +{ + mNormalOffsetY = offset_y; +} + +void LLMaterial::getNormalRepeat(F32& repeat_x, F32& repeat_y) const +{ + repeat_x = mNormalRepeatX; + repeat_y = mNormalRepeatY; +} + +F32 LLMaterial::getNormalRepeatX() const +{ + return mNormalRepeatX; +} + +F32 LLMaterial::getNormalRepeatY() const +{ + return mNormalRepeatY; +} + +void LLMaterial::setNormalRepeat(F32 repeat_x, F32 repeat_y) +{ + mNormalRepeatX = repeat_x; + mNormalRepeatY = repeat_y; +} + +void LLMaterial::setNormalRepeatX(F32 repeat_x) +{ + mNormalRepeatX = repeat_x; +} + +void LLMaterial::setNormalRepeatY(F32 repeat_y) +{ + mNormalRepeatY = repeat_y; +} + +F32 LLMaterial::getNormalRotation() const +{ + return mNormalRotation; +} + +void LLMaterial::setNormalRotation(F32 rot) +{ + mNormalRotation = rot; +} + +const LLUUID& LLMaterial::getSpecularID() const +{ + return mSpecularID; +} + +void LLMaterial::setSpecularID(const LLUUID& specular_id) +{ + mSpecularID = specular_id; +} + +void LLMaterial::getSpecularOffset(F32& offset_x, F32& offset_y) const +{ + offset_x = mSpecularOffsetX; + offset_y = mSpecularOffsetY; +} + +F32 LLMaterial::getSpecularOffsetX() const +{ + return mSpecularOffsetX; +} + +F32 LLMaterial::getSpecularOffsetY() const +{ + return mSpecularOffsetY; +} + +void LLMaterial::setSpecularOffset(F32 offset_x, F32 offset_y) +{ + mSpecularOffsetX = offset_x; + mSpecularOffsetY = offset_y; +} + +void LLMaterial::setSpecularOffsetX(F32 offset_x) +{ + mSpecularOffsetX = offset_x; +} + +void LLMaterial::setSpecularOffsetY(F32 offset_y) +{ + mSpecularOffsetY = offset_y; +} + +void LLMaterial::getSpecularRepeat(F32& repeat_x, F32& repeat_y) const +{ + repeat_x = mSpecularRepeatX; + repeat_y = mSpecularRepeatY; +} + +F32 LLMaterial::getSpecularRepeatX() const +{ + return mSpecularRepeatX; +} + +F32 LLMaterial::getSpecularRepeatY() const +{ + return mSpecularRepeatY; +} + +void LLMaterial::setSpecularRepeat(F32 repeat_x, F32 repeat_y) +{ + mSpecularRepeatX = repeat_x; mSpecularRepeatY = repeat_y; +} + +void LLMaterial::setSpecularRepeatX(F32 repeat_x) +{ + mSpecularRepeatX = repeat_x; +} + +void LLMaterial::setSpecularRepeatY(F32 repeat_y) +{ + mSpecularRepeatY = repeat_y; +} + +F32 LLMaterial::getSpecularRotation() const +{ + return mSpecularRotation; +} + +void LLMaterial::setSpecularRotation(F32 rot) +{ + mSpecularRotation = rot; +} + +const LLColor4U LLMaterial::getSpecularLightColor() const +{ + return mSpecularLightColor; +} + +void LLMaterial::setSpecularLightColor(const LLColor4U& color) +{ + mSpecularLightColor = color; +} + +U8 LLMaterial::getSpecularLightExponent() const +{ + return mSpecularLightExponent; +} + +void LLMaterial::setSpecularLightExponent(U8 exponent) +{ + mSpecularLightExponent = exponent; +} + +U8 LLMaterial::getEnvironmentIntensity() const +{ + return mEnvironmentIntensity; +} + +void LLMaterial::setEnvironmentIntensity(U8 intensity) +{ + mEnvironmentIntensity = intensity; +} + +U8 LLMaterial::getDiffuseAlphaMode() const +{ + return mDiffuseAlphaMode; +} + +void LLMaterial::setDiffuseAlphaMode(U8 alpha_mode) +{ + mDiffuseAlphaMode = alpha_mode; +} + +U8 LLMaterial::getAlphaMaskCutoff() const +{ + return mAlphaMaskCutoff; +} + +void LLMaterial::setAlphaMaskCutoff(U8 cutoff) +{ + mAlphaMaskCutoff = cutoff; +} + LLSD LLMaterial::asLLSD() const { LLSD material_data; + S32 normalOffsetXInt = ll_round(mNormalOffsetX * MATERIALS_MULTIPLIER); + S32 normalOffsetYInt = ll_round(mNormalOffsetY * MATERIALS_MULTIPLIER); + S32 normalRotInt = ll_round(mNormalRotation * MATERIALS_MULTIPLIER); + material_data[MATERIALS_CAP_NORMAL_MAP_FIELD] = mNormalID; - material_data[MATERIALS_CAP_NORMAL_MAP_OFFSET_X_FIELD] = ll_round(mNormalOffsetX * MATERIALS_MULTIPLIER); - material_data[MATERIALS_CAP_NORMAL_MAP_OFFSET_Y_FIELD] = ll_round(mNormalOffsetY * MATERIALS_MULTIPLIER); + material_data[MATERIALS_CAP_NORMAL_MAP_OFFSET_X_FIELD] = normalOffsetXInt; + material_data[MATERIALS_CAP_NORMAL_MAP_OFFSET_Y_FIELD] = normalOffsetYInt; material_data[MATERIALS_CAP_NORMAL_MAP_REPEAT_X_FIELD] = ll_round(mNormalRepeatX * MATERIALS_MULTIPLIER); material_data[MATERIALS_CAP_NORMAL_MAP_REPEAT_Y_FIELD] = ll_round(mNormalRepeatY * MATERIALS_MULTIPLIER); - material_data[MATERIALS_CAP_NORMAL_MAP_ROTATION_FIELD] = ll_round(mNormalRotation * MATERIALS_MULTIPLIER); + material_data[MATERIALS_CAP_NORMAL_MAP_ROTATION_FIELD] = normalRotInt; material_data[MATERIALS_CAP_SPECULAR_MAP_FIELD] = mSpecularID; - material_data[MATERIALS_CAP_SPECULAR_MAP_OFFSET_X_FIELD] = ll_round(mSpecularOffsetX * MATERIALS_MULTIPLIER); - material_data[MATERIALS_CAP_SPECULAR_MAP_OFFSET_Y_FIELD] = ll_round(mSpecularOffsetY * MATERIALS_MULTIPLIER); + + S32 specularOffsetXInt = ll_round(mSpecularOffsetX * MATERIALS_MULTIPLIER); + S32 specularOffsetYInt = ll_round(mSpecularOffsetY * MATERIALS_MULTIPLIER); + S32 specularRotInt = ll_round(mSpecularRotation * MATERIALS_MULTIPLIER); + + material_data[MATERIALS_CAP_SPECULAR_MAP_OFFSET_X_FIELD] = specularOffsetXInt; + material_data[MATERIALS_CAP_SPECULAR_MAP_OFFSET_Y_FIELD] = specularOffsetYInt; material_data[MATERIALS_CAP_SPECULAR_MAP_REPEAT_X_FIELD] = ll_round(mSpecularRepeatX * MATERIALS_MULTIPLIER); material_data[MATERIALS_CAP_SPECULAR_MAP_REPEAT_Y_FIELD] = ll_round(mSpecularRepeatY * MATERIALS_MULTIPLIER); - material_data[MATERIALS_CAP_SPECULAR_MAP_ROTATION_FIELD] = ll_round(mSpecularRotation * MATERIALS_MULTIPLIER); + material_data[MATERIALS_CAP_SPECULAR_MAP_ROTATION_FIELD] = specularRotInt; material_data[MATERIALS_CAP_SPECULAR_COLOR_FIELD] = mSpecularLightColor.getValue(); material_data[MATERIALS_CAP_SPECULAR_EXP_FIELD] = mSpecularLightExponent; @@ -144,18 +370,33 @@ LLSD LLMaterial::asLLSD() const void LLMaterial::fromLLSD(const LLSD& material_data) { mNormalID = getMaterialField(material_data, MATERIALS_CAP_NORMAL_MAP_FIELD, LLSD::TypeUUID); - mNormalOffsetX = (F32)getMaterialField(material_data, MATERIALS_CAP_NORMAL_MAP_OFFSET_X_FIELD, LLSD::TypeInteger) / MATERIALS_MULTIPLIER; - mNormalOffsetY = (F32)getMaterialField(material_data, MATERIALS_CAP_NORMAL_MAP_OFFSET_Y_FIELD, LLSD::TypeInteger) / MATERIALS_MULTIPLIER; - mNormalRepeatX = (F32)getMaterialField(material_data, MATERIALS_CAP_NORMAL_MAP_REPEAT_X_FIELD, LLSD::TypeInteger) / MATERIALS_MULTIPLIER; - mNormalRepeatY = (F32)getMaterialField(material_data, MATERIALS_CAP_NORMAL_MAP_REPEAT_Y_FIELD, LLSD::TypeInteger) / MATERIALS_MULTIPLIER; - mNormalRotation = (F32)getMaterialField(material_data, MATERIALS_CAP_NORMAL_MAP_ROTATION_FIELD, LLSD::TypeInteger) / MATERIALS_MULTIPLIER; + + S32 normalOffsetXInt = getMaterialField(material_data, MATERIALS_CAP_NORMAL_MAP_OFFSET_X_FIELD, LLSD::TypeInteger); + S32 normalOffsetYInt = getMaterialField(material_data, MATERIALS_CAP_NORMAL_MAP_OFFSET_Y_FIELD, LLSD::TypeInteger); + S32 normalRotInt = getMaterialField(material_data, MATERIALS_CAP_NORMAL_MAP_ROTATION_FIELD, LLSD::TypeInteger); + + mNormalOffsetX = F32(normalOffsetXInt) / MATERIALS_MULTIPLIER; + mNormalOffsetY = F32(normalOffsetYInt) / MATERIALS_MULTIPLIER; + mNormalRotation = F32(normalRotInt) / MATERIALS_MULTIPLIER; + + mNormalOffsetY = ((F32)getMaterialField(material_data, MATERIALS_CAP_NORMAL_MAP_OFFSET_Y_FIELD, LLSD::TypeInteger)) / MATERIALS_MULTIPLIER; + mNormalRepeatX = ((F32)getMaterialField(material_data, MATERIALS_CAP_NORMAL_MAP_REPEAT_X_FIELD, LLSD::TypeInteger)) / MATERIALS_MULTIPLIER; + mNormalRepeatY = ((F32)getMaterialField(material_data, MATERIALS_CAP_NORMAL_MAP_REPEAT_Y_FIELD, LLSD::TypeInteger)) / MATERIALS_MULTIPLIER; mSpecularID = getMaterialField(material_data, MATERIALS_CAP_SPECULAR_MAP_FIELD, LLSD::TypeUUID); - mSpecularOffsetX = (F32)getMaterialField(material_data, MATERIALS_CAP_SPECULAR_MAP_OFFSET_X_FIELD, LLSD::TypeInteger) / MATERIALS_MULTIPLIER; - mSpecularOffsetY = (F32)getMaterialField(material_data, MATERIALS_CAP_SPECULAR_MAP_OFFSET_Y_FIELD, LLSD::TypeInteger) / MATERIALS_MULTIPLIER; - mSpecularRepeatX = (F32)getMaterialField(material_data, MATERIALS_CAP_SPECULAR_MAP_REPEAT_X_FIELD, LLSD::TypeInteger) / MATERIALS_MULTIPLIER; - mSpecularRepeatY = (F32)getMaterialField(material_data, MATERIALS_CAP_SPECULAR_MAP_REPEAT_Y_FIELD, LLSD::TypeInteger) / MATERIALS_MULTIPLIER; - mSpecularRotation = (F32)getMaterialField(material_data, MATERIALS_CAP_SPECULAR_MAP_ROTATION_FIELD, LLSD::TypeInteger) / MATERIALS_MULTIPLIER; + + S32 specularOffsetXInt = getMaterialField(material_data, MATERIALS_CAP_SPECULAR_MAP_OFFSET_X_FIELD, LLSD::TypeInteger); + S32 specularOffsetYInt = getMaterialField(material_data, MATERIALS_CAP_SPECULAR_MAP_OFFSET_Y_FIELD, LLSD::TypeInteger); + S32 specularRotInt = getMaterialField(material_data, MATERIALS_CAP_SPECULAR_MAP_ROTATION_FIELD, LLSD::TypeInteger); + + mSpecularOffsetX = F32(specularOffsetXInt) / MATERIALS_MULTIPLIER; + mSpecularOffsetY = F32(specularOffsetYInt) / MATERIALS_MULTIPLIER; + mSpecularRotation = F32(specularRotInt) / MATERIALS_MULTIPLIER; + + mSpecularOffsetY = ((F32)getMaterialField(material_data, MATERIALS_CAP_SPECULAR_MAP_OFFSET_Y_FIELD, LLSD::TypeInteger)) / MATERIALS_MULTIPLIER; + mSpecularRepeatX = ((F32)getMaterialField(material_data, MATERIALS_CAP_SPECULAR_MAP_REPEAT_X_FIELD, LLSD::TypeInteger)) / MATERIALS_MULTIPLIER; + mSpecularRepeatY = ((F32)getMaterialField(material_data, MATERIALS_CAP_SPECULAR_MAP_REPEAT_Y_FIELD, LLSD::TypeInteger)) / MATERIALS_MULTIPLIER; + mSpecularRotation = ((F32)getMaterialField(material_data, MATERIALS_CAP_SPECULAR_MAP_ROTATION_FIELD, LLSD::TypeInteger)) / MATERIALS_MULTIPLIER; mSpecularLightColor.setValue(getMaterialField(material_data, MATERIALS_CAP_SPECULAR_COLOR_FIELD, LLSD::TypeArray)); mSpecularLightExponent = (U8)getMaterialField(material_data, MATERIALS_CAP_SPECULAR_EXP_FIELD, LLSD::TypeInteger); diff --git a/indra/llprimitive/llmaterial.h b/indra/llprimitive/llmaterial.h index 9f52a3f6c1..64976e508b 100644 --- a/indra/llprimitive/llmaterial.h +++ b/indra/llprimitive/llmaterial.h @@ -66,58 +66,59 @@ public: LLSD asLLSD() const; void fromLLSD(const LLSD& material_data); - const LLUUID& getNormalID() const { return mNormalID; } - void setNormalID(const LLUUID& normal_id) { mNormalID = normal_id; } - void getNormalOffset(F32& offset_x, F32& offset_y) const { offset_x = mNormalOffsetX; offset_y = mNormalOffsetY; } - F32 getNormalOffsetX() const { return mNormalOffsetX; } - F32 getNormalOffsetY() const { return mNormalOffsetY; } - - void setNormalOffset(F32 offset_x, F32 offset_y) { mNormalOffsetX = offset_x; mNormalOffsetY = offset_y; } - void setNormalOffsetX(F32 offset_x) { mNormalOffsetX = offset_x; } - void setNormalOffsetY(F32 offset_y) { mNormalOffsetY = offset_y; } - - void getNormalRepeat(F32& repeat_x, F32& repeat_y) const { repeat_x = mNormalRepeatX; repeat_y = mNormalRepeatY; } - F32 getNormalRepeatX() const { return mNormalRepeatX; } - F32 getNormalRepeatY() const { return mNormalRepeatY; } - - void setNormalRepeat(F32 repeat_x, F32 repeat_y) { mNormalRepeatX = repeat_x; mNormalRepeatY = repeat_y; } - void setNormalRepeatX(F32 repeat_x) { mNormalRepeatX = repeat_x; } - void setNormalRepeatY(F32 repeat_y) { mNormalRepeatY = repeat_y; } - - F32 getNormalRotation() const { return mNormalRotation; } - void setNormalRotation(F32 rot) { mNormalRotation = rot; } - - const LLUUID& getSpecularID() const { return mSpecularID; } - void setSpecularID(const LLUUID& specular_id) { mSpecularID = specular_id; } - void getSpecularOffset(F32& offset_x, F32& offset_y) const { offset_x = mSpecularOffsetX; offset_y = mSpecularOffsetY; } - F32 getSpecularOffsetX() const { return mSpecularOffsetX; } - F32 getSpecularOffsetY() const { return mSpecularOffsetY; } - - void setSpecularOffset(F32 offset_x, F32 offset_y) { mSpecularOffsetX = offset_x; mSpecularOffsetY = offset_y; } - void setSpecularOffsetX(F32 offset_x) { mSpecularOffsetX = offset_x; } - void setSpecularOffsetY(F32 offset_y) { mSpecularOffsetY = offset_y; } - - void getSpecularRepeat(F32& repeat_x, F32& repeat_y) const { repeat_x = mSpecularRepeatX; repeat_y = mSpecularRepeatY; } - F32 getSpecularRepeatX() const { return mSpecularRepeatX; } - F32 getSpecularRepeatY() const { return mSpecularRepeatY; } - - void setSpecularRepeat(F32 repeat_x, F32 repeat_y) { mSpecularRepeatX = repeat_x; mSpecularRepeatY = repeat_y; } - void setSpecularRepeatX(F32 repeat_x) { mSpecularRepeatX = repeat_x; } - void setSpecularRepeatY(F32 repeat_y) { mSpecularRepeatY = repeat_y; } - - F32 getSpecularRotation() const { return mSpecularRotation; } - void setSpecularRotation(F32 rot) { mSpecularRotation = rot; } - - const LLColor4U getSpecularLightColor() const { return mSpecularLightColor; } - void setSpecularLightColor(const LLColor4U& color) { mSpecularLightColor = color; } - U8 getSpecularLightExponent() const { return mSpecularLightExponent; } - void setSpecularLightExponent(U8 exponent) { mSpecularLightExponent = exponent; } - U8 getEnvironmentIntensity() const { return mEnvironmentIntensity; } - void setEnvironmentIntensity(U8 intensity) { mEnvironmentIntensity = intensity; } - U8 getDiffuseAlphaMode() const { return mDiffuseAlphaMode; } - void setDiffuseAlphaMode(U8 alpha_mode) { mDiffuseAlphaMode = alpha_mode; } - U8 getAlphaMaskCutoff() const { return mAlphaMaskCutoff; } - void setAlphaMaskCutoff(U8 cutoff) { mAlphaMaskCutoff = cutoff; } + const LLUUID& getNormalID() const; + void setNormalID(const LLUUID& normal_id); + + void getNormalOffset(F32& offset_x, F32& offset_y) const; + F32 getNormalOffsetX() const; + F32 getNormalOffsetY() const; + + void setNormalOffset(F32 offset_x, F32 offset_y); + void setNormalOffsetX(F32 offset_x); + void setNormalOffsetY(F32 offset_y); + + void getNormalRepeat(F32& repeat_x, F32& repeat_y) const; + F32 getNormalRepeatX() const; + F32 getNormalRepeatY() const; + + void setNormalRepeat(F32 repeat_x, F32 repeat_y); + void setNormalRepeatX(F32 repeat_x); + void setNormalRepeatY(F32 repeat_y); + + F32 getNormalRotation() const; + void setNormalRotation(F32 rot); + + const LLUUID& getSpecularID() const; + void setSpecularID(const LLUUID& specular_id); + void getSpecularOffset(F32& offset_x, F32& offset_y) const; + F32 getSpecularOffsetX() const; + F32 getSpecularOffsetY() const; + + void setSpecularOffset(F32 offset_x, F32 offset_y); + void setSpecularOffsetX(F32 offset_x); + void setSpecularOffsetY(F32 offset_y); + + void getSpecularRepeat(F32& repeat_x, F32& repeat_y) const; + F32 getSpecularRepeatX() const; + F32 getSpecularRepeatY() const; + + void setSpecularRepeat(F32 repeat_x, F32 repeat_y); + void setSpecularRepeatX(F32 repeat_x); + void setSpecularRepeatY(F32 repeat_y); + + F32 getSpecularRotation() const; + void setSpecularRotation(F32 rot); + + const LLColor4U getSpecularLightColor() const; + void setSpecularLightColor(const LLColor4U& color); + U8 getSpecularLightExponent() const; + void setSpecularLightExponent(U8 exponent); + U8 getEnvironmentIntensity() const; + void setEnvironmentIntensity(U8 intensity); + U8 getDiffuseAlphaMode() const; + void setDiffuseAlphaMode(U8 alpha_mode); + U8 getAlphaMaskCutoff() const; + void setAlphaMaskCutoff(U8 cutoff); bool isNull() const; static const LLMaterial null; diff --git a/indra/newview/skins/default/xui/en/panel_tools_texture.xml b/indra/newview/skins/default/xui/en/panel_tools_texture.xml index 8c769d87de..67b99ca588 100644 --- a/indra/newview/skins/default/xui/en/panel_tools_texture.xml +++ b/indra/newview/skins/default/xui/en/panel_tools_texture.xml @@ -603,11 +603,10 @@ layout="topleft" label_width="205" left="10" - max_val="9999" - min_val="-9999" + max_val="360" + min_val="-360" name="TexRot" width="265" /> - - - Date: Fri, 29 Jun 2018 17:22:51 +0300 Subject: MAINT-8335 Derendering Avatar type also derenders some rezzed mesh objects Fixed --- indra/newview/pipeline.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index e541c1054e..5699d47ad8 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -2514,8 +2514,8 @@ void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_cl LLSpatialPartition* part = region->getSpatialPartition(i); if (part) { - if (hasRenderType(part->mDrawableType)) - { + if (LLViewerRegion::PARTITION_BRIDGE == i || hasRenderType(part->mDrawableType)) + { //pass PARTITION BRIDGE because LLDrawable can be moved to this partition part->cull(camera); } } -- cgit v1.2.3 From 3008962f0c990f4bfd270bee38152d2531ddfcd2 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Fri, 29 Jun 2018 21:21:46 +0100 Subject: Convert tabs to spaces in llprimitive/llmaterial.* for sanity --- indra/llprimitive/llmaterial.cpp | 212 +++++++++++++++++++------------------- indra/llprimitive/llmaterial.h | 214 +++++++++++++++++++-------------------- 2 files changed, 213 insertions(+), 213 deletions(-) diff --git a/indra/llprimitive/llmaterial.cpp b/indra/llprimitive/llmaterial.cpp index 282bf6ca6b..c0fefaae73 100644 --- a/indra/llprimitive/llmaterial.cpp +++ b/indra/llprimitive/llmaterial.cpp @@ -65,23 +65,23 @@ const F32 MATERIALS_MULTIPLIER = 10000.f; template T getMaterialField(const LLSD& data, const std::string& field, const LLSD::Type field_type) { - if ( (data.has(field)) && (field_type == data[field].type()) ) - { - return (T)data[field]; - } - LL_ERRS() << "Missing or mistyped field '" << field << "' in material definition" << LL_ENDL; - return (T)LLSD(); + if ( (data.has(field)) && (field_type == data[field].type()) ) + { + return (T)data[field]; + } + LL_ERRS() << "Missing or mistyped field '" << field << "' in material definition" << LL_ENDL; + return (T)LLSD(); } // GCC didn't like the generic form above for some reason template<> LLUUID getMaterialField(const LLSD& data, const std::string& field, const LLSD::Type field_type) { - if ( (data.has(field)) && (field_type == data[field].type()) ) - { - return data[field].asUUID(); - } - LL_ERRS() << "Missing or mistyped field '" << field << "' in material definition" << LL_ENDL; - return LLUUID::null; + if ( (data.has(field)) && (field_type == data[field].type()) ) + { + return data[field].asUUID(); + } + LL_ERRS() << "Missing or mistyped field '" << field << "' in material definition" << LL_ENDL; + return LLUUID::null; } /** @@ -91,27 +91,27 @@ template<> LLUUID getMaterialField(const LLSD& data, const std::string& field, c const LLMaterial LLMaterial::null; LLMaterial::LLMaterial() - : mNormalOffsetX(0.0f) - , mNormalOffsetY(0.0f) - , mNormalRepeatX(1.0f) - , mNormalRepeatY(1.0f) - , mNormalRotation(0.0f) - , mSpecularOffsetX(0.0f) - , mSpecularOffsetY(0.0f) - , mSpecularRepeatX(1.0f) - , mSpecularRepeatY(1.0f) - , mSpecularRotation(0.0f) - , mSpecularLightColor(LLMaterial::DEFAULT_SPECULAR_LIGHT_COLOR) - , mSpecularLightExponent(LLMaterial::DEFAULT_SPECULAR_LIGHT_EXPONENT) - , mEnvironmentIntensity(LLMaterial::DEFAULT_ENV_INTENSITY) - , mDiffuseAlphaMode(LLMaterial::DIFFUSE_ALPHA_MODE_BLEND) - , mAlphaMaskCutoff(0) + : mNormalOffsetX(0.0f) + , mNormalOffsetY(0.0f) + , mNormalRepeatX(1.0f) + , mNormalRepeatY(1.0f) + , mNormalRotation(0.0f) + , mSpecularOffsetX(0.0f) + , mSpecularOffsetY(0.0f) + , mSpecularRepeatX(1.0f) + , mSpecularRepeatY(1.0f) + , mSpecularRotation(0.0f) + , mSpecularLightColor(LLMaterial::DEFAULT_SPECULAR_LIGHT_COLOR) + , mSpecularLightExponent(LLMaterial::DEFAULT_SPECULAR_LIGHT_EXPONENT) + , mEnvironmentIntensity(LLMaterial::DEFAULT_ENV_INTENSITY) + , mDiffuseAlphaMode(LLMaterial::DIFFUSE_ALPHA_MODE_BLEND) + , mAlphaMaskCutoff(0) { } LLMaterial::LLMaterial(const LLSD& material_data) { - fromLLSD(material_data); + fromLLSD(material_data); } const LLUUID& LLMaterial::getNormalID() const @@ -333,136 +333,136 @@ void LLMaterial::setAlphaMaskCutoff(U8 cutoff) LLSD LLMaterial::asLLSD() const { - LLSD material_data; + LLSD material_data; S32 normalOffsetXInt = ll_round(mNormalOffsetX * MATERIALS_MULTIPLIER); S32 normalOffsetYInt = ll_round(mNormalOffsetY * MATERIALS_MULTIPLIER); S32 normalRotInt = ll_round(mNormalRotation * MATERIALS_MULTIPLIER); - material_data[MATERIALS_CAP_NORMAL_MAP_FIELD] = mNormalID; - material_data[MATERIALS_CAP_NORMAL_MAP_OFFSET_X_FIELD] = normalOffsetXInt; - material_data[MATERIALS_CAP_NORMAL_MAP_OFFSET_Y_FIELD] = normalOffsetYInt; - material_data[MATERIALS_CAP_NORMAL_MAP_REPEAT_X_FIELD] = ll_round(mNormalRepeatX * MATERIALS_MULTIPLIER); - material_data[MATERIALS_CAP_NORMAL_MAP_REPEAT_Y_FIELD] = ll_round(mNormalRepeatY * MATERIALS_MULTIPLIER); - material_data[MATERIALS_CAP_NORMAL_MAP_ROTATION_FIELD] = normalRotInt; + material_data[MATERIALS_CAP_NORMAL_MAP_FIELD] = mNormalID; + material_data[MATERIALS_CAP_NORMAL_MAP_OFFSET_X_FIELD] = normalOffsetXInt; + material_data[MATERIALS_CAP_NORMAL_MAP_OFFSET_Y_FIELD] = normalOffsetYInt; + material_data[MATERIALS_CAP_NORMAL_MAP_REPEAT_X_FIELD] = ll_round(mNormalRepeatX * MATERIALS_MULTIPLIER); + material_data[MATERIALS_CAP_NORMAL_MAP_REPEAT_Y_FIELD] = ll_round(mNormalRepeatY * MATERIALS_MULTIPLIER); + material_data[MATERIALS_CAP_NORMAL_MAP_ROTATION_FIELD] = normalRotInt; - material_data[MATERIALS_CAP_SPECULAR_MAP_FIELD] = mSpecularID; + material_data[MATERIALS_CAP_SPECULAR_MAP_FIELD] = mSpecularID; S32 specularOffsetXInt = ll_round(mSpecularOffsetX * MATERIALS_MULTIPLIER); S32 specularOffsetYInt = ll_round(mSpecularOffsetY * MATERIALS_MULTIPLIER); S32 specularRotInt = ll_round(mSpecularRotation * MATERIALS_MULTIPLIER); - material_data[MATERIALS_CAP_SPECULAR_MAP_OFFSET_X_FIELD] = specularOffsetXInt; - material_data[MATERIALS_CAP_SPECULAR_MAP_OFFSET_Y_FIELD] = specularOffsetYInt; - material_data[MATERIALS_CAP_SPECULAR_MAP_REPEAT_X_FIELD] = ll_round(mSpecularRepeatX * MATERIALS_MULTIPLIER); - material_data[MATERIALS_CAP_SPECULAR_MAP_REPEAT_Y_FIELD] = ll_round(mSpecularRepeatY * MATERIALS_MULTIPLIER); - material_data[MATERIALS_CAP_SPECULAR_MAP_ROTATION_FIELD] = specularRotInt; + material_data[MATERIALS_CAP_SPECULAR_MAP_OFFSET_X_FIELD] = specularOffsetXInt; + material_data[MATERIALS_CAP_SPECULAR_MAP_OFFSET_Y_FIELD] = specularOffsetYInt; + material_data[MATERIALS_CAP_SPECULAR_MAP_REPEAT_X_FIELD] = ll_round(mSpecularRepeatX * MATERIALS_MULTIPLIER); + material_data[MATERIALS_CAP_SPECULAR_MAP_REPEAT_Y_FIELD] = ll_round(mSpecularRepeatY * MATERIALS_MULTIPLIER); + material_data[MATERIALS_CAP_SPECULAR_MAP_ROTATION_FIELD] = specularRotInt; - material_data[MATERIALS_CAP_SPECULAR_COLOR_FIELD] = mSpecularLightColor.getValue(); - material_data[MATERIALS_CAP_SPECULAR_EXP_FIELD] = mSpecularLightExponent; - material_data[MATERIALS_CAP_ENV_INTENSITY_FIELD] = mEnvironmentIntensity; - material_data[MATERIALS_CAP_DIFFUSE_ALPHA_MODE_FIELD] = mDiffuseAlphaMode; - material_data[MATERIALS_CAP_ALPHA_MASK_CUTOFF_FIELD] = mAlphaMaskCutoff; + material_data[MATERIALS_CAP_SPECULAR_COLOR_FIELD] = mSpecularLightColor.getValue(); + material_data[MATERIALS_CAP_SPECULAR_EXP_FIELD] = mSpecularLightExponent; + material_data[MATERIALS_CAP_ENV_INTENSITY_FIELD] = mEnvironmentIntensity; + material_data[MATERIALS_CAP_DIFFUSE_ALPHA_MODE_FIELD] = mDiffuseAlphaMode; + material_data[MATERIALS_CAP_ALPHA_MASK_CUTOFF_FIELD] = mAlphaMaskCutoff; - return material_data; + return material_data; } void LLMaterial::fromLLSD(const LLSD& material_data) { - mNormalID = getMaterialField(material_data, MATERIALS_CAP_NORMAL_MAP_FIELD, LLSD::TypeUUID); + mNormalID = getMaterialField(material_data, MATERIALS_CAP_NORMAL_MAP_FIELD, LLSD::TypeUUID); S32 normalOffsetXInt = getMaterialField(material_data, MATERIALS_CAP_NORMAL_MAP_OFFSET_X_FIELD, LLSD::TypeInteger); S32 normalOffsetYInt = getMaterialField(material_data, MATERIALS_CAP_NORMAL_MAP_OFFSET_Y_FIELD, LLSD::TypeInteger); S32 normalRotInt = getMaterialField(material_data, MATERIALS_CAP_NORMAL_MAP_ROTATION_FIELD, LLSD::TypeInteger); - mNormalOffsetX = F32(normalOffsetXInt) / MATERIALS_MULTIPLIER; + mNormalOffsetX = F32(normalOffsetXInt) / MATERIALS_MULTIPLIER; mNormalOffsetY = F32(normalOffsetYInt) / MATERIALS_MULTIPLIER; mNormalRotation = F32(normalRotInt) / MATERIALS_MULTIPLIER; - mNormalOffsetY = ((F32)getMaterialField(material_data, MATERIALS_CAP_NORMAL_MAP_OFFSET_Y_FIELD, LLSD::TypeInteger)) / MATERIALS_MULTIPLIER; - mNormalRepeatX = ((F32)getMaterialField(material_data, MATERIALS_CAP_NORMAL_MAP_REPEAT_X_FIELD, LLSD::TypeInteger)) / MATERIALS_MULTIPLIER; - mNormalRepeatY = ((F32)getMaterialField(material_data, MATERIALS_CAP_NORMAL_MAP_REPEAT_Y_FIELD, LLSD::TypeInteger)) / MATERIALS_MULTIPLIER; + mNormalOffsetY = ((F32)getMaterialField(material_data, MATERIALS_CAP_NORMAL_MAP_OFFSET_Y_FIELD, LLSD::TypeInteger)) / MATERIALS_MULTIPLIER; + mNormalRepeatX = ((F32)getMaterialField(material_data, MATERIALS_CAP_NORMAL_MAP_REPEAT_X_FIELD, LLSD::TypeInteger)) / MATERIALS_MULTIPLIER; + mNormalRepeatY = ((F32)getMaterialField(material_data, MATERIALS_CAP_NORMAL_MAP_REPEAT_Y_FIELD, LLSD::TypeInteger)) / MATERIALS_MULTIPLIER; - mSpecularID = getMaterialField(material_data, MATERIALS_CAP_SPECULAR_MAP_FIELD, LLSD::TypeUUID); + mSpecularID = getMaterialField(material_data, MATERIALS_CAP_SPECULAR_MAP_FIELD, LLSD::TypeUUID); S32 specularOffsetXInt = getMaterialField(material_data, MATERIALS_CAP_SPECULAR_MAP_OFFSET_X_FIELD, LLSD::TypeInteger); S32 specularOffsetYInt = getMaterialField(material_data, MATERIALS_CAP_SPECULAR_MAP_OFFSET_Y_FIELD, LLSD::TypeInteger); S32 specularRotInt = getMaterialField(material_data, MATERIALS_CAP_SPECULAR_MAP_ROTATION_FIELD, LLSD::TypeInteger); - mSpecularOffsetX = F32(specularOffsetXInt) / MATERIALS_MULTIPLIER; + mSpecularOffsetX = F32(specularOffsetXInt) / MATERIALS_MULTIPLIER; mSpecularOffsetY = F32(specularOffsetYInt) / MATERIALS_MULTIPLIER; mSpecularRotation = F32(specularRotInt) / MATERIALS_MULTIPLIER; - mSpecularOffsetY = ((F32)getMaterialField(material_data, MATERIALS_CAP_SPECULAR_MAP_OFFSET_Y_FIELD, LLSD::TypeInteger)) / MATERIALS_MULTIPLIER; - mSpecularRepeatX = ((F32)getMaterialField(material_data, MATERIALS_CAP_SPECULAR_MAP_REPEAT_X_FIELD, LLSD::TypeInteger)) / MATERIALS_MULTIPLIER; - mSpecularRepeatY = ((F32)getMaterialField(material_data, MATERIALS_CAP_SPECULAR_MAP_REPEAT_Y_FIELD, LLSD::TypeInteger)) / MATERIALS_MULTIPLIER; - mSpecularRotation = ((F32)getMaterialField(material_data, MATERIALS_CAP_SPECULAR_MAP_ROTATION_FIELD, LLSD::TypeInteger)) / MATERIALS_MULTIPLIER; + mSpecularOffsetY = ((F32)getMaterialField(material_data, MATERIALS_CAP_SPECULAR_MAP_OFFSET_Y_FIELD, LLSD::TypeInteger)) / MATERIALS_MULTIPLIER; + mSpecularRepeatX = ((F32)getMaterialField(material_data, MATERIALS_CAP_SPECULAR_MAP_REPEAT_X_FIELD, LLSD::TypeInteger)) / MATERIALS_MULTIPLIER; + mSpecularRepeatY = ((F32)getMaterialField(material_data, MATERIALS_CAP_SPECULAR_MAP_REPEAT_Y_FIELD, LLSD::TypeInteger)) / MATERIALS_MULTIPLIER; + mSpecularRotation = ((F32)getMaterialField(material_data, MATERIALS_CAP_SPECULAR_MAP_ROTATION_FIELD, LLSD::TypeInteger)) / MATERIALS_MULTIPLIER; - mSpecularLightColor.setValue(getMaterialField(material_data, MATERIALS_CAP_SPECULAR_COLOR_FIELD, LLSD::TypeArray)); - mSpecularLightExponent = (U8)getMaterialField(material_data, MATERIALS_CAP_SPECULAR_EXP_FIELD, LLSD::TypeInteger); - mEnvironmentIntensity = (U8)getMaterialField(material_data, MATERIALS_CAP_ENV_INTENSITY_FIELD, LLSD::TypeInteger); - mDiffuseAlphaMode = (U8)getMaterialField(material_data, MATERIALS_CAP_DIFFUSE_ALPHA_MODE_FIELD, LLSD::TypeInteger); - mAlphaMaskCutoff = (U8)getMaterialField(material_data, MATERIALS_CAP_ALPHA_MASK_CUTOFF_FIELD, LLSD::TypeInteger); + mSpecularLightColor.setValue(getMaterialField(material_data, MATERIALS_CAP_SPECULAR_COLOR_FIELD, LLSD::TypeArray)); + mSpecularLightExponent = (U8)getMaterialField(material_data, MATERIALS_CAP_SPECULAR_EXP_FIELD, LLSD::TypeInteger); + mEnvironmentIntensity = (U8)getMaterialField(material_data, MATERIALS_CAP_ENV_INTENSITY_FIELD, LLSD::TypeInteger); + mDiffuseAlphaMode = (U8)getMaterialField(material_data, MATERIALS_CAP_DIFFUSE_ALPHA_MODE_FIELD, LLSD::TypeInteger); + mAlphaMaskCutoff = (U8)getMaterialField(material_data, MATERIALS_CAP_ALPHA_MASK_CUTOFF_FIELD, LLSD::TypeInteger); } bool LLMaterial::isNull() const { - return (*this == null); + return (*this == null); } bool LLMaterial::operator == (const LLMaterial& rhs) const { - return - (mNormalID == rhs.mNormalID) && (mNormalOffsetX == rhs.mNormalOffsetX) && (mNormalOffsetY == rhs.mNormalOffsetY) && - (mNormalRepeatX == rhs.mNormalRepeatX) && (mNormalRepeatY == rhs.mNormalRepeatY) && (mNormalRotation == rhs.mNormalRotation) && - (mSpecularID == rhs.mSpecularID) && (mSpecularOffsetX == rhs.mSpecularOffsetX) && (mSpecularOffsetY == rhs.mSpecularOffsetY) && - (mSpecularRepeatX == rhs.mSpecularRepeatX) && (mSpecularRepeatY == rhs.mSpecularRepeatY) && (mSpecularRotation == rhs.mSpecularRotation) && - (mSpecularLightColor == rhs.mSpecularLightColor) && (mSpecularLightExponent == rhs.mSpecularLightExponent) && - (mEnvironmentIntensity == rhs.mEnvironmentIntensity) && (mDiffuseAlphaMode == rhs.mDiffuseAlphaMode) && (mAlphaMaskCutoff == rhs.mAlphaMaskCutoff); + return + (mNormalID == rhs.mNormalID) && (mNormalOffsetX == rhs.mNormalOffsetX) && (mNormalOffsetY == rhs.mNormalOffsetY) && + (mNormalRepeatX == rhs.mNormalRepeatX) && (mNormalRepeatY == rhs.mNormalRepeatY) && (mNormalRotation == rhs.mNormalRotation) && + (mSpecularID == rhs.mSpecularID) && (mSpecularOffsetX == rhs.mSpecularOffsetX) && (mSpecularOffsetY == rhs.mSpecularOffsetY) && + (mSpecularRepeatX == rhs.mSpecularRepeatX) && (mSpecularRepeatY == rhs.mSpecularRepeatY) && (mSpecularRotation == rhs.mSpecularRotation) && + (mSpecularLightColor == rhs.mSpecularLightColor) && (mSpecularLightExponent == rhs.mSpecularLightExponent) && + (mEnvironmentIntensity == rhs.mEnvironmentIntensity) && (mDiffuseAlphaMode == rhs.mDiffuseAlphaMode) && (mAlphaMaskCutoff == rhs.mAlphaMaskCutoff); } bool LLMaterial::operator != (const LLMaterial& rhs) const { - return !(*this == rhs); + return !(*this == rhs); } U32 LLMaterial::getShaderMask(U32 alpha_mode) { //NEVER incorporate this value into the message system -- this function will vary depending on viewer implementation - U32 ret = 0; - - //two least significant bits are "diffuse alpha mode" - if (alpha_mode != DIFFUSE_ALPHA_MODE_DEFAULT) - { - ret = alpha_mode; - } - else - { - ret = getDiffuseAlphaMode(); - } - - llassert(ret < SHADER_COUNT); - - //next bit is whether or not specular map is present - const U32 SPEC_BIT = 0x4; - - if (getSpecularID().notNull()) - { - ret |= SPEC_BIT; - } - - llassert(ret < SHADER_COUNT); - - //next bit is whether or not normal map is present - const U32 NORM_BIT = 0x8; - if (getNormalID().notNull()) - { - ret |= NORM_BIT; - } - - llassert(ret < SHADER_COUNT); - - return ret; + U32 ret = 0; + + //two least significant bits are "diffuse alpha mode" + if (alpha_mode != DIFFUSE_ALPHA_MODE_DEFAULT) + { + ret = alpha_mode; + } + else + { + ret = getDiffuseAlphaMode(); + } + + llassert(ret < SHADER_COUNT); + + //next bit is whether or not specular map is present + const U32 SPEC_BIT = 0x4; + + if (getSpecularID().notNull()) + { + ret |= SPEC_BIT; + } + + llassert(ret < SHADER_COUNT); + + //next bit is whether or not normal map is present + const U32 NORM_BIT = 0x8; + if (getNormalID().notNull()) + { + ret |= NORM_BIT; + } + + llassert(ret < SHADER_COUNT); + + return ret; } diff --git a/indra/llprimitive/llmaterial.h b/indra/llprimitive/llmaterial.h index 64976e508b..d58b7ee812 100644 --- a/indra/llprimitive/llmaterial.h +++ b/indra/llprimitive/llmaterial.h @@ -39,115 +39,115 @@ class LLMaterial : public LLRefCount { public: - typedef enum - { - DIFFUSE_ALPHA_MODE_NONE = 0, - DIFFUSE_ALPHA_MODE_BLEND = 1, - DIFFUSE_ALPHA_MODE_MASK = 2, - DIFFUSE_ALPHA_MODE_EMISSIVE = 3, - DIFFUSE_ALPHA_MODE_DEFAULT = 4, - } eDiffuseAlphaMode; - - typedef enum - { - SHADER_COUNT = 16, - ALPHA_SHADER_COUNT = 4 - } eShaderCount; - - - - static const U8 DEFAULT_SPECULAR_LIGHT_EXPONENT = ((U8)(0.2f * 255)); - static const LLColor4U DEFAULT_SPECULAR_LIGHT_COLOR; - static const U8 DEFAULT_ENV_INTENSITY = 0; - - LLMaterial(); - LLMaterial(const LLSD& material_data); - - LLSD asLLSD() const; - void fromLLSD(const LLSD& material_data); - - const LLUUID& getNormalID() const; - void setNormalID(const LLUUID& normal_id); - - void getNormalOffset(F32& offset_x, F32& offset_y) const; - F32 getNormalOffsetX() const; - F32 getNormalOffsetY() const; - - void setNormalOffset(F32 offset_x, F32 offset_y); - void setNormalOffsetX(F32 offset_x); - void setNormalOffsetY(F32 offset_y); - - void getNormalRepeat(F32& repeat_x, F32& repeat_y) const; - F32 getNormalRepeatX() const; - F32 getNormalRepeatY() const; - - void setNormalRepeat(F32 repeat_x, F32 repeat_y); - void setNormalRepeatX(F32 repeat_x); - void setNormalRepeatY(F32 repeat_y); - - F32 getNormalRotation() const; - void setNormalRotation(F32 rot); - - const LLUUID& getSpecularID() const; - void setSpecularID(const LLUUID& specular_id); - void getSpecularOffset(F32& offset_x, F32& offset_y) const; - F32 getSpecularOffsetX() const; - F32 getSpecularOffsetY() const; - - void setSpecularOffset(F32 offset_x, F32 offset_y); - void setSpecularOffsetX(F32 offset_x); - void setSpecularOffsetY(F32 offset_y); - - void getSpecularRepeat(F32& repeat_x, F32& repeat_y) const; - F32 getSpecularRepeatX() const; - F32 getSpecularRepeatY() const; - - void setSpecularRepeat(F32 repeat_x, F32 repeat_y); - void setSpecularRepeatX(F32 repeat_x); - void setSpecularRepeatY(F32 repeat_y); - - F32 getSpecularRotation() const; - void setSpecularRotation(F32 rot); - - const LLColor4U getSpecularLightColor() const; - void setSpecularLightColor(const LLColor4U& color); - U8 getSpecularLightExponent() const; - void setSpecularLightExponent(U8 exponent); - U8 getEnvironmentIntensity() const; - void setEnvironmentIntensity(U8 intensity); - U8 getDiffuseAlphaMode() const; - void setDiffuseAlphaMode(U8 alpha_mode); - U8 getAlphaMaskCutoff() const; - void setAlphaMaskCutoff(U8 cutoff); - - bool isNull() const; - static const LLMaterial null; - - bool operator == (const LLMaterial& rhs) const; - bool operator != (const LLMaterial& rhs) const; - - U32 getShaderMask(U32 alpha_mode = DIFFUSE_ALPHA_MODE_DEFAULT); + typedef enum + { + DIFFUSE_ALPHA_MODE_NONE = 0, + DIFFUSE_ALPHA_MODE_BLEND = 1, + DIFFUSE_ALPHA_MODE_MASK = 2, + DIFFUSE_ALPHA_MODE_EMISSIVE = 3, + DIFFUSE_ALPHA_MODE_DEFAULT = 4, + } eDiffuseAlphaMode; + + typedef enum + { + SHADER_COUNT = 16, + ALPHA_SHADER_COUNT = 4 + } eShaderCount; + + + + static const U8 DEFAULT_SPECULAR_LIGHT_EXPONENT = ((U8)(0.2f * 255)); + static const LLColor4U DEFAULT_SPECULAR_LIGHT_COLOR; + static const U8 DEFAULT_ENV_INTENSITY = 0; + + LLMaterial(); + LLMaterial(const LLSD& material_data); + + LLSD asLLSD() const; + void fromLLSD(const LLSD& material_data); + + const LLUUID& getNormalID() const; + void setNormalID(const LLUUID& normal_id); + + void getNormalOffset(F32& offset_x, F32& offset_y) const; + F32 getNormalOffsetX() const; + F32 getNormalOffsetY() const; + + void setNormalOffset(F32 offset_x, F32 offset_y); + void setNormalOffsetX(F32 offset_x); + void setNormalOffsetY(F32 offset_y); + + void getNormalRepeat(F32& repeat_x, F32& repeat_y) const; + F32 getNormalRepeatX() const; + F32 getNormalRepeatY() const; + + void setNormalRepeat(F32 repeat_x, F32 repeat_y); + void setNormalRepeatX(F32 repeat_x); + void setNormalRepeatY(F32 repeat_y); + + F32 getNormalRotation() const; + void setNormalRotation(F32 rot); + + const LLUUID& getSpecularID() const; + void setSpecularID(const LLUUID& specular_id); + void getSpecularOffset(F32& offset_x, F32& offset_y) const; + F32 getSpecularOffsetX() const; + F32 getSpecularOffsetY() const; + + void setSpecularOffset(F32 offset_x, F32 offset_y); + void setSpecularOffsetX(F32 offset_x); + void setSpecularOffsetY(F32 offset_y); + + void getSpecularRepeat(F32& repeat_x, F32& repeat_y) const; + F32 getSpecularRepeatX() const; + F32 getSpecularRepeatY() const; + + void setSpecularRepeat(F32 repeat_x, F32 repeat_y); + void setSpecularRepeatX(F32 repeat_x); + void setSpecularRepeatY(F32 repeat_y); + + F32 getSpecularRotation() const; + void setSpecularRotation(F32 rot); + + const LLColor4U getSpecularLightColor() const; + void setSpecularLightColor(const LLColor4U& color); + U8 getSpecularLightExponent() const; + void setSpecularLightExponent(U8 exponent); + U8 getEnvironmentIntensity() const; + void setEnvironmentIntensity(U8 intensity); + U8 getDiffuseAlphaMode() const; + void setDiffuseAlphaMode(U8 alpha_mode); + U8 getAlphaMaskCutoff() const; + void setAlphaMaskCutoff(U8 cutoff); + + bool isNull() const; + static const LLMaterial null; + + bool operator == (const LLMaterial& rhs) const; + bool operator != (const LLMaterial& rhs) const; + + U32 getShaderMask(U32 alpha_mode = DIFFUSE_ALPHA_MODE_DEFAULT); protected: - LLUUID mNormalID; - F32 mNormalOffsetX; - F32 mNormalOffsetY; - F32 mNormalRepeatX; - F32 mNormalRepeatY; - F32 mNormalRotation; - - LLUUID mSpecularID; - F32 mSpecularOffsetX; - F32 mSpecularOffsetY; - F32 mSpecularRepeatX; - F32 mSpecularRepeatY; - F32 mSpecularRotation; - - LLColor4U mSpecularLightColor; - U8 mSpecularLightExponent; - U8 mEnvironmentIntensity; - U8 mDiffuseAlphaMode; - U8 mAlphaMaskCutoff; + LLUUID mNormalID; + F32 mNormalOffsetX; + F32 mNormalOffsetY; + F32 mNormalRepeatX; + F32 mNormalRepeatY; + F32 mNormalRotation; + + LLUUID mSpecularID; + F32 mSpecularOffsetX; + F32 mSpecularOffsetY; + F32 mSpecularRepeatX; + F32 mSpecularRepeatY; + F32 mSpecularRotation; + + LLColor4U mSpecularLightColor; + U8 mSpecularLightExponent; + U8 mEnvironmentIntensity; + U8 mDiffuseAlphaMode; + U8 mAlphaMaskCutoff; }; typedef LLPointer LLMaterialPtr; -- cgit v1.2.3 From 5e12beba702edb036b00690e7d810a3973cc96af Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Mon, 2 Jul 2018 19:30:31 +0100 Subject: MAINT-7548 MAINT-7560 use NvidiaOptimusEnablement globally exported var to signal desire to use high-performance graphics processor --- indra/llrender/llgl.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 35b6951779..f8aa63c16f 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -2561,5 +2561,10 @@ void LLGLSyncFence::wait() #endif } - - +#if LL_WINDOWS +// Expose desired use of high-performance graphics processor to Optimus driver +extern "C" +{ + _declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001; +} +#endif \ No newline at end of file -- cgit v1.2.3 From c530b3d1519e0755bf8ba8a548815856291d905c Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Mon, 2 Jul 2018 21:12:03 +0100 Subject: MAINT-3219 make align planar faces set normal and specular offsets and rotations in addition to the diffuse values --- indra/newview/llpanelface.cpp | 8 +++++++- indra/newview/llpanelface.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 01ce4470f0..1bd8692a0e 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -550,8 +550,14 @@ struct LLPanelFaceSetAlignedTEFunctor : public LLSelectedTEFunctor if (set_aligned) { object->setTEOffset(te, uv_offset.mV[VX], uv_offset.mV[VY]); - object->setTEScale(te, uv_scale.mV[VX], uv_scale.mV[VY]); + object->setTEScale(te, uv_scale.mV[VX], uv_scale.mV[VY]); object->setTERotation(te, uv_rot); + LLPanelFace::LLSelectedTEMaterial::setNormalOffsetX(mPanel, uv_offset.mV[VX]); + LLPanelFace::LLSelectedTEMaterial::setNormalOffsetY(mPanel, uv_offset.mV[VY]); + LLPanelFace::LLSelectedTEMaterial::setSpecularOffsetX(mPanel, uv_offset.mV[VX]); + LLPanelFace::LLSelectedTEMaterial::setSpecularOffsetY(mPanel, uv_offset.mV[VY]); + LLPanelFace::LLSelectedTEMaterial::setNormalRotation(mPanel, uv_rot); + LLPanelFace::LLSelectedTEMaterial::setSpecularRotation(mPanel, uv_rot); } } if (!set_aligned) diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h index 7c084cb0ab..7820af8bcd 100644 --- a/indra/newview/llpanelface.h +++ b/indra/newview/llpanelface.h @@ -414,6 +414,7 @@ private: bool mUpdateInFlight; bool mUpdatePending; +public: #if defined(DEF_GET_MAT_STATE) #undef DEF_GET_MAT_STATE #endif -- cgit v1.2.3 From 6e03f2b4b5d6fcc6e26193185f2fe58f52d12598 Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Tue, 3 Jul 2018 16:59:07 +0300 Subject: MAINT-8836 - Objects with Alpha Masking > 0 settings do not rendering correctly on avatar FIXED --- indra/newview/llviewershadermgr.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index ff7647a7e4..d2acfa291c 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -2065,6 +2065,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectSimpleNonIndexedProgram.mFeatures.hasAtmospherics = true; gObjectSimpleNonIndexedProgram.mFeatures.hasLighting = true; gObjectSimpleNonIndexedProgram.mFeatures.disableTextureIndex = true; + gObjectSimpleNonIndexedProgram.mFeatures.hasAlphaMask = true; gObjectSimpleNonIndexedProgram.mShaderFiles.clear(); gObjectSimpleNonIndexedProgram.mShaderFiles.push_back(make_pair("objects/simpleV.glsl", GL_VERTEX_SHADER_ARB)); gObjectSimpleNonIndexedProgram.mShaderFiles.push_back(make_pair("objects/simpleF.glsl", GL_FRAGMENT_SHADER_ARB)); -- cgit v1.2.3 From c877eac422dc0d1116547d4cb83e618f0b5b6741 Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Wed, 4 Jul 2018 11:56:01 +0300 Subject: Fixed line endings in llgl.cpp --- indra/llrender/llgl.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index f8aa63c16f..79a50d199a 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -2563,8 +2563,9 @@ void LLGLSyncFence::wait() #if LL_WINDOWS // Expose desired use of high-performance graphics processor to Optimus driver -extern "C" -{ - _declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001; -} -#endif \ No newline at end of file +extern "C" +{ + _declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001; +} +#endif + -- cgit v1.2.3 From ba31900ea80dd0bdb29fa8f4100f992489b25a1e Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Fri, 20 Jul 2018 19:17:59 +0100 Subject: MAINT-8891 viewer-side fix for redundant setting of specular offset in LLSD to struct translation --- indra/llprimitive/llmaterial.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/indra/llprimitive/llmaterial.cpp b/indra/llprimitive/llmaterial.cpp index c0fefaae73..3f84bbf517 100644 --- a/indra/llprimitive/llmaterial.cpp +++ b/indra/llprimitive/llmaterial.cpp @@ -393,7 +393,6 @@ void LLMaterial::fromLLSD(const LLSD& material_data) mSpecularOffsetY = F32(specularOffsetYInt) / MATERIALS_MULTIPLIER; mSpecularRotation = F32(specularRotInt) / MATERIALS_MULTIPLIER; - mSpecularOffsetY = ((F32)getMaterialField(material_data, MATERIALS_CAP_SPECULAR_MAP_OFFSET_Y_FIELD, LLSD::TypeInteger)) / MATERIALS_MULTIPLIER; mSpecularRepeatX = ((F32)getMaterialField(material_data, MATERIALS_CAP_SPECULAR_MAP_REPEAT_X_FIELD, LLSD::TypeInteger)) / MATERIALS_MULTIPLIER; mSpecularRepeatY = ((F32)getMaterialField(material_data, MATERIALS_CAP_SPECULAR_MAP_REPEAT_Y_FIELD, LLSD::TypeInteger)) / MATERIALS_MULTIPLIER; mSpecularRotation = ((F32)getMaterialField(material_data, MATERIALS_CAP_SPECULAR_MAP_ROTATION_FIELD, LLSD::TypeInteger)) / MATERIALS_MULTIPLIER; -- cgit v1.2.3 From 60d256e80f019e77afef941bc02eb65be6f9bc6d Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Mon, 30 Jul 2018 22:38:30 +0100 Subject: MAINT-8915 Fix sync of material rotation and offset values when using aligned planar faces. Make it possible to set a specific TE's normal/spec offset/rotation values. Eliminate redundant conversions in LLSD -> struct handler. --- indra/llprimitive/llmaterial.cpp | 16 ++++++------- indra/newview/llpanelface.cpp | 18 +++++++------- indra/newview/llpanelface.h | 52 ++++++++++++++++++++-------------------- indra/newview/llselectmgr.cpp | 30 +++++++++++++---------- indra/newview/llselectmgr.h | 2 +- 5 files changed, 61 insertions(+), 57 deletions(-) diff --git a/indra/llprimitive/llmaterial.cpp b/indra/llprimitive/llmaterial.cpp index 3f84bbf517..a219ac1450 100644 --- a/indra/llprimitive/llmaterial.cpp +++ b/indra/llprimitive/llmaterial.cpp @@ -374,28 +374,28 @@ void LLMaterial::fromLLSD(const LLSD& material_data) S32 normalOffsetXInt = getMaterialField(material_data, MATERIALS_CAP_NORMAL_MAP_OFFSET_X_FIELD, LLSD::TypeInteger); S32 normalOffsetYInt = getMaterialField(material_data, MATERIALS_CAP_NORMAL_MAP_OFFSET_Y_FIELD, LLSD::TypeInteger); S32 normalRotInt = getMaterialField(material_data, MATERIALS_CAP_NORMAL_MAP_ROTATION_FIELD, LLSD::TypeInteger); + S32 normalRepeatXInt = getMaterialField(material_data, MATERIALS_CAP_NORMAL_MAP_REPEAT_X_FIELD, LLSD::TypeInteger); + S32 normalRepeatYInt = getMaterialField(material_data, MATERIALS_CAP_NORMAL_MAP_REPEAT_Y_FIELD, LLSD::TypeInteger); mNormalOffsetX = F32(normalOffsetXInt) / MATERIALS_MULTIPLIER; mNormalOffsetY = F32(normalOffsetYInt) / MATERIALS_MULTIPLIER; mNormalRotation = F32(normalRotInt) / MATERIALS_MULTIPLIER; - - mNormalOffsetY = ((F32)getMaterialField(material_data, MATERIALS_CAP_NORMAL_MAP_OFFSET_Y_FIELD, LLSD::TypeInteger)) / MATERIALS_MULTIPLIER; - mNormalRepeatX = ((F32)getMaterialField(material_data, MATERIALS_CAP_NORMAL_MAP_REPEAT_X_FIELD, LLSD::TypeInteger)) / MATERIALS_MULTIPLIER; - mNormalRepeatY = ((F32)getMaterialField(material_data, MATERIALS_CAP_NORMAL_MAP_REPEAT_Y_FIELD, LLSD::TypeInteger)) / MATERIALS_MULTIPLIER; + mNormalRepeatX = F32(normalRepeatXInt) / MATERIALS_MULTIPLIER; + mNormalRepeatY = F32(normalRepeatYInt) / MATERIALS_MULTIPLIER; mSpecularID = getMaterialField(material_data, MATERIALS_CAP_SPECULAR_MAP_FIELD, LLSD::TypeUUID); S32 specularOffsetXInt = getMaterialField(material_data, MATERIALS_CAP_SPECULAR_MAP_OFFSET_X_FIELD, LLSD::TypeInteger); S32 specularOffsetYInt = getMaterialField(material_data, MATERIALS_CAP_SPECULAR_MAP_OFFSET_Y_FIELD, LLSD::TypeInteger); S32 specularRotInt = getMaterialField(material_data, MATERIALS_CAP_SPECULAR_MAP_ROTATION_FIELD, LLSD::TypeInteger); + S32 specularRepeatXInt = getMaterialField(material_data, MATERIALS_CAP_SPECULAR_MAP_REPEAT_X_FIELD, LLSD::TypeInteger); + S32 specularRepeatYInt = getMaterialField(material_data, MATERIALS_CAP_SPECULAR_MAP_REPEAT_Y_FIELD, LLSD::TypeInteger); mSpecularOffsetX = F32(specularOffsetXInt) / MATERIALS_MULTIPLIER; mSpecularOffsetY = F32(specularOffsetYInt) / MATERIALS_MULTIPLIER; mSpecularRotation = F32(specularRotInt) / MATERIALS_MULTIPLIER; - - mSpecularRepeatX = ((F32)getMaterialField(material_data, MATERIALS_CAP_SPECULAR_MAP_REPEAT_X_FIELD, LLSD::TypeInteger)) / MATERIALS_MULTIPLIER; - mSpecularRepeatY = ((F32)getMaterialField(material_data, MATERIALS_CAP_SPECULAR_MAP_REPEAT_Y_FIELD, LLSD::TypeInteger)) / MATERIALS_MULTIPLIER; - mSpecularRotation = ((F32)getMaterialField(material_data, MATERIALS_CAP_SPECULAR_MAP_ROTATION_FIELD, LLSD::TypeInteger)) / MATERIALS_MULTIPLIER; + mSpecularRepeatX = F32(specularRepeatXInt) / MATERIALS_MULTIPLIER; + mSpecularRepeatY = F32(specularRepeatYInt) / MATERIALS_MULTIPLIER; mSpecularLightColor.setValue(getMaterialField(material_data, MATERIALS_CAP_SPECULAR_COLOR_FIELD, LLSD::TypeArray)); mSpecularLightExponent = (U8)getMaterialField(material_data, MATERIALS_CAP_SPECULAR_EXP_FIELD, LLSD::TypeInteger); diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 1bd8692a0e..d2d75784e8 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -552,12 +552,12 @@ struct LLPanelFaceSetAlignedTEFunctor : public LLSelectedTEFunctor object->setTEOffset(te, uv_offset.mV[VX], uv_offset.mV[VY]); object->setTEScale(te, uv_scale.mV[VX], uv_scale.mV[VY]); object->setTERotation(te, uv_rot); - LLPanelFace::LLSelectedTEMaterial::setNormalOffsetX(mPanel, uv_offset.mV[VX]); - LLPanelFace::LLSelectedTEMaterial::setNormalOffsetY(mPanel, uv_offset.mV[VY]); - LLPanelFace::LLSelectedTEMaterial::setSpecularOffsetX(mPanel, uv_offset.mV[VX]); - LLPanelFace::LLSelectedTEMaterial::setSpecularOffsetY(mPanel, uv_offset.mV[VY]); - LLPanelFace::LLSelectedTEMaterial::setNormalRotation(mPanel, uv_rot); - LLPanelFace::LLSelectedTEMaterial::setSpecularRotation(mPanel, uv_rot); + LLPanelFace::LLSelectedTEMaterial::setNormalOffsetX(mPanel, uv_offset.mV[VX], te); + LLPanelFace::LLSelectedTEMaterial::setNormalOffsetY(mPanel, uv_offset.mV[VY], te); + LLPanelFace::LLSelectedTEMaterial::setSpecularOffsetX(mPanel, uv_offset.mV[VX], te); + LLPanelFace::LLSelectedTEMaterial::setSpecularOffsetY(mPanel, uv_offset.mV[VY], te); + LLPanelFace::LLSelectedTEMaterial::setNormalRotation(mPanel, uv_rot, te); + LLPanelFace::LLSelectedTEMaterial::setSpecularRotation(mPanel, uv_rot, te); } } if (!set_aligned) @@ -2057,10 +2057,10 @@ void LLPanelFace::onCommitMaterialShinyScaleY(LLUICtrl* ctrl, void* userdata) } //static -void LLPanelFace::syncMaterialRot(LLPanelFace* self, F32 rot) +void LLPanelFace::syncMaterialRot(LLPanelFace* self, F32 rot, int te) { - LLSelectedTEMaterial::setNormalRotation(self,rot * DEG_TO_RAD); - LLSelectedTEMaterial::setSpecularRotation(self,rot * DEG_TO_RAD); + LLSelectedTEMaterial::setNormalRotation(self,rot * DEG_TO_RAD, te); + LLSelectedTEMaterial::setSpecularRotation(self,rot * DEG_TO_RAD, te); self->sendTextureInfo(); } diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h index 7820af8bcd..c6f4c2f826 100644 --- a/indra/newview/llpanelface.h +++ b/indra/newview/llpanelface.h @@ -179,7 +179,7 @@ protected: static void syncRepeatY(LLPanelFace* self, F32 scaleV); static void syncOffsetX(LLPanelFace* self, F32 offsetU); static void syncOffsetY(LLPanelFace* self, F32 offsetV); - static void syncMaterialRot(LLPanelFace* self, F32 rot); + static void syncMaterialRot(LLPanelFace* self, F32 rot, int te = -1); static void onCommitMaterialShinyScaleX( LLUICtrl* ctrl, void* userdata); static void onCommitMaterialShinyScaleY( LLUICtrl* ctrl, void* userdata); @@ -252,7 +252,7 @@ private: typename DataType, typename SetValueType, void (LLMaterial::*MaterialEditFunc)(SetValueType data) > - static void edit(LLPanelFace* p, DataType data) + static void edit(LLPanelFace* p, DataType data, int te = -1) { LLMaterialEditFunctor< DataType, SetValueType, MaterialEditFunc > edit(data); struct LLSelectedTEEditMaterial : public LLSelectedTEMaterialFunctor @@ -327,7 +327,7 @@ private: LLMaterialEditFunctor< DataType, SetValueType, MaterialEditFunc >* _edit; LLPanelFace* _panel; } editor(p, &edit); - LLSelectMgr::getInstance()->selectionSetMaterialParams(&editor); + LLSelectMgr::getInstance()->selectionSetMaterialParams(&editor, te); } template< @@ -427,29 +427,29 @@ public: DEF_EDIT_MAT_STATE #endif - // Accessors for selected TE material state - // - #define DEF_GET_MAT_STATE(DataType,ReturnType,MaterialMemberFunc,DefaultValue) \ - static void MaterialMemberFunc(DataType& data, bool& identical) \ - { \ - getTEMaterialValue< DataType, ReturnType, &LLMaterial::MaterialMemberFunc >(data, identical,DefaultValue); \ - } - - // Mutators for selected TE material - // - #define DEF_EDIT_MAT_STATE(DataType,ReturnType,MaterialMemberFunc) \ - static void MaterialMemberFunc(LLPanelFace* p,DataType data) \ - { \ - edit< DataType, ReturnType, &LLMaterial::MaterialMemberFunc >(p,data); \ - } - - // Accessors for selected TE state proper (legacy settings etc) - // - #define DEF_GET_TE_STATE(DataType,ReturnType,TexEntryMemberFunc,DefaultValue) \ - static void TexEntryMemberFunc(DataType& data, bool& identical) \ - { \ - getTEValue< DataType, ReturnType, &LLTextureEntry::TexEntryMemberFunc >(data, identical,DefaultValue); \ - } + // Accessors for selected TE material state + // + #define DEF_GET_MAT_STATE(DataType,ReturnType,MaterialMemberFunc,DefaultValue) \ + static void MaterialMemberFunc(DataType& data, bool& identical) \ + { \ + getTEMaterialValue< DataType, ReturnType, &LLMaterial::MaterialMemberFunc >(data, identical,DefaultValue); \ + } + + // Mutators for selected TE material + // + #define DEF_EDIT_MAT_STATE(DataType,ReturnType,MaterialMemberFunc) \ + static void MaterialMemberFunc(LLPanelFace* p, DataType data, int te = -1) \ + { \ + edit< DataType, ReturnType, &LLMaterial::MaterialMemberFunc >(p, data, te); \ + } + + // Accessors for selected TE state proper (legacy settings etc) + // + #define DEF_GET_TE_STATE(DataType,ReturnType,TexEntryMemberFunc,DefaultValue) \ + static void TexEntryMemberFunc(DataType& data, bool& identical) \ + { \ + getTEValue< DataType, ReturnType, &LLTextureEntry::TexEntryMemberFunc >(data, identical,DefaultValue); \ + } class LLSelectedTEMaterial { diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index ddae109030..53f09ab62d 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -2080,29 +2080,33 @@ void LLSelectMgr::selectionSetGlow(F32 glow) mSelectedObjects->applyToObjects( &func2 ); } -void LLSelectMgr::selectionSetMaterialParams(LLSelectedTEMaterialFunctor* material_func) +void LLSelectMgr::selectionSetMaterialParams(LLSelectedTEMaterialFunctor* material_func, int te) { struct f1 : public LLSelectedTEFunctor { LLMaterialPtr mMaterial; - f1(LLSelectedTEMaterialFunctor* material_func) : _material_func(material_func) {} + f1(LLSelectedTEMaterialFunctor* material_func, int te) : _material_func(material_func), _specific_te(te) {} - bool apply(LLViewerObject* object, S32 face) + bool apply(LLViewerObject* object, S32 te) { - if (object && object->permModify() && _material_func) - { - LLTextureEntry* tep = object->getTE(face); - if (tep) - { - LLMaterialPtr current_material = tep->getMaterialParams(); - _material_func->apply(object, face, tep, current_material); - } - } + if (_specific_te == -1 || (te == _specific_te)) + { + if (object && object->permModify() && _material_func) + { + LLTextureEntry* tep = object->getTE(te); + if (tep) + { + LLMaterialPtr current_material = tep->getMaterialParams(); + _material_func->apply(object, te, tep, current_material); + } + } + } return true; } LLSelectedTEMaterialFunctor* _material_func; - } func1(material_func); + int _specific_te; + } func1(material_func, te); mSelectedObjects->applyToTEs( &func1 ); struct f2 : public LLSelectedObjectFunctor diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index e965dd80d5..25ee8619d7 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -591,7 +591,7 @@ public: void selectionSetClickAction(U8 action); void selectionSetIncludeInSearch(bool include_in_search); void selectionSetGlow(const F32 glow); - void selectionSetMaterialParams(LLSelectedTEMaterialFunctor* material_func); + void selectionSetMaterialParams(LLSelectedTEMaterialFunctor* material_func, int specific_te = -1); void selectionRemoveMaterial(); void selectionSetObjectPermissions(U8 perm_field, BOOL set, U32 perm_mask, BOOL override = FALSE); -- cgit v1.2.3 From d748dbce457dabf6bc46eb22c5c5315f50af159c Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 31 Jul 2018 17:35:42 +0100 Subject: MAINT-8909 Loosen precision when checking rotation and other false negatives when comparing faces to see if they can be considered planar aligned. This was causing fields to be marked tentative (grayed display) incorrectly. --- indra/newview/llpanelface.cpp | 25 ++++++++++------ indra/newview/llpanelface.h | 70 +++++++++++++++++++++---------------------- indra/newview/llselectmgr.cpp | 40 +++++++++++++++++++++++++ indra/newview/llselectmgr.h | 18 +++++++++-- 4 files changed, 106 insertions(+), 47 deletions(-) diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index d2d75784e8..b71e98b102 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -605,12 +605,19 @@ struct LLPanelFaceGetIsAlignedTEFunctor : public LLSelectedTEFunctor tep->getOffset(&st_offset.mV[VX], &st_offset.mV[VY]); tep->getScale(&st_scale.mV[VX], &st_scale.mV[VY]); F32 st_rot = tep->getRotation(); + + bool eq_offset_x = is_approx_equal_fraction(st_offset.mV[VX], aligned_st_offset.mV[VX], 12); + bool eq_offset_y = is_approx_equal_fraction(st_offset.mV[VY], aligned_st_offset.mV[VY], 12); + bool eq_scale_x = is_approx_equal_fraction(st_scale.mV[VX], aligned_st_scale.mV[VX], 12); + bool eq_scale_y = is_approx_equal_fraction(st_scale.mV[VY], aligned_st_scale.mV[VY], 12); + bool eq_rot = is_approx_equal_fraction(st_rot, aligned_st_rot, 6); + // needs a fuzzy comparison, because of fp errors - if (is_approx_equal_fraction(st_offset.mV[VX], aligned_st_offset.mV[VX], 12) && - is_approx_equal_fraction(st_offset.mV[VY], aligned_st_offset.mV[VY], 12) && - is_approx_equal_fraction(st_scale.mV[VX], aligned_st_scale.mV[VX], 12) && - is_approx_equal_fraction(st_scale.mV[VY], aligned_st_scale.mV[VY], 12) && - is_approx_equal_fraction(st_rot, aligned_st_rot, 14)) + if (eq_offset_x && + eq_offset_y && + eq_scale_x && + eq_scale_y && + eq_rot) { return true; } @@ -973,9 +980,9 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/) F32 spec_scale_s = 1.f; F32 norm_scale_s = 1.f; - LLSelectedTE::getScaleS( diff_scale_s, identical_diff_scale_s); - LLSelectedTEMaterial::getSpecularRepeatX( spec_scale_s, identical_spec_scale_s); - LLSelectedTEMaterial::getNormalRepeatX( norm_scale_s, identical_norm_scale_s); + LLSelectedTE::getScaleS(diff_scale_s, identical_diff_scale_s); + LLSelectedTEMaterial::getSpecularRepeatX(spec_scale_s, identical_spec_scale_s); + LLSelectedTEMaterial::getNormalRepeatX(norm_scale_s, identical_norm_scale_s); diff_scale_s = editable ? diff_scale_s : 1.0f; diff_scale_s *= identical_planar_texgen ? 2.0f : 1.0f; @@ -2438,7 +2445,7 @@ void LLPanelFace::LLSelectedTE::getFace(LLFace*& face_to_return, bool& identical return (object->mDrawable) ? object->mDrawable->getFace(te): NULL; } } get_te_face_func; - identical_face = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue(&get_te_face_func, face_to_return); + identical_face = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue(&get_te_face_func, face_to_return, false, (LLFace*)nullptr); } void LLPanelFace::LLSelectedTE::getImageFormat(LLGLenum& image_format_to_return, bool& identical_face) diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h index c6f4c2f826..17850dbc77 100644 --- a/indra/newview/llpanelface.h +++ b/indra/newview/llpanelface.h @@ -334,7 +334,7 @@ private: typename DataType, typename ReturnType, ReturnType (LLMaterial::* const MaterialGetFunc)() const > - static void getTEMaterialValue(DataType& data_to_return, bool& identical,DataType default_value) + static void getTEMaterialValue(DataType& data_to_return, bool& identical,DataType default_value, bool has_tolerance = HasTolerance, DataType tolerance = DataType()) { DataType data_value; struct GetTEMaterialVal : public LLSelectedTEGetFunctor @@ -359,7 +359,7 @@ private: } DataType _default; } GetFunc(default_value); - identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &GetFunc, data_value); + identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &GetFunc, data_value, has_tolerance, tolerance); data_to_return = data_value; } @@ -367,7 +367,7 @@ private: typename DataType, typename ReturnType, // some kids just have to different... ReturnType (LLTextureEntry::* const TEGetFunc)() const > - static void getTEValue(DataType& data_to_return, bool& identical, DataType default_value) + static void getTEValue(DataType& data_to_return, bool& identical, DataType default_value, bool has_tolerance = false, DataType tolerance = DataType()) { DataType data_value; struct GetTEVal : public LLSelectedTEGetFunctor @@ -381,7 +381,7 @@ private: } DataType _default; } GetTEValFunc(default_value); - identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &GetTEValFunc, data_value ); + identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &GetTEValFunc, data_value, has_tolerance, tolerance ); data_to_return = data_value; } @@ -429,10 +429,10 @@ public: // Accessors for selected TE material state // - #define DEF_GET_MAT_STATE(DataType,ReturnType,MaterialMemberFunc,DefaultValue) \ - static void MaterialMemberFunc(DataType& data, bool& identical) \ - { \ - getTEMaterialValue< DataType, ReturnType, &LLMaterial::MaterialMemberFunc >(data, identical,DefaultValue); \ + #define DEF_GET_MAT_STATE(DataType,ReturnType,MaterialMemberFunc,DefaultValue,HasTolerance,Tolerance) \ + static void MaterialMemberFunc(DataType& data, bool& identical, bool has_tolerance = HasTolerance, DataType tolerance = Tolerance) \ + { \ + getTEMaterialValue< DataType, ReturnType, &LLMaterial::MaterialMemberFunc >(data, identical, DefaultValue, has_tolerance, tolerance); \ } // Mutators for selected TE material @@ -445,10 +445,10 @@ public: // Accessors for selected TE state proper (legacy settings etc) // - #define DEF_GET_TE_STATE(DataType,ReturnType,TexEntryMemberFunc,DefaultValue) \ - static void TexEntryMemberFunc(DataType& data, bool& identical) \ - { \ - getTEValue< DataType, ReturnType, &LLTextureEntry::TexEntryMemberFunc >(data, identical,DefaultValue); \ + #define DEF_GET_TE_STATE(DataType,ReturnType,TexEntryMemberFunc,DefaultValue,HasTolerance,Tolerance) \ + static void TexEntryMemberFunc(DataType& data, bool& identical, bool has_tolerance = HasTolerance, DataType tolerance = Tolerance) \ + { \ + getTEValue< DataType, ReturnType, &LLTextureEntry::TexEntryMemberFunc >(data, identical, DefaultValue, has_tolerance, tolerance); \ } class LLSelectedTEMaterial @@ -459,19 +459,19 @@ public: static void getMaxNormalRepeats(F32& repeats, bool& identical); static void getCurrentDiffuseAlphaMode(U8& diffuse_alpha_mode, bool& identical, bool diffuse_texture_has_alpha); - DEF_GET_MAT_STATE(LLUUID,const LLUUID&,getNormalID,LLUUID::null) - DEF_GET_MAT_STATE(LLUUID,const LLUUID&,getSpecularID,LLUUID::null) - DEF_GET_MAT_STATE(F32,F32,getSpecularRepeatX,1.0f) - DEF_GET_MAT_STATE(F32,F32,getSpecularRepeatY,1.0f) - DEF_GET_MAT_STATE(F32,F32,getSpecularOffsetX,0.0f) - DEF_GET_MAT_STATE(F32,F32,getSpecularOffsetY,0.0f) - DEF_GET_MAT_STATE(F32,F32,getSpecularRotation,0.0f) + DEF_GET_MAT_STATE(LLUUID,const LLUUID&,getNormalID,LLUUID::null, false, LLUUID::null) + DEF_GET_MAT_STATE(LLUUID,const LLUUID&,getSpecularID,LLUUID::null, false, LLUUID::null) + DEF_GET_MAT_STATE(F32,F32,getSpecularRepeatX,1.0f, true, 0.001f) + DEF_GET_MAT_STATE(F32,F32,getSpecularRepeatY,1.0f, true, 0.001f) + DEF_GET_MAT_STATE(F32,F32,getSpecularOffsetX,0.0f, true, 0.001f) + DEF_GET_MAT_STATE(F32,F32,getSpecularOffsetY,0.0f, true, 0.001f) + DEF_GET_MAT_STATE(F32,F32,getSpecularRotation,0.0f, true, 0.001f) - DEF_GET_MAT_STATE(F32,F32,getNormalRepeatX,1.0f) - DEF_GET_MAT_STATE(F32,F32,getNormalRepeatY,1.0f) - DEF_GET_MAT_STATE(F32,F32,getNormalOffsetX,0.0f) - DEF_GET_MAT_STATE(F32,F32,getNormalOffsetY,0.0f) - DEF_GET_MAT_STATE(F32,F32,getNormalRotation,0.0f) + DEF_GET_MAT_STATE(F32,F32,getNormalRepeatX,1.0f, true, 0.001f) + DEF_GET_MAT_STATE(F32,F32,getNormalRepeatY,1.0f, true, 0.001f) + DEF_GET_MAT_STATE(F32,F32,getNormalOffsetX,0.0f, true, 0.001f) + DEF_GET_MAT_STATE(F32,F32,getNormalOffsetY,0.0f, true, 0.001f) + DEF_GET_MAT_STATE(F32,F32,getNormalRotation,0.0f, true, 0.001f) DEF_EDIT_MAT_STATE(U8,U8,setDiffuseAlphaMode); DEF_EDIT_MAT_STATE(U8,U8,setAlphaMaskCutoff); @@ -507,17 +507,17 @@ public: static void getObjectScaleT(F32& scale_t, bool& identical); static void getMaxDiffuseRepeats(F32& repeats, bool& identical); - DEF_GET_TE_STATE(U8,U8,getBumpmap,0) - DEF_GET_TE_STATE(U8,U8,getShiny,0) - DEF_GET_TE_STATE(U8,U8,getFullbright,0) - DEF_GET_TE_STATE(F32,F32,getRotation,0.0f) - DEF_GET_TE_STATE(F32,F32,getOffsetS,0.0f) - DEF_GET_TE_STATE(F32,F32,getOffsetT,0.0f) - DEF_GET_TE_STATE(F32,F32,getScaleS,1.0f) - DEF_GET_TE_STATE(F32,F32,getScaleT,1.0f) - DEF_GET_TE_STATE(F32,F32,getGlow,0.0f) - DEF_GET_TE_STATE(LLTextureEntry::e_texgen,LLTextureEntry::e_texgen,getTexGen,LLTextureEntry::TEX_GEN_DEFAULT) - DEF_GET_TE_STATE(LLColor4,const LLColor4&,getColor,LLColor4::white) + DEF_GET_TE_STATE(U8,U8,getBumpmap,0, false, 0) + DEF_GET_TE_STATE(U8,U8,getShiny,0, false, 0) + DEF_GET_TE_STATE(U8,U8,getFullbright,0, false, 0) + DEF_GET_TE_STATE(F32,F32,getRotation,0.0f, true, 0.001f) + DEF_GET_TE_STATE(F32,F32,getOffsetS,0.0f, true, 0.001f) + DEF_GET_TE_STATE(F32,F32,getOffsetT,0.0f, true, 0.001f) + DEF_GET_TE_STATE(F32,F32,getScaleS,1.0f, true, 0.001f) + DEF_GET_TE_STATE(F32,F32,getScaleT,1.0f, true, 0.001f) + DEF_GET_TE_STATE(F32,F32,getGlow,0.0f, true, 0.001f) + DEF_GET_TE_STATE(LLTextureEntry::e_texgen,LLTextureEntry::e_texgen,getTexGen,LLTextureEntry::TEX_GEN_DEFAULT, false, LLTextureEntry::TEX_GEN_DEFAULT) + DEF_GET_TE_STATE(LLColor4,const LLColor4&,getColor,LLColor4::white, false, LLColor4::black); }; }; diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 53f09ab62d..86b88e0a59 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -7936,3 +7936,43 @@ void LLSelectMgr::sendSelectionMove() //saveSelectedObjectTransform(SELECT_ACTION_TYPE_PICK); } + +bool LLCheckIdenticalFunctor::same(const F32& a, const F32& b, const F32& tolerance) +{ + F32 delta = (a - b); + F32 abs_delta = fabs(delta); + bool is_samish = abs_delta <= tolerance; + if (!is_samish) + { + int q = 0; + q++; + } + return is_samish; +} + +#define DEF_DUMMY_CHECK_FUNCTOR(T) \ +bool LLCheckIdenticalFunctor::same(const T& a, const T& b, const T& tolerance) \ +{ \ + (void)tolerance; \ + return a == b; \ +} + +DEF_DUMMY_CHECK_FUNCTOR(LLUUID) +DEF_DUMMY_CHECK_FUNCTOR(LLGLenum) +DEF_DUMMY_CHECK_FUNCTOR(LLTextureEntry) +DEF_DUMMY_CHECK_FUNCTOR(LLTextureEntry::e_texgen) +DEF_DUMMY_CHECK_FUNCTOR(bool) +DEF_DUMMY_CHECK_FUNCTOR(U8) +DEF_DUMMY_CHECK_FUNCTOR(int) +DEF_DUMMY_CHECK_FUNCTOR(LLColor4) +DEF_DUMMY_CHECK_FUNCTOR(LLMediaEntry) +DEF_DUMMY_CHECK_FUNCTOR(LLPointer) +DEF_DUMMY_CHECK_FUNCTOR(std::string) +DEF_DUMMY_CHECK_FUNCTOR(std::vector) + +bool LLCheckIdenticalFunctor::same(class LLFace* const & a, class LLFace* const & b, class LLFace* const & tolerance) \ +{ \ + (void)tolerance; \ + return a == b; \ +} + diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index 25ee8619d7..cbe9200c4e 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -124,6 +124,11 @@ template struct LLSelectedTEGetFunctor virtual T get(LLViewerObject* object, S32 te) = 0; }; +template struct LLCheckIdenticalFunctor +{ + static bool same(const T& a, const T& b, const T& tolerance); +}; + typedef enum e_send_type { SEND_ONLY_ROOTS, @@ -313,7 +318,7 @@ public: LLViewerObject* getPrimaryObject() { return mPrimaryObject; } // iterate through texture entries - template bool getSelectedTEValue(LLSelectedTEGetFunctor* func, T& res); + template bool getSelectedTEValue(LLSelectedTEGetFunctor* func, T& res, bool has_tolerance = false, T tolerance = T()); template bool isMultipleTEValue(LLSelectedTEGetFunctor* func, const T& ignore_value); S32 getNumNodes(); @@ -856,7 +861,7 @@ void dialog_refresh_all(); //----------------------------------------------------------------------------- // getSelectedTEValue //----------------------------------------------------------------------------- -template bool LLObjectSelection::getSelectedTEValue(LLSelectedTEGetFunctor* func, T& res) +template bool LLObjectSelection::getSelectedTEValue(LLSelectedTEGetFunctor* func, T& res, bool has_tolerance, T tolerance) { bool have_first = false; bool have_selected = false; @@ -892,7 +897,14 @@ template bool LLObjectSelection::getSelectedTEValue(LLSelectedTEGet { if ( value != selected_value ) { - identical = false; + if (!has_tolerance) + { + identical = false; + } + else if (!LLCheckIdenticalFunctor::same(value, selected_value, tolerance)) + { + identical = false; + } } if (te == selected_te) { -- cgit v1.2.3 From 66035a216837154a05f9490ae07adf470d8fe870 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 31 Jul 2018 18:12:43 +0100 Subject: Fix broken init of defaulted arg that MSVC should not have let slide. --- indra/newview/llpanelface.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h index 17850dbc77..4937966034 100644 --- a/indra/newview/llpanelface.h +++ b/indra/newview/llpanelface.h @@ -332,9 +332,9 @@ private: template< typename DataType, - typename ReturnType, + typename ReturnType, ReturnType (LLMaterial::* const MaterialGetFunc)() const > - static void getTEMaterialValue(DataType& data_to_return, bool& identical,DataType default_value, bool has_tolerance = HasTolerance, DataType tolerance = DataType()) + static void getTEMaterialValue(DataType& data_to_return, bool& identical,DataType default_value, bool has_tolerance = false, DataType tolerance = DataType()) { DataType data_value; struct GetTEMaterialVal : public LLSelectedTEGetFunctor -- cgit v1.2.3 From ee91efb05377aa94c4d223d61ff941f2cdedde76 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 31 Jul 2018 20:22:28 +0100 Subject: Fix template specialization syntax for Clang that MSVC does not demand. --- indra/newview/llselectmgr.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 86b88e0a59..792b55e5bb 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -7937,6 +7937,7 @@ void LLSelectMgr::sendSelectionMove() //saveSelectedObjectTransform(SELECT_ACTION_TYPE_PICK); } +template<> bool LLCheckIdenticalFunctor::same(const F32& a, const F32& b, const F32& tolerance) { F32 delta = (a - b); @@ -7951,6 +7952,7 @@ bool LLCheckIdenticalFunctor::same(const F32& a, const F32& b, const F32& t } #define DEF_DUMMY_CHECK_FUNCTOR(T) \ +template<> \ bool LLCheckIdenticalFunctor::same(const T& a, const T& b, const T& tolerance) \ { \ (void)tolerance; \ @@ -7970,6 +7972,7 @@ DEF_DUMMY_CHECK_FUNCTOR(LLPointer) DEF_DUMMY_CHECK_FUNCTOR(std::string) DEF_DUMMY_CHECK_FUNCTOR(std::vector) +template<> bool LLCheckIdenticalFunctor::same(class LLFace* const & a, class LLFace* const & b, class LLFace* const & tolerance) \ { \ (void)tolerance; \ -- cgit v1.2.3 From 4cd59b3d8e43870264717ec145da14e34c6c717a Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Wed, 1 Aug 2018 00:35:33 +0100 Subject: Remove debug code for conditional BP. --- indra/newview/llselectmgr.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 792b55e5bb..245d248390 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -7942,13 +7942,7 @@ bool LLCheckIdenticalFunctor::same(const F32& a, const F32& b, const F32& t { F32 delta = (a - b); F32 abs_delta = fabs(delta); - bool is_samish = abs_delta <= tolerance; - if (!is_samish) - { - int q = 0; - q++; - } - return is_samish; + return abs_delta <= tolerance; } #define DEF_DUMMY_CHECK_FUNCTOR(T) \ -- cgit v1.2.3 From 3237923e10a34d14ac4aac17400811cb1c7c3bdf Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Thu, 16 Aug 2018 00:31:39 +0100 Subject: MAINT-3699 new shaders supporting alpha blend/mask rigged content. Make shader loading debug logging of uniforms use ShaderUniform to make supression simpler. --- indra/llprimitive/lltextureentry.h | 2 + indra/llrender/llglslshader.cpp | 10 +- indra/llrender/llshadermgr.cpp | 4 +- .../deferred/attachmentAlphaMaskShadowF.glsl | 64 ++++++ .../class1/deferred/attachmentAlphaShadowF.glsl | 68 ++++++ .../class1/deferred/attachmentAlphaShadowV.glsl | 74 +++++++ .../class1/deferred/avatarAlphaMaskShadowF.glsl | 65 ++++++ .../class1/deferred/avatarAlphaShadowF.glsl | 68 ++++++ .../class1/deferred/avatarAlphaShadowV.glsl | 82 +++++++ indra/newview/lldrawpoolavatar.cpp | 236 ++++++++++++++++++--- indra/newview/lldrawpoolavatar.h | 212 +++++++++--------- indra/newview/llviewershadermgr.cpp | 52 +++++ indra/newview/llviewershadermgr.h | 4 + 13 files changed, 807 insertions(+), 134 deletions(-) create mode 100644 indra/newview/app_settings/shaders/class1/deferred/attachmentAlphaMaskShadowF.glsl create mode 100644 indra/newview/app_settings/shaders/class1/deferred/attachmentAlphaShadowF.glsl create mode 100644 indra/newview/app_settings/shaders/class1/deferred/attachmentAlphaShadowV.glsl create mode 100644 indra/newview/app_settings/shaders/class1/deferred/avatarAlphaMaskShadowF.glsl create mode 100644 indra/newview/app_settings/shaders/class1/deferred/avatarAlphaShadowF.glsl create mode 100644 indra/newview/app_settings/shaders/class1/deferred/avatarAlphaShadowV.glsl diff --git a/indra/llprimitive/lltextureentry.h b/indra/llprimitive/lltextureentry.h index a40c3988f2..dc2e201044 100644 --- a/indra/llprimitive/lltextureentry.h +++ b/indra/llprimitive/lltextureentry.h @@ -136,6 +136,8 @@ public: virtual const LLUUID &getID() const { return mID; } const LLColor4 &getColor() const { return mColor; } + const F32 getAlpha() const { return mColor.mV[VALPHA]; } + void getScale(F32 *s, F32 *t) const { *s = mScaleS; *t = mScaleT; } F32 getScaleS() const { return mScaleS; } F32 getScaleT() const { return mScaleT; } diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index 4702042ab9..141ed51260 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -561,7 +561,7 @@ BOOL LLGLSLShader::mapAttributes(const std::vector * attri mAttribute[i] = index; #endif mAttributeMask |= 1 << i; - LL_DEBUGS("ShaderLoading") << "Attribute " << name << " assigned to channel " << index << LL_ENDL; + LL_DEBUGS("ShaderUniform") << "Attribute " << name << " assigned to channel " << index << LL_ENDL; } } if (attributes != NULL) @@ -573,7 +573,7 @@ BOOL LLGLSLShader::mapAttributes(const std::vector * attri if (index != -1) { mAttribute[LLShaderMgr::instance()->mReservedAttribs.size() + i] = index; - LL_DEBUGS("ShaderLoading") << "Attribute " << name << " assigned to channel " << index << LL_ENDL; + LL_DEBUGS("ShaderUniform") << "Attribute " << name << " assigned to channel " << index << LL_ENDL; } } } @@ -658,7 +658,7 @@ void LLGLSLShader::mapUniform(GLint index, const vector * mUniformNameMap[location] = name; mUniformMap[hashedName] = location; - LL_DEBUGS("ShaderLoading") << "Uniform " << name << " is at location " << location << LL_ENDL; + LL_DEBUGS("ShaderUniform") << "Uniform " << name << " is at location " << location << LL_ENDL; //find the index of this uniform for (S32 i = 0; i < (S32) LLShaderMgr::instance()->mReservedUniforms.size(); i++) @@ -706,7 +706,7 @@ GLint LLGLSLShader::mapUniformTextureChannel(GLint location, GLenum type) type == GL_SAMPLER_2D_MULTISAMPLE) { //this here is a texture glUniform1iARB(location, mActiveTextureChannels); - LL_DEBUGS("ShaderLoading") << "Assigned to texture channel " << mActiveTextureChannels << LL_ENDL; + LL_DEBUGS("ShaderUniform") << "Assigned to texture channel " << mActiveTextureChannels << LL_ENDL; return mActiveTextureChannels++; } return -1; @@ -849,7 +849,7 @@ BOOL LLGLSLShader::mapUniforms(const vector * uniforms) unbind(); - LL_DEBUGS("ShaderLoading") << "Total Uniform Size: " << mTotalUniformSize << LL_ENDL; + LL_DEBUGS("ShaderUniform") << "Total Uniform Size: " << mTotalUniformSize << LL_ENDL; return res; } diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index e721ad93fa..643c368870 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -537,8 +537,6 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade } } - LL_DEBUGS("ShaderLoading") << "Loading shader file: " << filename << " class " << shader_level << LL_ENDL; - if (filename.empty()) { return 0; @@ -558,7 +556,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade fname << getShaderDirPrefix(); fname << gpu_class << "/" << filename; - LL_DEBUGS("ShaderLoading") << "Looking in " << fname.str() << LL_ENDL; + file = LLFile::fopen(fname.str(), "r"); /* Flawfinder: ignore */ if (file) { diff --git a/indra/newview/app_settings/shaders/class1/deferred/attachmentAlphaMaskShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/attachmentAlphaMaskShadowF.glsl new file mode 100644 index 0000000000..a08550d69c --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/deferred/attachmentAlphaMaskShadowF.glsl @@ -0,0 +1,64 @@ +/** + * @file attachmentAlphaMaskShadowF.glsl + * + * $LicenseInfo:firstyear=2005&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2005, 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$ + */ + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 frag_color; +#else +#define frag_color gl_FragColor +#endif + +uniform float minimum_alpha; + +uniform sampler2D diffuseMap; + +VARYING vec4 post_pos; +VARYING vec2 vary_texcoord0; +VARYING float pos_w; +VARYING float target_pos_x; +VARYING vec4 vertex_color; + +void main() +{ + float alpha = texture2D(diffuseMap, vary_texcoord0.xy).a * vertex_color.a; + + if (alpha < 0.05) // treat as totally transparent + { + discard; + } + + if (alpha < minimum_alpha) // treat as semi-transparent + { + if (fract(0.5*floor(target_pos_x / pos_w )) < 0.25) + { + discard; + } + } + + frag_color = vec4(1,1,1,1); + +#if !DEPTH_CLAMP + gl_FragDepth = max(post_pos.z/post_pos.w*0.5+0.5, 0.0); +#endif +} diff --git a/indra/newview/app_settings/shaders/class1/deferred/attachmentAlphaShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/attachmentAlphaShadowF.glsl new file mode 100644 index 0000000000..b54c580ce9 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/deferred/attachmentAlphaShadowF.glsl @@ -0,0 +1,68 @@ +/** + * @file attachmentAlphaShadowF.glsl + * + * $LicenseInfo:firstyear=2005&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2005, 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$ + */ + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 frag_color; +#else +#define frag_color gl_FragColor +#endif + +uniform float minimum_alpha; +uniform sampler2D diffuseMap; + +VARYING float pos_w; +VARYING float target_pos_x; + +#if !DEPTH_CLAMP +VARYING vec4 post_pos; +#endif + +VARYING vec2 vary_texcoord0; +VARYING vec4 vertex_color; + +void main() +{ + float alpha = texture2D(diffuseMap, vary_texcoord0.xy).a * vertex_color.a; + + if (alpha < 0.05) // treat as totally transparent + { + discard; + } + + if (alpha < minimum_alpha) + { + if (fract(0.5*floor(target_pos_x / pos_w )) < 0.25) + { + discard; + } + } + + frag_color = vec4(1,1,1,1); + +#if !DEPTH_CLAMP + gl_FragDepth = max(post_pos.z/post_pos.w*0.5+0.5, 0.0); +#endif + +} diff --git a/indra/newview/app_settings/shaders/class1/deferred/attachmentAlphaShadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/attachmentAlphaShadowV.glsl new file mode 100644 index 0000000000..31b93dc36a --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/deferred/attachmentAlphaShadowV.glsl @@ -0,0 +1,74 @@ +/** + * @file attachmentShadowV.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$ + */ + +uniform mat4 projection_matrix; +uniform mat4 modelview_matrix; +uniform mat4 texture_matrix0; +uniform float shadow_target_width; + +ATTRIBUTE vec4 diffuse_color; +ATTRIBUTE vec3 position; +ATTRIBUTE vec3 normal; +ATTRIBUTE vec2 texcoord0; + +mat4 getObjectSkinnedTransform(); +void passTextureIndex(); + +#if !DEPTH_CLAMP +VARYING vec4 post_pos; +#endif +VARYING vec2 vary_texcoord0; +VARYING float pos_w; +VARYING float target_pos_x; +VARYING vec4 vertex_color; + +void main() +{ + //transform vertex + mat4 mat = getObjectSkinnedTransform(); + + mat = modelview_matrix * mat; + vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz; + + vec4 p = projection_matrix * vec4(pos, 1.0); + + pos_w = p.w; + + target_pos_x = 0.5 * (shadow_target_width - 1.0) * pos.x; + + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; + + vertex_color = diffuse_color; + +#if !DEPTH_CLAMP + p.z = max(p.z, -p.w+0.01); + post_pos = p; + gl_Position = p; +#else + gl_Position = p; +#endif + + passTextureIndex(); +} + diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaMaskShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaMaskShadowF.glsl new file mode 100644 index 0000000000..b8ce54bcb1 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaMaskShadowF.glsl @@ -0,0 +1,65 @@ +/** + * @file treeShadowF.glsl + * + * $LicenseInfo:firstyear=2005&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2005, 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$ + */ + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 frag_color; +#else +#define frag_color gl_FragColor +#endif + +uniform float minimum_alpha; +uniform sampler2D diffuseMap; + +#if !DEPTH_CLAMP +VARYING vec4 post_pos; +#endif + +VARYING float target_pos_x; +VARYING float pos_w; +VARYING vec2 vary_texcoord0; + +void main() +{ + float alpha = texture2D(diffuseMap, vary_texcoord0.xy).a; + + if (alpha < 0.05) // treat as totally transparent + { + discard; + } + + if (alpha < minimum_alpha) + { + if (fract(0.5*floor(target_pos_x / pos_w )) < 0.25) + { + discard; + } + } + + frag_color = vec4(1,1,1,1); + +#if !DEPTH_CLAMP + gl_FragDepth = max(post_pos.z/post_pos.w*0.5+0.5, 0.0); +#endif +} diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaShadowF.glsl new file mode 100644 index 0000000000..ef49b6f4e8 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaShadowF.glsl @@ -0,0 +1,68 @@ +/** + * @file avatarAlphaShadowF.glsl + * + * $LicenseInfo:firstyear=2005&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2005, 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$ + */ + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 frag_color; +#else +#define frag_color gl_FragColor +#endif + +uniform float minimum_alpha; + +uniform sampler2D diffuseMap; + +#if !DEPTH_CLAMP +VARYING vec4 post_pos; +#endif + +VARYING float pos_w; +VARYING float target_pos_x; +VARYING vec2 vary_texcoord0; +VARYING vec4 vertex_color; + +void main() +{ + float alpha = texture2D(diffuseMap, vary_texcoord0.xy).a * vertex_color.a; + + if (alpha < 0.05) // treat as totally transparent + { + discard; + } + + if (alpha < minimum_alpha) // treat as semi-transparent + { + if (fract(0.5*floor(target_pos_x / pos_w )) < 0.25) + { + discard; + } + } + + frag_color = vec4(1,1,1,1); + +#if !DEPTH_CLAMP + gl_FragDepth = max(post_pos.z/post_pos.w*0.5+0.5, 0.0); +#endif + +} diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaShadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaShadowV.glsl new file mode 100644 index 0000000000..d1d7ece6fe --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaShadowV.glsl @@ -0,0 +1,82 @@ +/** + * @file avatarShadowV.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$ + */ + +uniform mat4 texture_matrix0; +uniform mat4 projection_matrix; +uniform float shadow_target_width; + +mat4 getSkinnedTransform(); +void passTextureIndex(); + +ATTRIBUTE vec4 diffuse_color; +ATTRIBUTE vec3 position; +ATTRIBUTE vec3 normal; +ATTRIBUTE vec2 texcoord0; + +#if !DEPTH_CLAMP +VARYING vec4 post_pos; +#endif +VARYING float pos_w; +VARYING float target_pos_x; +VARYING vec2 vary_texcoord0; +VARYING vec4 vertex_color; + +void main() +{ + vec4 pos; + vec3 norm; + + vec4 pos_in = vec4(position.xyz, 1.0); + mat4 trans = getSkinnedTransform(); + pos.x = dot(trans[0], pos_in); + pos.y = dot(trans[1], pos_in); + pos.z = dot(trans[2], pos_in); + pos.w = 1.0; + + norm.x = dot(trans[0].xyz, normal); + norm.y = dot(trans[1].xyz, normal); + norm.z = dot(trans[2].xyz, normal); + norm = normalize(norm); + + pos = projection_matrix * pos; + + target_pos_x = 0.5 * (shadow_target_width - 1.0) * pos.x; + + pos_w = pos.w; + + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; + + vertex_color = diffuse_color; +#if !DEPTH_CLAMP + post_pos = pos; + + gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w); +#else + gl_Position = pos; +#endif + + passTextureIndex(); +} + diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index ef69990170..b318156cf8 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -60,6 +60,7 @@ static U32 sShaderLevel = 0; LLGLSLShader* LLDrawPoolAvatar::sVertexProgram = NULL; BOOL LLDrawPoolAvatar::sSkipOpaque = FALSE; BOOL LLDrawPoolAvatar::sSkipTransparent = FALSE; +S32 LLDrawPoolAvatar::sShadowPass = -1; S32 LLDrawPoolAvatar::sDiffuseChannel = 0; F32 LLDrawPoolAvatar::sMinimumAlpha = 0.2f; @@ -403,19 +404,33 @@ void LLDrawPoolAvatar::renderPostDeferred(S32 pass) S32 LLDrawPoolAvatar::getNumShadowPasses() { - return 2; + // avatars opaque, avatar alpha, avatar alpha mask, alpha attachments, alpha mask attachments, opaque attachments... + return NUM_SHADOW_PASSES; } void LLDrawPoolAvatar::beginShadowPass(S32 pass) { LL_RECORD_BLOCK_TIME(FTM_SHADOW_AVATAR); - if (pass == 0) + if (pass == SHADOW_PASS_AVATAR_OPAQUE) { sVertexProgram = &gDeferredAvatarShadowProgram; - //gGL.setAlphaRejectSettings(LLRender::CF_GREATER_EQUAL, 0.2f); + if ((sShaderLevel > 0)) // for hardware blending + { + sRenderingSkinned = TRUE; + sVertexProgram->bind(); + } + gGL.diffuseColor4f(1,1,1,1); + } + else if (pass == SHADOW_PASS_AVATAR_ALPHA_BLEND) + { + sVertexProgram = &gDeferredAvatarAlphaShadowProgram; + + // bind diffuse tex so we can reference the alpha channel... + sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); + if ((sShaderLevel > 0)) // for hardware blending { sRenderingSkinned = TRUE; @@ -424,7 +439,52 @@ void LLDrawPoolAvatar::beginShadowPass(S32 pass) gGL.diffuseColor4f(1,1,1,1); } - else + else if (pass == SHADOW_PASS_AVATAR_ALPHA_MASK) + { + sVertexProgram = &gDeferredAvatarAlphaMaskShadowProgram; + + // bind diffuse tex so we can reference the alpha channel... + sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); + + if ((sShaderLevel > 0)) // for hardware blending + { + sRenderingSkinned = TRUE; + sVertexProgram->bind(); + } + + gGL.diffuseColor4f(1,1,1,1); + } + else if (pass == SHADOW_PASS_ATTACHMENT_ALPHA_BLEND) + { + sVertexProgram = &gDeferredAttachmentAlphaShadowProgram; + + // bind diffuse tex so we can reference the alpha channel... + sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); + + if ((sShaderLevel > 0)) // for hardware blending + { + sRenderingSkinned = TRUE; + sVertexProgram->bind(); + } + + gGL.diffuseColor4f(1,1,1,1); + } + else if (pass == SHADOW_PASS_ATTACHMENT_ALPHA_MASK) + { + sVertexProgram = &gDeferredAttachmentAlphaMaskShadowProgram; + + // bind diffuse tex so we can reference the alpha channel... + sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); + + if ((sShaderLevel > 0)) // for hardware blending + { + sRenderingSkinned = TRUE; + sVertexProgram->bind(); + } + + gGL.diffuseColor4f(1,1,1,1); + } + else // SHADOW_PASS_ATTACHMENT_OPAQUE { sVertexProgram = &gDeferredAttachmentShadowProgram; sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); @@ -435,20 +495,19 @@ void LLDrawPoolAvatar::beginShadowPass(S32 pass) void LLDrawPoolAvatar::endShadowPass(S32 pass) { LL_RECORD_BLOCK_TIME(FTM_SHADOW_AVATAR); - if (pass == 0) - { - if (sShaderLevel > 0) - { - sRenderingSkinned = FALSE; - sVertexProgram->unbind(); - } - } - else + + if (pass == SHADOW_PASS_ATTACHMENT_OPAQUE) { LLVertexBuffer::unbind(); + } + + if (sShaderLevel > 0) + { sVertexProgram->unbind(); - sVertexProgram = NULL; } + sVertexProgram = NULL; + sRenderingSkinned = FALSE; + LLDrawPoolAvatar::sShadowPass = -1; } void LLDrawPoolAvatar::renderShadow(S32 pass) @@ -480,16 +539,68 @@ void LLDrawPoolAvatar::renderShadow(S32 pass) return; } - if (pass == 0) + LLDrawPoolAvatar::sShadowPass = pass; + + if (pass == SHADOW_PASS_AVATAR_OPAQUE) { + LLDrawPoolAvatar::sSkipTransparent = true; avatarp->renderSkinned(); + LLDrawPoolAvatar::sSkipTransparent = false; } - else + else if (pass == SHADOW_PASS_AVATAR_ALPHA_BLEND) { - for (U32 i = 0; i < NUM_RIGGED_PASSES; ++i) - { - renderRigged(avatarp, i); - } + LLDrawPoolAvatar::sSkipOpaque = true; + avatarp->renderSkinned(); + LLDrawPoolAvatar::sSkipOpaque = false; + } + else if (pass == SHADOW_PASS_AVATAR_ALPHA_MASK) + { + LLDrawPoolAvatar::sSkipOpaque = true; + avatarp->renderSkinned(); + LLDrawPoolAvatar::sSkipOpaque = false; + } + else if (pass == SHADOW_PASS_ATTACHMENT_ALPHA_BLEND) // rigged alpha + { + LLDrawPoolAvatar::sSkipOpaque = true; + renderRigged(avatarp, RIGGED_MATERIAL_ALPHA); + renderRigged(avatarp, RIGGED_MATERIAL_ALPHA); + renderRigged(avatarp, RIGGED_MATERIAL_ALPHA_EMISSIVE); + renderRigged(avatarp, RIGGED_ALPHA); + renderRigged(avatarp, RIGGED_FULLBRIGHT_ALPHA); + renderRigged(avatarp, RIGGED_GLOW); + LLDrawPoolAvatar::sSkipOpaque = false; + } + else if (pass == SHADOW_PASS_ATTACHMENT_ALPHA_MASK) // rigged alpha mask + { + LLDrawPoolAvatar::sSkipOpaque = true; + renderRigged(avatarp, RIGGED_MATERIAL_ALPHA_MASK); + renderRigged(avatarp, RIGGED_NORMMAP_MASK); + renderRigged(avatarp, RIGGED_SPECMAP_MASK); + renderRigged(avatarp, RIGGED_NORMSPEC_MASK); + renderRigged(avatarp, RIGGED_GLOW); + LLDrawPoolAvatar::sSkipOpaque = false; + } + else // rigged opaque (SHADOW_PASS_ATTACHMENT_OPAQUE + { + LLDrawPoolAvatar::sSkipTransparent = true; + renderRigged(avatarp, RIGGED_MATERIAL); + renderRigged(avatarp, RIGGED_SPECMAP); + renderRigged(avatarp, RIGGED_SPECMAP_BLEND); + renderRigged(avatarp, RIGGED_SPECMAP_EMISSIVE); + renderRigged(avatarp, RIGGED_NORMMAP); + renderRigged(avatarp, RIGGED_NORMMAP_BLEND); + renderRigged(avatarp, RIGGED_NORMMAP_EMISSIVE); + renderRigged(avatarp, RIGGED_NORMSPEC); + renderRigged(avatarp, RIGGED_NORMSPEC_BLEND); + renderRigged(avatarp, RIGGED_NORMSPEC_EMISSIVE); + renderRigged(avatarp, RIGGED_SIMPLE); + renderRigged(avatarp, RIGGED_FULLBRIGHT); + renderRigged(avatarp, RIGGED_SHINY); + renderRigged(avatarp, RIGGED_FULLBRIGHT_SHINY); + renderRigged(avatarp, RIGGED_GLOW); + renderRigged(avatarp, RIGGED_DEFERRED_BUMP); + renderRigged(avatarp, RIGGED_DEFERRED_SIMPLE); + LLDrawPoolAvatar::sSkipTransparent = false; } } @@ -1737,8 +1848,81 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) LLVertexBuffer* buff = face->getVertexBuffer(); + const LLTextureEntry* tex_entry = face->getTextureEntry(); + LLMaterial* mat = tex_entry ? tex_entry->getMaterialParams().get() : nullptr; + + if (LLDrawPoolAvatar::sShadowPass >= 0) + { + bool is_alpha_blend = false; + bool is_alpha_mask = false; + + if (mat) + { + switch (LLMaterial::eDiffuseAlphaMode(mat->getDiffuseAlphaMode())) + { + case LLMaterial::DIFFUSE_ALPHA_MODE_MASK: + { + is_alpha_mask = true; + } + break; + + case LLMaterial::DIFFUSE_ALPHA_MODE_BLEND: + { + is_alpha_blend = true; + } + break; + + case LLMaterial::DIFFUSE_ALPHA_MODE_EMISSIVE: + case LLMaterial::DIFFUSE_ALPHA_MODE_DEFAULT: + case LLMaterial::DIFFUSE_ALPHA_MODE_NONE: + default: + break; + } + } + + if (tex_entry) + { + if (tex_entry->getAlpha() <= 0.99f) + { + is_alpha_blend = true; + } + } + + LLViewerTexture* tex = face->getTexture(LLRender::DIFFUSE_MAP); + if (tex) + { + LLGLenum image_format = tex->getPrimaryFormat(); + if (tex->getIsAlphaMask()) + { + is_alpha_mask = true; + } + else if (!is_alpha_mask && (image_format == GL_RGBA || image_format == GL_ALPHA)) + { + is_alpha_blend = true; + } + } + + // if this is alpha mask content and we're doing opaques or a non-alpha-mask shadow pass... + if (is_alpha_mask && (LLDrawPoolAvatar::sSkipTransparent || LLDrawPoolAvatar::sShadowPass != SHADOW_PASS_ATTACHMENT_ALPHA_MASK)) + { + return; + } + + // if this is alpha blend content and we're doing opaques or a non-alpha-blend shadow pass... + if (is_alpha_blend && (LLDrawPoolAvatar::sSkipTransparent || LLDrawPoolAvatar::sShadowPass != SHADOW_PASS_ATTACHMENT_ALPHA_BLEND)) + { + return; + } + + // if this is opaque content and we're skipping opaques... + if (!is_alpha_mask && !is_alpha_blend && LLDrawPoolAvatar::sSkipOpaque) + { + return; + } + } + if (buff) - { + { if (sShaderLevel > 0) { // upload matrix palette to shader @@ -1794,9 +1978,6 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) gGL.diffuseColor4f(0,0,0,face->getTextureEntry()->getGlow()); }*/ - const LLTextureEntry* te = face->getTextureEntry(); - LLMaterial* mat = te->getMaterialParams().get(); - if (mat) { //order is important here LLRender::DIFFUSE_MAP should be last, becouse it change @@ -1827,12 +2008,12 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) if (mat->getSpecularID().isNull()) { - env = te->getShiny()*0.25f; + env = tex_entry->getShiny()*0.25f; col.set(env,env,env,0); spec = env; } - BOOL fullbright = te->getFullbright(); + BOOL fullbright = tex_entry->getFullbright(); sVertexProgram->uniform1f(LLShaderMgr::EMISSIVE_BRIGHTNESS, fullbright ? 1.f : 0.f); sVertexProgram->uniform4f(LLShaderMgr::SPECULAR_COLOR, col.mV[0], col.mV[1], col.mV[2], spec); @@ -1840,7 +2021,8 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) if (mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_MASK) { - sVertexProgram->setMinimumAlpha(mat->getAlphaMaskCutoff()/255.f); + F32 cutoff = mat->getAlphaMaskCutoff()/255.f; + sVertexProgram->setMinimumAlpha(cutoff); } else { diff --git a/indra/newview/lldrawpoolavatar.h b/indra/newview/lldrawpoolavatar.h index b9d2204052..8afe6788ff 100644 --- a/indra/newview/lldrawpoolavatar.h +++ b/indra/newview/lldrawpoolavatar.h @@ -55,105 +55,7 @@ public: LLVertexBuffer::MAP_CLOTHWEIGHT }; - virtual U32 getVertexDataMask() { return VERTEX_DATA_MASK; } - - virtual S32 getVertexShaderLevel() const; - - LLDrawPoolAvatar(); - - static LLMatrix4& getModelView(); - - /*virtual*/ LLDrawPool *instancePool(); - - /*virtual*/ S32 getNumPasses(); - /*virtual*/ void beginRenderPass(S32 pass); - /*virtual*/ void endRenderPass(S32 pass); - /*virtual*/ void prerender(); - /*virtual*/ void render(S32 pass = 0); - - /*virtual*/ S32 getNumDeferredPasses(); - /*virtual*/ void beginDeferredPass(S32 pass); - /*virtual*/ void endDeferredPass(S32 pass); - /*virtual*/ void renderDeferred(S32 pass); - - /*virtual*/ S32 getNumPostDeferredPasses(); - /*virtual*/ void beginPostDeferredPass(S32 pass); - /*virtual*/ void endPostDeferredPass(S32 pass); - /*virtual*/ void renderPostDeferred(S32 pass); - - /*virtual*/ S32 getNumShadowPasses(); - /*virtual*/ void beginShadowPass(S32 pass); - /*virtual*/ void endShadowPass(S32 pass); - /*virtual*/ void renderShadow(S32 pass); - - void beginRigid(); - void beginImpostor(); - void beginSkinned(); - - void endRigid(); - void endImpostor(); - void endSkinned(); - - void beginDeferredImpostor(); - void beginDeferredRigid(); - void beginDeferredSkinned(); - - void endDeferredImpostor(); - void endDeferredRigid(); - void endDeferredSkinned(); - - void beginPostDeferredAlpha(); - void endPostDeferredAlpha(); - - void beginRiggedSimple(); - void beginRiggedFullbright(); - void beginRiggedFullbrightShiny(); - void beginRiggedShinySimple(); - void beginRiggedAlpha(); - void beginRiggedFullbrightAlpha(); - void beginRiggedGlow(); - void beginDeferredRiggedAlpha(); - void beginDeferredRiggedMaterial(S32 pass); - void beginDeferredRiggedMaterialAlpha(S32 pass); - - void endRiggedSimple(); - void endRiggedFullbright(); - void endRiggedFullbrightShiny(); - void endRiggedShinySimple(); - void endRiggedAlpha(); - void endRiggedFullbrightAlpha(); - void endRiggedGlow(); - void endDeferredRiggedAlpha(); - void endDeferredRiggedMaterial(S32 pass); - void endDeferredRiggedMaterialAlpha(S32 pass); - - void beginDeferredRiggedSimple(); - void beginDeferredRiggedBump(); - - void endDeferredRiggedSimple(); - void endDeferredRiggedBump(); - - void getRiggedGeometry(LLFace* face, LLPointer& buffer, U32 data_mask, const LLMeshSkinInfo* skin, LLVolume* volume, const LLVolumeFace& vol_face); - void updateRiggedFaceVertexBuffer(LLVOAvatar* avatar, - LLFace* facep, - const LLMeshSkinInfo* skin, - LLVolume* volume, - const LLVolumeFace& vol_face); - void updateRiggedVertexBuffers(LLVOAvatar* avatar); - - void renderRigged(LLVOAvatar* avatar, U32 type, bool glow = false); - void renderRiggedSimple(LLVOAvatar* avatar); - void renderRiggedAlpha(LLVOAvatar* avatar); - void renderRiggedFullbrightAlpha(LLVOAvatar* avatar); - void renderRiggedFullbright(LLVOAvatar* avatar); - void renderRiggedShinySimple(LLVOAvatar* avatar); - void renderRiggedFullbrightShiny(LLVOAvatar* avatar); - void renderRiggedGlow(LLVOAvatar* avatar); - void renderDeferredRiggedSimple(LLVOAvatar* avatar); - void renderDeferredRiggedBump(LLVOAvatar* avatar); - void renderDeferredRiggedMaterial(LLVOAvatar* avatar, S32 pass); - - typedef enum + typedef enum { RIGGED_MATERIAL=0, RIGGED_MATERIAL_ALPHA, @@ -258,6 +160,117 @@ public: LLVertexBuffer::MAP_WEIGHT4, } eRiggedDataMask; +typedef enum + { + SHADOW_PASS_AVATAR_OPAQUE, + SHADOW_PASS_AVATAR_ALPHA_BLEND, + SHADOW_PASS_AVATAR_ALPHA_MASK, + SHADOW_PASS_ATTACHMENT_ALPHA_BLEND, + SHADOW_PASS_ATTACHMENT_ALPHA_MASK, + SHADOW_PASS_ATTACHMENT_OPAQUE, + NUM_SHADOW_PASSES + } eShadowPass; + + virtual U32 getVertexDataMask() { return VERTEX_DATA_MASK; } + + virtual S32 getVertexShaderLevel() const; + + LLDrawPoolAvatar(); + + static LLMatrix4& getModelView(); + + /*virtual*/ LLDrawPool *instancePool(); + + /*virtual*/ S32 getNumPasses(); + /*virtual*/ void beginRenderPass(S32 pass); + /*virtual*/ void endRenderPass(S32 pass); + /*virtual*/ void prerender(); + /*virtual*/ void render(S32 pass = 0); + + /*virtual*/ S32 getNumDeferredPasses(); + /*virtual*/ void beginDeferredPass(S32 pass); + /*virtual*/ void endDeferredPass(S32 pass); + /*virtual*/ void renderDeferred(S32 pass); + + /*virtual*/ S32 getNumPostDeferredPasses(); + /*virtual*/ void beginPostDeferredPass(S32 pass); + /*virtual*/ void endPostDeferredPass(S32 pass); + /*virtual*/ void renderPostDeferred(S32 pass); + + /*virtual*/ S32 getNumShadowPasses(); + /*virtual*/ void beginShadowPass(S32 pass); + /*virtual*/ void endShadowPass(S32 pass); + /*virtual*/ void renderShadow(S32 pass); + + void beginRigid(); + void beginImpostor(); + void beginSkinned(); + + void endRigid(); + void endImpostor(); + void endSkinned(); + + void beginDeferredImpostor(); + void beginDeferredRigid(); + void beginDeferredSkinned(); + + void endDeferredImpostor(); + void endDeferredRigid(); + void endDeferredSkinned(); + + void beginPostDeferredAlpha(); + void endPostDeferredAlpha(); + + void beginRiggedSimple(); + void beginRiggedFullbright(); + void beginRiggedFullbrightShiny(); + void beginRiggedShinySimple(); + void beginRiggedAlpha(); + void beginRiggedFullbrightAlpha(); + void beginRiggedGlow(); + void beginDeferredRiggedAlpha(); + void beginDeferredRiggedMaterial(S32 pass); + void beginDeferredRiggedMaterialAlpha(S32 pass); + + void endRiggedSimple(); + void endRiggedFullbright(); + void endRiggedFullbrightShiny(); + void endRiggedShinySimple(); + void endRiggedAlpha(); + void endRiggedFullbrightAlpha(); + void endRiggedGlow(); + void endDeferredRiggedAlpha(); + void endDeferredRiggedMaterial(S32 pass); + void endDeferredRiggedMaterialAlpha(S32 pass); + + void beginDeferredRiggedSimple(); + void beginDeferredRiggedBump(); + + void endDeferredRiggedSimple(); + void endDeferredRiggedBump(); + + void getRiggedGeometry(LLFace* face, LLPointer& buffer, U32 data_mask, const LLMeshSkinInfo* skin, LLVolume* volume, const LLVolumeFace& vol_face); + void updateRiggedFaceVertexBuffer(LLVOAvatar* avatar, + LLFace* facep, + const LLMeshSkinInfo* skin, + LLVolume* volume, + const LLVolumeFace& vol_face); + void updateRiggedVertexBuffers(LLVOAvatar* avatar); + + void renderRigged(LLVOAvatar* avatar, U32 type, bool glow = false); + void renderRiggedSimple(LLVOAvatar* avatar); + void renderRiggedAlpha(LLVOAvatar* avatar); + void renderRiggedFullbrightAlpha(LLVOAvatar* avatar); + void renderRiggedFullbright(LLVOAvatar* avatar); + void renderRiggedShinySimple(LLVOAvatar* avatar); + void renderRiggedFullbrightShiny(LLVOAvatar* avatar); + void renderRiggedGlow(LLVOAvatar* avatar); + void renderDeferredRiggedSimple(LLVOAvatar* avatar); + void renderDeferredRiggedBump(LLVOAvatar* avatar); + void renderDeferredRiggedMaterial(LLVOAvatar* avatar, S32 pass); + + + void addRiggedFace(LLFace* facep, U32 type); void removeRiggedFace(LLFace* facep); @@ -271,6 +284,7 @@ public: static BOOL sSkipOpaque; static BOOL sSkipTransparent; + static S32 sShadowPass; static S32 sDiffuseChannel; static F32 sMinimumAlpha; diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index d2acfa291c..2468aeffa2 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -212,7 +212,11 @@ LLGLSLShader gDeferredShadowProgram; LLGLSLShader gDeferredShadowCubeProgram; LLGLSLShader gDeferredShadowAlphaMaskProgram; LLGLSLShader gDeferredAvatarShadowProgram; +LLGLSLShader gDeferredAvatarAlphaShadowProgram; +LLGLSLShader gDeferredAvatarAlphaMaskShadowProgram; LLGLSLShader gDeferredAttachmentShadowProgram; +LLGLSLShader gDeferredAttachmentAlphaShadowProgram; +LLGLSLShader gDeferredAttachmentAlphaMaskShadowProgram; LLGLSLShader gDeferredAlphaProgram; LLGLSLShader gDeferredAlphaImpostorProgram; LLGLSLShader gDeferredAlphaWaterProgram; @@ -1836,6 +1840,30 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() success = gDeferredAvatarShadowProgram.createShader(NULL, NULL); } + if (success) + { + gDeferredAvatarAlphaShadowProgram.mName = "Deferred Avatar Alpha Shadow Shader"; + gDeferredAvatarAlphaShadowProgram.mFeatures.hasSkinning = true; + gDeferredAvatarAlphaShadowProgram.mShaderFiles.clear(); + gDeferredAvatarAlphaShadowProgram.mShaderFiles.push_back(make_pair("deferred/avatarAlphaShadowV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredAvatarAlphaShadowProgram.mShaderFiles.push_back(make_pair("deferred/avatarAlphaShadowF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredAvatarAlphaShadowProgram.addPermutation("DEPTH_CLAMP", gGLManager.mHasDepthClamp ? "1" : "0"); + gDeferredAvatarAlphaShadowProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + success = gDeferredAvatarAlphaShadowProgram.createShader(NULL, NULL); + } + + if (success) + { + gDeferredAvatarAlphaMaskShadowProgram.mName = "Deferred Avatar Alpha Mask Shadow Shader"; + gDeferredAvatarAlphaMaskShadowProgram.mFeatures.hasSkinning = true; + gDeferredAvatarAlphaMaskShadowProgram.mShaderFiles.clear(); + gDeferredAvatarAlphaMaskShadowProgram.mShaderFiles.push_back(make_pair("deferred/avatarAlphaShadowV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredAvatarAlphaMaskShadowProgram.mShaderFiles.push_back(make_pair("deferred/avatarAlphaMaskShadowF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredAvatarAlphaMaskShadowProgram.addPermutation("DEPTH_CLAMP", gGLManager.mHasDepthClamp ? "1" : "0"); + gDeferredAvatarAlphaMaskShadowProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + success = gDeferredAvatarAlphaMaskShadowProgram.createShader(NULL, NULL); + } + if (success) { gDeferredAttachmentShadowProgram.mName = "Deferred Attachment Shadow Shader"; @@ -1847,6 +1875,30 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAttachmentShadowProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; success = gDeferredAttachmentShadowProgram.createShader(NULL, NULL); } + + if (success) + { + gDeferredAttachmentAlphaShadowProgram.mName = "Deferred Attachment Alpha Shadow Shader"; + gDeferredAttachmentAlphaShadowProgram.mFeatures.hasObjectSkinning = true; + gDeferredAttachmentAlphaShadowProgram.mShaderFiles.clear(); + gDeferredAttachmentAlphaShadowProgram.mShaderFiles.push_back(make_pair("deferred/attachmentAlphaShadowV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredAttachmentAlphaShadowProgram.mShaderFiles.push_back(make_pair("deferred/attachmentAlphaShadowF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredAttachmentAlphaShadowProgram.addPermutation("DEPTH_CLAMP", gGLManager.mHasDepthClamp ? "1" : "0"); + gDeferredAttachmentAlphaShadowProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + success = gDeferredAttachmentAlphaShadowProgram.createShader(NULL, NULL); + } + + if (success) + { + gDeferredAttachmentAlphaMaskShadowProgram.mName = "Deferred Attachment Alpha Mask Shadow Shader"; + gDeferredAttachmentAlphaMaskShadowProgram.mFeatures.hasObjectSkinning = true; + gDeferredAttachmentAlphaMaskShadowProgram.mShaderFiles.clear(); + gDeferredAttachmentAlphaMaskShadowProgram.mShaderFiles.push_back(make_pair("deferred/attachmentAlphaShadowV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredAttachmentAlphaMaskShadowProgram.mShaderFiles.push_back(make_pair("deferred/attachmentAlphaMaskShadowF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredAttachmentAlphaMaskShadowProgram.addPermutation("DEPTH_CLAMP", gGLManager.mHasDepthClamp ? "1" : "0"); + gDeferredAttachmentAlphaMaskShadowProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + success = gDeferredAttachmentAlphaMaskShadowProgram.createShader(NULL, NULL); + } if (success) { diff --git a/indra/newview/llviewershadermgr.h b/indra/newview/llviewershadermgr.h index 923aa522ad..9ba7d7f742 100644 --- a/indra/newview/llviewershadermgr.h +++ b/indra/newview/llviewershadermgr.h @@ -319,6 +319,10 @@ extern LLGLSLShader gDeferredPostNoDoFProgram; extern LLGLSLShader gDeferredPostGammaCorrectProgram; extern LLGLSLShader gDeferredAvatarShadowProgram; extern LLGLSLShader gDeferredAttachmentShadowProgram; +extern LLGLSLShader gDeferredAttachmentAlphaShadowProgram; +extern LLGLSLShader gDeferredAttachmentAlphaMaskShadowProgram; +extern LLGLSLShader gDeferredAvatarAlphaShadowProgram; +extern LLGLSLShader gDeferredAvatarAlphaMaskShadowProgram; extern LLGLSLShader gDeferredAlphaProgram; extern LLGLSLShader gDeferredAlphaImpostorProgram; extern LLGLSLShader gDeferredFullbrightProgram; -- cgit v1.2.3 From 8a352faeae571d2ff800770070265f41a33525d9 Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Thu, 16 Aug 2018 18:32:34 +0300 Subject: MAINT-8937 - Selection Outline Odd Behavior When Panning Around Fixed. --- indra/newview/llselectmgr.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 245d248390..8ec1d0e9f7 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -6317,7 +6317,9 @@ void LLSelectNode::renderOneWireframe(const LLColor4& color) glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - if (LLSelectMgr::sRenderHiddenSelections) // && gFloaterTools && gFloaterTools->getVisible()) + bool wireframe_selection = gFloaterTools && gFloaterTools->getVisible() || LLSelectMgr::sRenderHiddenSelections; + + if (LLSelectMgr::sRenderHiddenSelections) { gGL.blendFunc(LLRender::BF_SOURCE_COLOR, LLRender::BF_ONE); LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE, GL_GEQUAL); @@ -6350,8 +6352,6 @@ void LLSelectNode::renderOneWireframe(const LLColor4& color) gGL.diffuseColor4f(color.mV[VRED] * 2, color.mV[VGREEN] * 2, color.mV[VBLUE] * 2, LLSelectMgr::sHighlightAlpha * 2); { - bool wireframe_selection = gFloaterTools && gFloaterTools->getVisible(); - LLGLDisable depth(wireframe_selection ? 0 : GL_BLEND); LLGLEnable stencil(wireframe_selection ? 0 : GL_STENCIL_TEST); -- cgit v1.2.3 From 7bb2faac0fb790c76e54493c641e5a77561fde26 Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Thu, 16 Aug 2018 21:09:45 +0300 Subject: mac build fix --- indra/newview/llselectmgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 8ec1d0e9f7..02d73936e3 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -6317,7 +6317,7 @@ void LLSelectNode::renderOneWireframe(const LLColor4& color) glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - bool wireframe_selection = gFloaterTools && gFloaterTools->getVisible() || LLSelectMgr::sRenderHiddenSelections; + bool wireframe_selection = (gFloaterTools && gFloaterTools->getVisible()) || LLSelectMgr::sRenderHiddenSelections; if (LLSelectMgr::sRenderHiddenSelections) { -- cgit v1.2.3 From b066310231f4c5a5dc8a0d34a7b9679a32d99aed Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 21 Aug 2018 18:24:08 +0100 Subject: MAINT-9024 MAINT-9025 fix shadow render of materials objects to use alpha and don't draw MATERIAL_ALPHA content twice in shadow pass --- indra/newview/lldrawpoolavatar.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index b318156cf8..89e861bb51 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -563,11 +563,13 @@ void LLDrawPoolAvatar::renderShadow(S32 pass) { LLDrawPoolAvatar::sSkipOpaque = true; renderRigged(avatarp, RIGGED_MATERIAL_ALPHA); - renderRigged(avatarp, RIGGED_MATERIAL_ALPHA); renderRigged(avatarp, RIGGED_MATERIAL_ALPHA_EMISSIVE); renderRigged(avatarp, RIGGED_ALPHA); renderRigged(avatarp, RIGGED_FULLBRIGHT_ALPHA); renderRigged(avatarp, RIGGED_GLOW); + renderRigged(avatarp, RIGGED_SPECMAP_BLEND); + renderRigged(avatarp, RIGGED_NORMMAP_BLEND); + renderRigged(avatarp, RIGGED_NORMSPEC_BLEND); LLDrawPoolAvatar::sSkipOpaque = false; } else if (pass == SHADOW_PASS_ATTACHMENT_ALPHA_MASK) // rigged alpha mask @@ -585,13 +587,10 @@ void LLDrawPoolAvatar::renderShadow(S32 pass) LLDrawPoolAvatar::sSkipTransparent = true; renderRigged(avatarp, RIGGED_MATERIAL); renderRigged(avatarp, RIGGED_SPECMAP); - renderRigged(avatarp, RIGGED_SPECMAP_BLEND); renderRigged(avatarp, RIGGED_SPECMAP_EMISSIVE); - renderRigged(avatarp, RIGGED_NORMMAP); - renderRigged(avatarp, RIGGED_NORMMAP_BLEND); + renderRigged(avatarp, RIGGED_NORMMAP); renderRigged(avatarp, RIGGED_NORMMAP_EMISSIVE); renderRigged(avatarp, RIGGED_NORMSPEC); - renderRigged(avatarp, RIGGED_NORMSPEC_BLEND); renderRigged(avatarp, RIGGED_NORMSPEC_EMISSIVE); renderRigged(avatarp, RIGGED_SIMPLE); renderRigged(avatarp, RIGGED_FULLBRIGHT); @@ -1804,6 +1803,10 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) for (U32 i = 0; i < mRiggedFace[type].size(); ++i) { LLFace* face = mRiggedFace[type][i]; + + S32 offset = face->getIndicesStart(); + U32 count = face->getIndicesCount(); + LLDrawable* drawable = face->getDrawable(); if (!drawable) { @@ -1969,9 +1972,7 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) } U16 start = face->getGeomStart(); - U16 end = start + face->getGeomCount()-1; - S32 offset = face->getIndicesStart(); - U32 count = face->getIndicesCount(); + U16 end = start + face->getGeomCount()-1; /*if (glow) { -- cgit v1.2.3 From 50f6504d75f30efb2955b82d7ec2b5283c10f402 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Sat, 25 Aug 2018 00:26:26 +0100 Subject: MAINT-9046 honor alpha mode none even when texture has alpha channel when checking state in avatar attachment shadow passes --- indra/newview/lldrawpoolavatar.cpp | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 89e861bb51..a9df63debd 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -1859,6 +1859,20 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) bool is_alpha_blend = false; bool is_alpha_mask = false; + LLViewerTexture* tex = face->getTexture(LLRender::DIFFUSE_MAP); + if (tex) + { + LLGLenum image_format = tex->getPrimaryFormat(); + if (tex->getIsAlphaMask()) + { + is_alpha_mask = true; + } + else if (!is_alpha_mask && (image_format == GL_RGBA || image_format == GL_ALPHA)) + { + is_alpha_blend = true; + } + } + if (mat) { switch (LLMaterial::eDiffuseAlphaMode(mat->getDiffuseAlphaMode())) @@ -1879,6 +1893,7 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) case LLMaterial::DIFFUSE_ALPHA_MODE_DEFAULT: case LLMaterial::DIFFUSE_ALPHA_MODE_NONE: default: + is_alpha_blend = false; break; } } @@ -1891,20 +1906,6 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) } } - LLViewerTexture* tex = face->getTexture(LLRender::DIFFUSE_MAP); - if (tex) - { - LLGLenum image_format = tex->getPrimaryFormat(); - if (tex->getIsAlphaMask()) - { - is_alpha_mask = true; - } - else if (!is_alpha_mask && (image_format == GL_RGBA || image_format == GL_ALPHA)) - { - is_alpha_blend = true; - } - } - // if this is alpha mask content and we're doing opaques or a non-alpha-mask shadow pass... if (is_alpha_mask && (LLDrawPoolAvatar::sSkipTransparent || LLDrawPoolAvatar::sShadowPass != SHADOW_PASS_ATTACHMENT_ALPHA_MASK)) { -- cgit v1.2.3 From 20a2019e4b5a3456d9d5b1ce647b5f459e6e29b1 Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Mon, 3 Sep 2018 17:22:15 +0300 Subject: MAINT-9076 Improved support for Retina Displays --- indra/llwindow/llopenglview-objc.mm | 44 ++++++++++++++++++++++++----------- indra/llwindow/llwindow.h | 3 +++ indra/llwindow/llwindowmacosx-objc.h | 6 +++++ indra/llwindow/llwindowmacosx-objc.mm | 10 ++++++++ indra/llwindow/llwindowmacosx.cpp | 35 +++++++++++++++++----------- indra/llwindow/llwindowmacosx.h | 3 ++- indra/newview/llviewerwindow.cpp | 4 ++-- 7 files changed, 74 insertions(+), 31 deletions(-) diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index c8c086d705..de123d80d5 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -154,8 +154,8 @@ attributedStringInfo getSegments(NSAttributedString *str) { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowResized:) name:NSWindowDidResizeNotification - object:[self window]]; - + object:[self window]]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowWillMiniaturize:) name:NSWindowWillMiniaturizeNotification object:[self window]]; @@ -167,6 +167,14 @@ attributedStringInfo getSegments(NSAttributedString *str) [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowDidBecomeKey:) name:NSWindowDidBecomeKeyNotification object:[self window]]; + + + NSRect wnd_rect = [[self window] frame]; + NSRect dev_rect = [self convertRectToBacking:wnd_rect]; + if (!NSEqualSizes(wnd_rect.size,dev_rect.size)) + { + callResize(dev_rect.size.width, dev_rect.size.height); + } } - (void)setOldResize:(bool)oldresize @@ -178,8 +186,8 @@ attributedStringInfo getSegments(NSAttributedString *str) { if (!mOldResize) //Maint-3288 { - NSSize size = [self frame].size; - callResize(size.width, size.height); + NSSize dev_sz = [self convertSizeToBacking:[self frame].size]; + callResize(dev_sz.width, dev_sz.height); } } @@ -258,7 +266,10 @@ attributedStringInfo getSegments(NSAttributedString *str) } [self setPixelFormat:pixelFormat]; - + + //for retina support + [self setWantsBestResolutionOpenGLSurface:YES]; + [self setOpenGLContext:glContext]; [glContext setView:self]; @@ -350,7 +361,7 @@ attributedStringInfo getSegments(NSAttributedString *str) callRightMouseUp(mMousePos, [theEvent modifierFlags]); mSimulatedRightClick = false; } else { - NSPoint mPoint = [theEvent locationInWindow]; + NSPoint mPoint = [self convertPointToBacking:[theEvent locationInWindow]]; mMousePos[0] = mPoint.x; mMousePos[1] = mPoint.y; callLeftMouseUp(mMousePos, [theEvent modifierFlags]); @@ -369,14 +380,16 @@ attributedStringInfo getSegments(NSAttributedString *str) - (void)mouseMoved:(NSEvent *)theEvent { - float mouseDeltas[2] = { - float([theEvent deltaX]), - float([theEvent deltaY]) + NSPoint dev_delta = [self convertPointToBacking:NSMakePoint([theEvent deltaX], [theEvent deltaY])]; + + float mouseDeltas[] = { + float(dev_delta.x), + float(dev_delta.y) }; callDeltaUpdate(mouseDeltas, 0); - NSPoint mPoint = [theEvent locationInWindow]; + NSPoint mPoint = [self convertPointToBacking:[theEvent locationInWindow]]; mMousePos[0] = mPoint.x; mMousePos[1] = mPoint.y; callMouseMoved(mMousePos, 0); @@ -390,14 +403,17 @@ attributedStringInfo getSegments(NSAttributedString *str) // Trust the deltas supplied by NSEvent. // The old CoreGraphics APIs we previously relied on are now flagged as obsolete. // NSEvent isn't obsolete, and provides us with the correct deltas. - float mouseDeltas[2] = { - float([theEvent deltaX]), - float([theEvent deltaY]) + + NSPoint dev_delta = [self convertPointToBacking:NSMakePoint([theEvent deltaX], [theEvent deltaY])]; + + float mouseDeltas[] = { + float(dev_delta.x), + float(dev_delta.y) }; callDeltaUpdate(mouseDeltas, 0); - NSPoint mPoint = [theEvent locationInWindow]; + NSPoint mPoint = [self convertPointToBacking:[theEvent locationInWindow]]; mMousePos[0] = mPoint.x; mMousePos[1] = mPoint.y; callMouseDragged(mMousePos, 0); diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h index a05ba8cbba..cb0daea2cd 100644 --- a/indra/llwindow/llwindow.h +++ b/indra/llwindow/llwindow.h @@ -166,6 +166,9 @@ public: // Provide native key event data virtual LLSD getNativeKeyData() { return LLSD::emptyMap(); } + // Default scale + virtual float getDeviceScaleFactor() { return 1.0f; } + // Get system UI size based on DPI (for 96 DPI UI size should be 1.0) virtual F32 getSystemUISize() { return 1.0; } protected: diff --git a/indra/llwindow/llwindowmacosx-objc.h b/indra/llwindow/llwindowmacosx-objc.h index b06cd2c184..ef5f803718 100644 --- a/indra/llwindow/llwindowmacosx-objc.h +++ b/indra/llwindow/llwindowmacosx-objc.h @@ -31,6 +31,9 @@ #include #include +//fir CGSize +#include + typedef std::vector > segment_t; typedef std::vector segment_lengths; @@ -101,11 +104,14 @@ void setResizeMode(bool oldresize, void* glview); NSWindowRef createNSWindow(int x, int y, int width, int height); #include + GLViewRef createOpenGLView(NSWindowRef window, unsigned int samples, bool vsync); void glSwapBuffers(void* context); CGLContextObj getCGLContextObj(GLViewRef view); unsigned long getVramSize(GLViewRef view); +float getDeviceUnitSize(GLViewRef view); void getContentViewBounds(NSWindowRef window, float* bounds); +const CGSize & getDeviceContentViewSize(NSWindowRef window, GLViewRef view); void getWindowSize(NSWindowRef window, float* size); void setWindowSize(NSWindowRef window, int width, int height); void getCursorPos(NSWindowRef window, float* pos); diff --git a/indra/llwindow/llwindowmacosx-objc.mm b/indra/llwindow/llwindowmacosx-objc.mm index 43ce9a2255..489f92fa14 100644 --- a/indra/llwindow/llwindowmacosx-objc.mm +++ b/indra/llwindow/llwindowmacosx-objc.mm @@ -253,6 +253,11 @@ unsigned long getVramSize(GLViewRef view) return [(LLOpenGLView *)view getVramSize]; } +float getDeviceUnitSize(GLViewRef view) +{ + return [(LLOpenGLView*)view convertSizeToBacking:NSMakeSize(1, 1)].width; +} + void getContentViewBounds(NSWindowRef window, float* bounds) { bounds[0] = [[(LLNSWindow*)window contentView] bounds].origin.x; @@ -261,6 +266,11 @@ void getContentViewBounds(NSWindowRef window, float* bounds) bounds[3] = [[(LLNSWindow*)window contentView] bounds].size.height; } +const CGSize & getDeviceContentViewSize(NSWindowRef window, GLViewRef view) +{ + return [(NSOpenGLView*)view convertRectToBacking:[[(LLNSWindow*)window contentView] bounds]].size; +} + void getWindowSize(NSWindowRef window, float* size) { NSRect frame = [(LLNSWindow*)window frame]; diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 843294c239..7f6b30bd37 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -845,7 +845,6 @@ BOOL LLWindowMacOSX::getPosition(LLCoordScreen *position) BOOL LLWindowMacOSX::getSize(LLCoordScreen *size) { - float rect[4]; S32 err = -1; if(mFullscreen) @@ -856,10 +855,10 @@ BOOL LLWindowMacOSX::getSize(LLCoordScreen *size) } else if(mWindow) { - getContentViewBounds(mWindow, rect); + const CGSize & sz = getDeviceContentViewSize(mWindow, mGLView); - size->mX = rect[2]; - size->mY = rect[3]; + size->mX = sz.width; + size->mY = sz.height; } else { @@ -871,7 +870,6 @@ BOOL LLWindowMacOSX::getSize(LLCoordScreen *size) BOOL LLWindowMacOSX::getSize(LLCoordWindow *size) { - float rect[4]; S32 err = -1; if(mFullscreen) @@ -882,10 +880,10 @@ BOOL LLWindowMacOSX::getSize(LLCoordWindow *size) } else if(mWindow) { - getContentViewBounds(mWindow, rect); + const CGSize & sz = getDeviceContentViewSize(mWindow, mGLView); - size->mX = rect[2]; - size->mY = rect[3]; + size->mX = sz.width; + size->mY = sz.height; } else { @@ -1124,8 +1122,9 @@ BOOL LLWindowMacOSX::getCursorPosition(LLCoordWindow *position) cursor_point[1] += mCursorLastEventDeltaY; } - position->mX = cursor_point[0]; - position->mY = cursor_point[1]; + float scale = getDeviceScaleFactor(); + position->mX = cursor_point[0] * scale; + position->mY = cursor_point[1] * scale; return TRUE; } @@ -1318,8 +1317,9 @@ BOOL LLWindowMacOSX::convertCoords(LLCoordScreen from, LLCoordWindow* to) convertScreenToWindow(mWindow, mouse_point); - to->mX = mouse_point[0]; - to->mY = mouse_point[1]; + float scale_factor = getDeviceScaleFactor(); + to->mX = mouse_point[0] * scale_factor; + to->mY = mouse_point[1] * scale_factor; return TRUE; } @@ -1334,10 +1334,12 @@ BOOL LLWindowMacOSX::convertCoords(LLCoordWindow from, LLCoordScreen *to) mouse_point[0] = from.mX; mouse_point[1] = from.mY; + convertWindowToScreen(mWindow, mouse_point); - to->mX = mouse_point[0]; - to->mY = mouse_point[1]; + float scale_factor = getDeviceScaleFactor(); + to->mX = mouse_point[0] / scale_factor; + to->mY = mouse_point[1] / scale_factor; return TRUE; } @@ -1891,6 +1893,11 @@ MASK LLWindowMacOSX::modifiersToMask(S16 modifiers) return mask; } +F32 LLWindowMacOSX::getDeviceScaleFactor() +{ + return ::getDeviceUnitSize(mGLView); +} + #if LL_OS_DRAGDROP_ENABLED /* S16 LLWindowMacOSX::dragTrackingHandler(DragTrackingMessage message, WindowRef theWindow, diff --git a/indra/llwindow/llwindowmacosx.h b/indra/llwindow/llwindowmacosx.h index 9e9bd8ae39..fc5c9a0054 100644 --- a/indra/llwindow/llwindowmacosx.h +++ b/indra/llwindow/llwindowmacosx.h @@ -112,6 +112,7 @@ public: /*virtual*/ void allowLanguageTextInput(LLPreeditor *preeditor, BOOL b); /*virtual*/ void interruptLanguageTextInput(); /*virtual*/ void spawnWebBrowser(const std::string& escaped_url, bool async); + /*virtual*/ F32 getDeviceScaleFactor(); static std::vector getDynamicFallbackFontList(); @@ -135,7 +136,7 @@ protected: BOOL fullscreen, BOOL clearBg, BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth, U32 fsaa_samples); - ~LLWindowMacOSX(); + ~LLWindowMacOSX(); void initCursors(); BOOL isValid(); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index cef19c9c2d..563ccea704 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1770,7 +1770,7 @@ LLViewerWindow::LLViewerWindow(const Params& p) // Get the real window rect the window was created with (since there are various OS-dependent reasons why // the size of a window or fullscreen context may have been adjusted slightly...) - F32 ui_scale_factor = llclamp(gSavedSettings.getF32("UIScaleFactor"), MIN_UI_SCALE, MAX_UI_SCALE); + F32 ui_scale_factor = llclamp(gSavedSettings.getF32("UIScaleFactor"), MIN_UI_SCALE, MAX_UI_SCALE) * mWindow->getDeviceScaleFactor(); mDisplayScale.setVec(llmax(1.f / mWindow->getPixelAspectRatio(), 1.f), llmax(mWindow->getPixelAspectRatio(), 1.f)); mDisplayScale *= ui_scale_factor; @@ -5380,7 +5380,7 @@ F32 LLViewerWindow::getWorldViewAspectRatio() const void LLViewerWindow::calcDisplayScale() { - F32 ui_scale_factor = llclamp(gSavedSettings.getF32("UIScaleFactor"), MIN_UI_SCALE, MAX_UI_SCALE); + F32 ui_scale_factor = llclamp(gSavedSettings.getF32("UIScaleFactor"), MIN_UI_SCALE, MAX_UI_SCALE) * mWindow->getDeviceScaleFactor(); LLVector2 display_scale; display_scale.setVec(llmax(1.f / mWindow->getPixelAspectRatio(), 1.f), llmax(mWindow->getPixelAspectRatio(), 1.f)); display_scale *= ui_scale_factor; -- cgit v1.2.3 From 76802a727e92437226d4c51444e9f03a320a8034 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Wed, 12 Sep 2018 17:09:56 +0100 Subject: Merge --- 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 8e8cce5787..0a9ebf8729 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -8653,7 +8653,7 @@ Type Boolean Value - 0 + 1 RenderLocalLights -- cgit v1.2.3 From 1d2cbc2baad178bc896fd35d9ce2496574e988d9 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Wed, 12 Sep 2018 18:41:34 +0100 Subject: SL-4178 make deferred version of highlight shader that fills in zero spec and env intensity to keep the shiny down --- .../shaders/class1/deferred/highlightF.glsl | 42 ++++++++++++++++++++++ indra/newview/lldrawpoolterrain.cpp | 8 ++--- indra/newview/lldrawpoolterrain.h | 2 +- indra/newview/llviewershadermgr.cpp | 38 ++++++++++++++++++++ indra/newview/llviewershadermgr.h | 4 +++ 5 files changed, 89 insertions(+), 5 deletions(-) create mode 100644 indra/newview/app_settings/shaders/class1/deferred/highlightF.glsl diff --git a/indra/newview/app_settings/shaders/class1/deferred/highlightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/highlightF.glsl new file mode 100644 index 0000000000..1adeb9237c --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/deferred/highlightF.glsl @@ -0,0 +1,42 @@ +/** + * @file highlightF.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$ + */ + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 frag_data[3]; +#else +#define frag_data gl_FragData +#endif + +uniform vec4 color; +uniform sampler2D diffuseMap; + +VARYING vec2 vary_texcoord0; + +void main() +{ + frag_data[0] = color*texture2D(diffuseMap, vary_texcoord0.xy)); + frag_data[1] = vec4(0.0); + frag_data[2] = vec4(0.0, 1.0, 0.0, 1.0); +} diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp index b716a76543..3eefcef7aa 100644 --- a/indra/newview/lldrawpoolterrain.cpp +++ b/indra/newview/lldrawpoolterrain.cpp @@ -207,7 +207,7 @@ void LLDrawPoolTerrain::render(S32 pass) // Special-case for land ownership feedback if (gSavedSettings.getBOOL("ShowParcelOwners")) { - hilightParcelOwners(); + hilightParcelOwners(false); } } @@ -241,7 +241,7 @@ void LLDrawPoolTerrain::renderDeferred(S32 pass) // Special-case for land ownership feedback if (gSavedSettings.getBOOL("ShowParcelOwners")) { - hilightParcelOwners(); + hilightParcelOwners(true); } } @@ -432,13 +432,13 @@ void LLDrawPoolTerrain::renderFullShader() gGL.matrixMode(LLRender::MM_MODELVIEW); } -void LLDrawPoolTerrain::hilightParcelOwners() +void LLDrawPoolTerrain::hilightParcelOwners(bool deferred) { if (mVertexShaderLevel > 1) { //use fullbright shader for highlighting LLGLSLShader* old_shader = sShader; sShader->unbind(); - sShader = &gHighlightProgram; + sShader = deferred ? &gDeferredHighlightProgram : &gHighlightProgram; sShader->bind(); gGL.diffuseColor4f(1, 1, 1, 1); LLGLEnable polyOffset(GL_POLYGON_OFFSET_FILL); diff --git a/indra/newview/lldrawpoolterrain.h b/indra/newview/lldrawpoolterrain.h index 55f75e2644..484820491a 100644 --- a/indra/newview/lldrawpoolterrain.h +++ b/indra/newview/lldrawpoolterrain.h @@ -87,7 +87,7 @@ protected: void drawLoop(); private: - void hilightParcelOwners(); + void hilightParcelOwners(bool deferred); }; #endif // LL_LLDRAWPOOLSIMPLE_H diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 2468aeffa2..b3d561edd5 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -161,6 +161,10 @@ LLGLSLShader gHighlightProgram; LLGLSLShader gHighlightNormalProgram; LLGLSLShader gHighlightSpecularProgram; +LLGLSLShader gDeferredHighlightProgram; +LLGLSLShader gDeferredHighlightNormalProgram; +LLGLSLShader gDeferredHighlightSpecularProgram; + LLGLSLShader gPathfindingProgram; LLGLSLShader gPathfindingNoNormalsProgram; @@ -1171,6 +1175,10 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSkinnedFullbrightShinyProgram.unload(); gDeferredSkinnedFullbrightProgram.unload(); + gDeferredHighlightProgram.unload(); + gDeferredHighlightNormalProgram.unload(); + gDeferredHighlightSpecularProgram.unload(); + gNormalMapGenProgram.unload(); for (U32 i = 0; i < LLMaterial::SHADER_COUNT*2; ++i) { @@ -1182,6 +1190,36 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() BOOL success = TRUE; + if (success) + { + gDeferredHighlightProgram.mName = "Deferred Highlight Shader"; + gDeferredHighlightProgram.mShaderFiles.clear(); + gDeferredHighlightProgram.mShaderFiles.push_back(make_pair("interface/highlightV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredHighlightProgram.mShaderFiles.push_back(make_pair("deferred/highlightF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredHighlightProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; + success = gDeferredHighlightProgram.createShader(NULL, NULL); + } + + if (success) + { + gDeferredHighlightNormalProgram.mName = "Deferred Highlight Normals Shader"; + gDeferredHighlightNormalProgram.mShaderFiles.clear(); + gDeferredHighlightNormalProgram.mShaderFiles.push_back(make_pair("interface/highlightNormV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredHighlightNormalProgram.mShaderFiles.push_back(make_pair("deferred/highlightF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredHighlightNormalProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; + success = gHighlightNormalProgram.createShader(NULL, NULL); + } + + if (success) + { + gDeferredHighlightSpecularProgram.mName = "Deferred Highlight Spec Shader"; + gDeferredHighlightSpecularProgram.mShaderFiles.clear(); + gDeferredHighlightSpecularProgram.mShaderFiles.push_back(make_pair("interface/highlightSpecV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredHighlightSpecularProgram.mShaderFiles.push_back(make_pair("deferred/highlightF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredHighlightSpecularProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; + success = gDeferredHighlightSpecularProgram.createShader(NULL, NULL); + } + if (success) { gDeferredDiffuseProgram.mName = "Deferred Diffuse Shader"; diff --git a/indra/newview/llviewershadermgr.h b/indra/newview/llviewershadermgr.h index 9ba7d7f742..9edaa97e57 100644 --- a/indra/newview/llviewershadermgr.h +++ b/indra/newview/llviewershadermgr.h @@ -264,6 +264,10 @@ extern LLGLSLShader gHighlightProgram; extern LLGLSLShader gHighlightNormalProgram; extern LLGLSLShader gHighlightSpecularProgram; +extern LLGLSLShader gDeferredHighlightProgram; +extern LLGLSLShader gDeferredHighlightNormalProgram; +extern LLGLSLShader gDeferredHighlightSpecularProgram; + extern LLGLSLShader gPathfindingProgram; extern LLGLSLShader gPathfindingNoNormalsProgram; -- cgit v1.2.3 From 609662dca5a9bdfeeaecfafc654e324e869335d0 Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Mon, 17 Sep 2018 16:40:25 +0300 Subject: SL-1503 MAINT Objects do not rendering under water Fixed. --- indra/newview/llviewerdisplay.cpp | 4 ++-- indra/newview/pipeline.cpp | 24 +++++++++++++----------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 86a9e7e2ad..64f6123f5d 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -689,7 +689,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) static LLCullResult result; LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_WORLD; - LLPipeline::sUnderWaterRender = LLViewerCamera::getInstance()->cameraUnderWater() ? TRUE : FALSE; + LLPipeline::sUnderWaterRender = LLViewerCamera::getInstance()->cameraUnderWater(); gPipeline.updateCull(*LLViewerCamera::getInstance(), result, water_clip); stop_glerror(); @@ -899,7 +899,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) // gGL.popMatrix(); //} - LLPipeline::sUnderWaterRender = LLViewerCamera::getInstance()->cameraUnderWater() ? TRUE : FALSE; + LLPipeline::sUnderWaterRender = LLViewerCamera::getInstance()->cameraUnderWater(); LLGLState::checkStates(); LLGLState::checkClientArrays(); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 5699d47ad8..dbb79e8e63 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -2525,7 +2525,7 @@ void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_cl LLVOCachePartition* vo_part = region->getVOCachePartition(); if(vo_part) { - bool do_occlusion_cull = can_use_occlusion && use_occlusion && !gUseWireframe/* && !gViewerWindow->getProgressView()->getVisible()*/; + bool do_occlusion_cull = can_use_occlusion && use_occlusion && !gUseWireframe && 0 > water_clip /* && !gViewerWindow->getProgressView()->getVisible()*/; vo_part->cull(camera, do_occlusion_cull); } } @@ -9853,16 +9853,16 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) gPipeline.grabReferences(result); gPipeline.mDeferredScreen.bindTarget(); - gGL.setColorMask(true, true); + gGL.setColorMask(true, true); glClearColor(0,0,0,0); gPipeline.mDeferredScreen.clear(); - renderGeomDeferred(camera); + renderGeomDeferred(camera); } else { - renderGeom(camera, TRUE); - } + renderGeom(camera, TRUE); + } gPipeline.popRenderTypeMask(); } @@ -9880,6 +9880,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) S32 detail = RenderReflectionDetail; if (detail > 0) { //mask out selected geometry based on reflection detail + if (detail < 4) { clearRenderTypeMask(LLPipeline::RENDER_TYPE_PARTICLES, END_RENDER_TYPES); @@ -9893,6 +9894,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) } } + LLGLUserClipPlane clip_plane(plane, mat, projection); LLGLDisable cull(GL_CULL_FACE); updateCull(camera, ref_result, -water_clip, &plane); @@ -9907,15 +9909,15 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) LLGLUserClipPlane clip_plane(plane, mat, projection); if (LLPipeline::sRenderDeferred && materials_in_water) - { + { renderGeomDeferred(camera); } else { - renderGeom(camera); + renderGeom(camera); + } } - } - } + } if (LLPipeline::sRenderDeferred && materials_in_water) { @@ -9984,14 +9986,14 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) if (LLPipeline::sRenderDeferred && materials_in_water) - { + { mWaterDis.flush(); gPipeline.mDeferredScreen.bindTarget(); gGL.setColorMask(true, true); glClearColor(0,0,0,0); gPipeline.mDeferredScreen.clear(); gPipeline.grabReferences(result); - renderGeomDeferred(camera); + renderGeomDeferred(camera); } else { -- cgit v1.2.3 From 53abfe53bd91e7d81ffbf037b807e2e8b226d2f2 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 18 Sep 2018 17:53:35 +0100 Subject: SL-1835 Make attachmentAlphaMaskShadow frag shader ignore vert alpha which can be incorrect. Make discard test in attachmentAlphaMaskShadow match other shadow shaders more closely. Fix highlightF shader compile error. --- .../class1/deferred/attachmentAlphaMaskShadowF.glsl | 4 ++-- .../shaders/class1/deferred/highlightF.glsl | 2 +- indra/newview/lldrawpoolavatar.cpp | 21 +++++++++++++-------- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/attachmentAlphaMaskShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/attachmentAlphaMaskShadowF.glsl index a08550d69c..c64b6ba240 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/attachmentAlphaMaskShadowF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/attachmentAlphaMaskShadowF.glsl @@ -41,7 +41,7 @@ VARYING vec4 vertex_color; void main() { - float alpha = texture2D(diffuseMap, vary_texcoord0.xy).a * vertex_color.a; + float alpha = texture2D(diffuseMap, vary_texcoord0.xy).a; if (alpha < 0.05) // treat as totally transparent { @@ -50,7 +50,7 @@ void main() if (alpha < minimum_alpha) // treat as semi-transparent { - if (fract(0.5*floor(target_pos_x / pos_w )) < 0.25) + //if (fract(0.5*floor(target_pos_x / pos_w )) < 0.25) { discard; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/highlightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/highlightF.glsl index 1adeb9237c..90566393d2 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/highlightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/highlightF.glsl @@ -36,7 +36,7 @@ VARYING vec2 vary_texcoord0; void main() { - frag_data[0] = color*texture2D(diffuseMap, vary_texcoord0.xy)); + frag_data[0] = color*texture2D(diffuseMap, vary_texcoord0.xy); frag_data[1] = vec4(0.0); frag_data[2] = vec4(0.0, 1.0, 0.0, 1.0); } diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index a9df63debd..a2308b2529 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -1807,6 +1807,9 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) S32 offset = face->getIndicesStart(); U32 count = face->getIndicesCount(); + U16 start = face->getGeomStart(); + U16 end = start + face->getGeomCount()-1; + LLDrawable* drawable = face->getDrawable(); if (!drawable) { @@ -1862,15 +1865,10 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) LLViewerTexture* tex = face->getTexture(LLRender::DIFFUSE_MAP); if (tex) { - LLGLenum image_format = tex->getPrimaryFormat(); if (tex->getIsAlphaMask()) { is_alpha_mask = true; } - else if (!is_alpha_mask && (image_format == GL_RGBA || image_format == GL_ALPHA)) - { - is_alpha_blend = true; - } } if (mat) @@ -1894,6 +1892,7 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) case LLMaterial::DIFFUSE_ALPHA_MODE_NONE: default: is_alpha_blend = false; + is_alpha_mask = false; break; } } @@ -1906,6 +1905,15 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) } } + if (tex) + { + LLGLenum image_format = tex->getPrimaryFormat(); + if (!is_alpha_mask && (image_format == GL_RGBA || image_format == GL_ALPHA)) + { + is_alpha_blend = true; + } + } + // if this is alpha mask content and we're doing opaques or a non-alpha-mask shadow pass... if (is_alpha_mask && (LLDrawPoolAvatar::sSkipTransparent || LLDrawPoolAvatar::sShadowPass != SHADOW_PASS_ATTACHMENT_ALPHA_MASK)) { @@ -1972,9 +1980,6 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) data_mask &= ~LLVertexBuffer::MAP_WEIGHT4; } - U16 start = face->getGeomStart(); - U16 end = start + face->getGeomCount()-1; - /*if (glow) { gGL.diffuseColor4f(0,0,0,face->getTextureEntry()->getGlow()); -- cgit v1.2.3 From c7574e3d2d953dc6aa86a5c1c82ea43c3969b4e9 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Thu, 20 Sep 2018 16:48:47 +0100 Subject: SL-1835 No change for non-bug, but turning off nSight debugging as it breaks snapshots. --- 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 0a9ebf8729..8e8cce5787 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -8653,7 +8653,7 @@ Type Boolean Value - 1 + 0 RenderLocalLights -- cgit v1.2.3 From 00fe3e06e2d4a43b8dc9fd03ae247b392bca5446 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Mon, 24 Sep 2018 16:57:31 +0100 Subject: SL-6613 more fine-tuning of the logic around rigged alpha shadows to avoid issues when a diffuse texture with alpha is used with non-blended material diffuse alpha modes --- indra/newview/lldrawpoolavatar.cpp | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index a2308b2529..a1003aa864 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -1871,19 +1871,38 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) } } + if (tex) + { + LLGLenum image_format = tex->getPrimaryFormat(); + if (!is_alpha_mask && (image_format == GL_RGBA || image_format == GL_ALPHA)) + { + is_alpha_blend = true; + } + } + + if (tex_entry) + { + if (tex_entry->getAlpha() <= 0.99f) + { + is_alpha_blend = true; + } + } + if (mat) { switch (LLMaterial::eDiffuseAlphaMode(mat->getDiffuseAlphaMode())) { case LLMaterial::DIFFUSE_ALPHA_MODE_MASK: { - is_alpha_mask = true; + is_alpha_mask = true; + is_alpha_blend = false; } break; case LLMaterial::DIFFUSE_ALPHA_MODE_BLEND: { is_alpha_blend = true; + is_alpha_mask = false; } break; @@ -1897,23 +1916,6 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) } } - if (tex_entry) - { - if (tex_entry->getAlpha() <= 0.99f) - { - is_alpha_blend = true; - } - } - - if (tex) - { - LLGLenum image_format = tex->getPrimaryFormat(); - if (!is_alpha_mask && (image_format == GL_RGBA || image_format == GL_ALPHA)) - { - is_alpha_blend = true; - } - } - // if this is alpha mask content and we're doing opaques or a non-alpha-mask shadow pass... if (is_alpha_mask && (LLDrawPoolAvatar::sSkipTransparent || LLDrawPoolAvatar::sShadowPass != SHADOW_PASS_ATTACHMENT_ALPHA_MASK)) { -- cgit v1.2.3 From 2823b0639e6b020cee138563d34c74ad769b0bae Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Thu, 27 Sep 2018 17:35:12 +0300 Subject: SL-2642 - Better error logging for missing binormals + remove unreachable code --- indra/newview/llvovolume.cpp | 5 ++++- indra/newview/llweb.cpp | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 7d6881f8a8..42dfcac7a6 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4432,7 +4432,10 @@ static LLTrace::BlockTimerStatHandle FTM_REGISTER_FACE("Register Face"); void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, U32 type) { LL_RECORD_BLOCK_TIME(FTM_REGISTER_FACE); - if (type == LLRenderPass::PASS_ALPHA && facep->getTextureEntry()->getMaterialParams().notNull() && !facep->getVertexBuffer()->hasDataType(LLVertexBuffer::TYPE_TANGENT)) + if ( type == LLRenderPass::PASS_ALPHA + && facep->getTextureEntry()->getMaterialParams().notNull() + && !facep->getVertexBuffer()->hasDataType(LLVertexBuffer::TYPE_TANGENT) + && LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_OBJECT) > 1) { LL_WARNS_ONCE("RenderMaterials") << "Oh no! No binormals for this alpha blended face!" << LL_ENDL; } diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp index 768db047a4..61ec02957e 100644 --- a/indra/newview/llweb.cpp +++ b/indra/newview/llweb.cpp @@ -274,6 +274,5 @@ bool LLWeb::useExternalBrowser(const std::string &url) boost::match_results matches; return boost::regex_search(url, matches, pattern); } - return false; #endif } -- cgit v1.2.3 From 6ce18422de822a195813e5daa890000e1556ac03 Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Fri, 19 Oct 2018 19:12:08 +0300 Subject: SL-9766 [Render] [Mac] Alt + left mouse click has severely impaired functions --- indra/llwindow/llwindowmacosx.cpp | 10 ++++------ indra/newview/llviewerwindow.cpp | 7 ++++--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 7f6b30bd37..b02b77ffbd 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -1317,9 +1317,8 @@ BOOL LLWindowMacOSX::convertCoords(LLCoordScreen from, LLCoordWindow* to) convertScreenToWindow(mWindow, mouse_point); - float scale_factor = getDeviceScaleFactor(); - to->mX = mouse_point[0] * scale_factor; - to->mY = mouse_point[1] * scale_factor; + to->mX = mouse_point[0]; + to->mY = mouse_point[1]; return TRUE; } @@ -1337,9 +1336,8 @@ BOOL LLWindowMacOSX::convertCoords(LLCoordWindow from, LLCoordScreen *to) convertWindowToScreen(mWindow, mouse_point); - float scale_factor = getDeviceScaleFactor(); - to->mX = mouse_point[0] / scale_factor; - to->mY = mouse_point[1] / scale_factor; + to->mX = mouse_point[0]; + to->mY = mouse_point[1]; return TRUE; } diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 36fbd12e92..024d965c6d 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -3016,12 +3016,13 @@ void LLViewerWindow::moveCursorToCenter() S32 x = getWorldViewWidthScaled() / 2; S32 y = getWorldViewHeightScaled() / 2; + F32 scale_factor = mWindow->getDeviceScaleFactor(); + LLUI::setMousePositionScreen(x/scale_factor, y/scale_factor); + //on a forced move, all deltas get zeroed out to prevent jumping mCurrentMousePoint.set(x,y); mLastMousePoint.set(x,y); - mCurrentMouseDelta.set(0,0); - - LLUI::setMousePositionScreen(x, y); + mCurrentMouseDelta.set(0,0); } } -- cgit v1.2.3 From eaeb8605d078846576304028cb46a57081abe113 Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Tue, 23 Oct 2018 19:24:03 +0300 Subject: SL-9774 [Render] dragging active Second Life session to second monitor zooms in making viewer unusable --- indra/llwindow/llopenglview-objc.mm | 8 ++++++++ indra/llwindow/llwindowcallbacks.cpp | 5 +++++ indra/llwindow/llwindowcallbacks.h | 1 + indra/llwindow/llwindowmacosx-objc.h | 1 + indra/llwindow/llwindowmacosx.cpp | 8 ++++++++ indra/newview/llviewerwindow.cpp | 8 ++++++++ indra/newview/llviewerwindow.h | 1 + 7 files changed, 32 insertions(+) diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index de123d80d5..ee05fd5cc9 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -167,6 +167,9 @@ attributedStringInfo getSegments(NSAttributedString *str) [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowDidBecomeKey:) name:NSWindowDidBecomeKeyNotification object:[self window]]; + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(windowDidChangeScreen:) name:NSWindowDidChangeScreenNotification + object:[self window]]; NSRect wnd_rect = [[self window] frame]; @@ -206,6 +209,11 @@ attributedStringInfo getSegments(NSAttributedString *str) mModifiers = [NSEvent modifierFlags]; } +-(void)windowDidChangeScreen:(NSNotification *)notification; +{ + callWindowDidChangeScreen(); +} + - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; diff --git a/indra/llwindow/llwindowcallbacks.cpp b/indra/llwindow/llwindowcallbacks.cpp index 7e90ade423..94c725fc7e 100644 --- a/indra/llwindow/llwindowcallbacks.cpp +++ b/indra/llwindow/llwindowcallbacks.cpp @@ -180,6 +180,11 @@ BOOL LLWindowCallbacks::handleDPIChanged(LLWindow *window, F32 ui_scale_factor, return FALSE; } +BOOL LLWindowCallbacks::handleWindowDidChangeScreen(LLWindow *window) +{ + return FALSE; +} + void LLWindowCallbacks::handlePingWatchdog(LLWindow *window, const char * msg) { diff --git a/indra/llwindow/llwindowcallbacks.h b/indra/llwindow/llwindowcallbacks.h index 47d5a18858..4d753024fe 100644 --- a/indra/llwindow/llwindowcallbacks.h +++ b/indra/llwindow/llwindowcallbacks.h @@ -66,6 +66,7 @@ public: virtual BOOL handleTimerEvent(LLWindow *window); virtual BOOL handleDeviceChange(LLWindow *window); virtual BOOL handleDPIChanged(LLWindow *window, F32 ui_scale_factor, S32 window_width, S32 window_height); + virtual BOOL handleWindowDidChangeScreen(LLWindow *window); enum DragNDropAction { DNDA_START_TRACKING = 0,// Start tracking an incoming drag diff --git a/indra/llwindow/llwindowmacosx-objc.h b/indra/llwindow/llwindowmacosx-objc.h index ef5f803718..743089be6b 100644 --- a/indra/llwindow/llwindowmacosx-objc.h +++ b/indra/llwindow/llwindowmacosx-objc.h @@ -147,6 +147,7 @@ void callWindowFocus(); void callWindowUnfocus(); void callWindowHide(); void callWindowUnhide(); +void callWindowDidChangeScreen(); void callDeltaUpdate(float *delta, unsigned int mask); void callMiddleMouseDown(float *pos, unsigned int mask); void callMiddleMouseUp(float *pos, unsigned int mask); diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index b02b77ffbd..376b8610b5 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -400,6 +400,14 @@ void callWindowUnhide() } } +void callWindowDidChangeScreen() +{ + if ( gWindowImplementation && gWindowImplementation->getCallbacks() ) + { + gWindowImplementation->getCallbacks()->handleWindowDidChangeScreen(gWindowImplementation); + } +} + void callDeltaUpdate(float *delta, MASK mask) { gWindowImplementation->updateMouseDeltas(delta); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 024d965c6d..0a8076173e 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1607,6 +1607,14 @@ BOOL LLViewerWindow::handleDPIChanged(LLWindow *window, F32 ui_scale_factor, S32 } } +BOOL LLViewerWindow::handleWindowDidChangeScreen(LLWindow *window) +{ + LLCoordScreen window_rect; + mWindow->getSize(&window_rect); + reshape(window_rect.mX, window_rect.mY); + return TRUE; +} + void LLViewerWindow::handlePingWatchdog(LLWindow *window, const char * msg) { LLAppViewer::instance()->pingMainloopTimeout(msg); diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index d8d420e6be..83ca18f85d 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -212,6 +212,7 @@ public: /*virtual*/ BOOL handleTimerEvent(LLWindow *window); /*virtual*/ BOOL handleDeviceChange(LLWindow *window); /*virtual*/ BOOL handleDPIChanged(LLWindow *window, F32 ui_scale_factor, S32 window_width, S32 window_height); + /*virtual*/ BOOL handleWindowDidChangeScreen(LLWindow *window); /*virtual*/ void handlePingWatchdog(LLWindow *window, const char * msg); /*virtual*/ void handlePauseWatchdog(LLWindow *window); -- cgit v1.2.3 From f3a42d070ecf27acc51e53d4ca8632c7036459ff Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Wed, 31 Oct 2018 18:11:00 +0200 Subject: SL-9984 - [Retina] Camera frustum, do not display correctly on "WORLD MAP" window. --- indra/newview/llworldmapview.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index 707fe76cef..ca57f4fb97 100644 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -884,8 +884,8 @@ void LLWorldMapView::drawFrustum() // Compute the frustum coordinates. Take the UI scale into account. F32 ui_scale_factor = gSavedSettings.getF32("UIScaleFactor"); - F32 ctr_x = (getLocalRect().getWidth() * 0.5f + sPanX) * ui_scale_factor; - F32 ctr_y = (getLocalRect().getHeight() * 0.5f + sPanY) * ui_scale_factor; + F32 ctr_x = ((getLocalRect().getWidth() * 0.5f + sPanX) * ui_scale_factor) * LLUI::getScaleFactor().mV[VX]; + F32 ctr_y = ((getLocalRect().getHeight() * 0.5f + sPanY) * ui_scale_factor) * LLUI::getScaleFactor().mV[VY]; gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); -- cgit v1.2.3 From fc2cdf62f186784548934b64ac4a559c32146614 Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Fri, 2 Nov 2018 16:27:34 +0200 Subject: SL-9766 [Render] [Mac] Alt + left mouse click has severely impaired functions FIX #2 --- indra/llui/llui.cpp | 10 ++++++---- indra/newview/llviewerwindow.cpp | 3 +-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 770f13c1c3..2e9188a6a8 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -236,9 +236,10 @@ void LLUI::dirtyRect(LLRect rect) //static void LLUI::setMousePositionScreen(S32 x, S32 y) { + F32 dev_scale_factor = LLView::getWindow()->getDeviceScaleFactor(); S32 screen_x, screen_y; - screen_x = ll_round((F32)x * getScaleFactor().mV[VX]); - screen_y = ll_round((F32)y * getScaleFactor().mV[VY]); + screen_x = ll_round(((F32)x * getScaleFactor().mV[VX]) / dev_scale_factor); + screen_y = ll_round(((F32)y * getScaleFactor().mV[VY]) / dev_scale_factor); LLView::getWindow()->setCursorPosition(LLCoordGL(screen_x, screen_y).convert()); } @@ -247,10 +248,11 @@ void LLUI::setMousePositionScreen(S32 x, S32 y) void LLUI::getMousePositionScreen(S32 *x, S32 *y) { LLCoordWindow cursor_pos_window; + F32 dev_scale_factor = LLView::getWindow()->getDeviceScaleFactor(); getWindow()->getCursorPosition(&cursor_pos_window); LLCoordGL cursor_pos_gl(cursor_pos_window.convert()); - *x = ll_round((F32)cursor_pos_gl.mX / getScaleFactor().mV[VX]); - *y = ll_round((F32)cursor_pos_gl.mY / getScaleFactor().mV[VX]); + *x = ll_round(((F32)cursor_pos_gl.mX / getScaleFactor().mV[VX]) * dev_scale_factor); + *y = ll_round(((F32)cursor_pos_gl.mY / getScaleFactor().mV[VX]) * dev_scale_factor); } //static diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 0a8076173e..392a843d6c 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -3024,8 +3024,7 @@ void LLViewerWindow::moveCursorToCenter() S32 x = getWorldViewWidthScaled() / 2; S32 y = getWorldViewHeightScaled() / 2; - F32 scale_factor = mWindow->getDeviceScaleFactor(); - LLUI::setMousePositionScreen(x/scale_factor, y/scale_factor); + LLUI::setMousePositionScreen(x, y); //on a forced move, all deltas get zeroed out to prevent jumping mCurrentMousePoint.set(x,y); -- cgit v1.2.3 From 060a0bc350f279c6023b061255653b575156b009 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Fri, 2 Nov 2018 22:36:56 +0100 Subject: SL-10005 Make set of copied bits (depth and/or stencil) match those present in the source and dest. May avoid driver crash on Intel HD graphics. --- indra/newview/pipeline.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index e541c1054e..e2c379102d 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -2654,9 +2654,12 @@ void LLPipeline::downsampleDepthBuffer(LLRenderTarget& source, LLRenderTarget& d if (scratch_space) { + GLint bits = 0; + bits |= (source.hasStencil() && dest.hasStencil()) ? GL_STENCIL_BUFFER_BIT : 0; + bits |= GL_DEPTH_BUFFER_BIT; scratch_space->copyContents(source, 0, 0, source.getWidth(), source.getHeight(), - 0, 0, scratch_space->getWidth(), scratch_space->getHeight(), GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT, GL_NEAREST); + 0, 0, scratch_space->getWidth(), scratch_space->getHeight(), bits, GL_NEAREST); } dest.bindTarget(); -- cgit v1.2.3 From 755b4a3a6dc6c158f7cfcd6ab8d88b38d3b79fb4 Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Thu, 8 Nov 2018 18:33:42 +0200 Subject: =?UTF-8?q?SL-10019=20-=20[Mac]=20[Render]=20Right-click=20context?= =?UTF-8?q?=20menu=20immediately=20disappears=20when=20clicking=20any=20pl?= =?UTF-8?q?ace=20in=20the=20=E2=80=98Inventory=E2=80=99=20floater?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- indra/llui/llmenugl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 0d42f726fa..752d4a27e6 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -3260,7 +3260,8 @@ void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y) menu->arrangeAndClear(); LLUI::getMousePositionLocal(menu->getParent(), &mouse_x, &mouse_y); - LLMenuHolderGL::sContextMenuSpawnPos.set(mouse_x,mouse_y); + F32 dev_scale_factor = LLView::getWindow()->getDeviceScaleFactor(); + LLMenuHolderGL::sContextMenuSpawnPos.set(mouse_x/dev_scale_factor, mouse_y/dev_scale_factor); const LLRect menu_region_rect = LLMenuGL::sMenuContainer->getRect(); -- cgit v1.2.3 From acc86a9139872e182fbeb5b9fc7daa12c5d2c029 Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Mon, 26 Nov 2018 18:02:44 +0200 Subject: =?UTF-8?q?SL-9766=20[Render]=20[Mac]=20Alt=20+=20left=20mouse=20c?= =?UTF-8?q?lick=20has=20severely=20impaired=20functions=20SL-10019=20-=20[?= =?UTF-8?q?Mac]=20[Render]=20Right-click=20context=20menu=20immediately=20?= =?UTF-8?q?disappears=20when=20clicking=20any=20place=20in=20the=20?= =?UTF-8?q?=E2=80=98Inventory=E2=80=99=20floater=20SL-9984=20-=20[Retina]?= =?UTF-8?q?=20Camera=20frustum,=20do=20not=20display=20correctly=20on=20"W?= =?UTF-8?q?ORLD=20MAP"=20window.=20SL-10027=20-=20[Mac]=20[Render]=20Add?= =?UTF-8?q?=20toggle=20for=20Retina=20support=20to=20mitigate=20FPS=20loss?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Re-FIX for Retina support. --- indra/llui/llmenugl.cpp | 3 +-- indra/llui/lltooltip.cpp | 10 +++------- indra/llui/llui.cpp | 16 +++++++++------- indra/llwindow/llopenglview-objc.mm | 16 +++++++++------- indra/llwindow/llwindowmacosx-objc.h | 3 ++- indra/llwindow/llwindowmacosx-objc.mm | 12 +++++++----- indra/llwindow/llwindowmacosx.cpp | 19 ++++++++++++------- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llappviewer.cpp | 8 ++++++++ indra/newview/llfloaterpreference.cpp | 3 +++ indra/newview/llviewerwindow.cpp | 2 +- indra/newview/llworldmapview.cpp | 5 +++++ .../xui/en/floater_preferences_graphics_advanced.xml | 12 ++++++++++++ 13 files changed, 83 insertions(+), 37 deletions(-) diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 752d4a27e6..0d42f726fa 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -3260,8 +3260,7 @@ void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y) menu->arrangeAndClear(); LLUI::getMousePositionLocal(menu->getParent(), &mouse_x, &mouse_y); - F32 dev_scale_factor = LLView::getWindow()->getDeviceScaleFactor(); - LLMenuHolderGL::sContextMenuSpawnPos.set(mouse_x/dev_scale_factor, mouse_y/dev_scale_factor); + LLMenuHolderGL::sContextMenuSpawnPos.set(mouse_x,mouse_y); const LLRect menu_region_rect = LLMenuGL::sMenuContainer->getRect(); diff --git a/indra/llui/lltooltip.cpp b/indra/llui/lltooltip.cpp index 7f2224870d..698b128d45 100644 --- a/indra/llui/lltooltip.cpp +++ b/indra/llui/lltooltip.cpp @@ -489,10 +489,6 @@ void LLToolTipMgr::show(const LLToolTip::Params& params) return; } - S32 mouse_x; - S32 mouse_y; - LLUI::getMousePositionLocal(gToolTipView, &mouse_x, &mouse_y); - // are we ready to show the tooltip? if (!mToolTipsBlocked // we haven't hit a key, moved the mouse, etc. && LLUI::getMouseIdleTime() > params_with_defaults.delay_time) // the mouse has been still long enough @@ -574,12 +570,12 @@ void LLToolTipMgr::updateToolTipVisibility() } // hide existing tooltips if they have timed out - S32 mouse_x, mouse_y; - LLUI::getMousePositionLocal(gToolTipView, &mouse_x, &mouse_y); - F32 tooltip_timeout = 0.f; if (toolTipVisible()) { + S32 mouse_x, mouse_y; + LLUI::getMousePositionLocal(gToolTipView, &mouse_x, &mouse_y); + // mouse far away from tooltip tooltip_timeout = mLastToolTipParams.visible_time_far; // mouse near rect will only include the tooltip if the diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 2e9188a6a8..e9f8ba020e 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -236,11 +236,14 @@ void LLUI::dirtyRect(LLRect rect) //static void LLUI::setMousePositionScreen(S32 x, S32 y) { - F32 dev_scale_factor = LLView::getWindow()->getDeviceScaleFactor(); S32 screen_x, screen_y; - screen_x = ll_round(((F32)x * getScaleFactor().mV[VX]) / dev_scale_factor); - screen_y = ll_round(((F32)y * getScaleFactor().mV[VY]) / dev_scale_factor); - +#if defined(LL_DARWIN) + screen_x = ll_round((F32)x); + screen_y = ll_round((F32)y); +#else + screen_x = ll_round((F32)x * getScaleFactor().mV[VX]); + screen_y = ll_round((F32)y * getScaleFactor().mV[VY]); +#endif LLView::getWindow()->setCursorPosition(LLCoordGL(screen_x, screen_y).convert()); } @@ -248,11 +251,10 @@ void LLUI::setMousePositionScreen(S32 x, S32 y) void LLUI::getMousePositionScreen(S32 *x, S32 *y) { LLCoordWindow cursor_pos_window; - F32 dev_scale_factor = LLView::getWindow()->getDeviceScaleFactor(); getWindow()->getCursorPosition(&cursor_pos_window); LLCoordGL cursor_pos_gl(cursor_pos_window.convert()); - *x = ll_round(((F32)cursor_pos_gl.mX / getScaleFactor().mV[VX]) * dev_scale_factor); - *y = ll_round(((F32)cursor_pos_gl.mY / getScaleFactor().mV[VX]) * dev_scale_factor); + *x = ll_round((F32)cursor_pos_gl.mX / getScaleFactor().mV[VX]); + *y = ll_round((F32)cursor_pos_gl.mY / getScaleFactor().mV[VY]); } //static diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index ee05fd5cc9..54a4793b2d 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -28,6 +28,8 @@ #import "llwindowmacosx-objc.h" #import "llappdelegate-objc.h" +extern BOOL gHiDPISupport; + #pragma mark local functions NativeKeyEventData extractKeyDataFromKeyEvent(NSEvent* theEvent) @@ -189,7 +191,7 @@ attributedStringInfo getSegments(NSAttributedString *str) { if (!mOldResize) //Maint-3288 { - NSSize dev_sz = [self convertSizeToBacking:[self frame].size]; + NSSize dev_sz = gHiDPISupport ? [self convertSizeToBacking:[self frame].size] : [self frame].size; callResize(dev_sz.width, dev_sz.height); } } @@ -276,7 +278,7 @@ attributedStringInfo getSegments(NSAttributedString *str) [self setPixelFormat:pixelFormat]; //for retina support - [self setWantsBestResolutionOpenGLSurface:YES]; + [self setWantsBestResolutionOpenGLSurface:gHiDPISupport]; [self setOpenGLContext:glContext]; @@ -369,7 +371,7 @@ attributedStringInfo getSegments(NSAttributedString *str) callRightMouseUp(mMousePos, [theEvent modifierFlags]); mSimulatedRightClick = false; } else { - NSPoint mPoint = [self convertPointToBacking:[theEvent locationInWindow]]; + NSPoint mPoint = gHiDPISupport ? [self convertPointToBacking:[theEvent locationInWindow]] : [theEvent locationInWindow]; mMousePos[0] = mPoint.x; mMousePos[1] = mPoint.y; callLeftMouseUp(mMousePos, [theEvent modifierFlags]); @@ -388,7 +390,7 @@ attributedStringInfo getSegments(NSAttributedString *str) - (void)mouseMoved:(NSEvent *)theEvent { - NSPoint dev_delta = [self convertPointToBacking:NSMakePoint([theEvent deltaX], [theEvent deltaY])]; + NSPoint dev_delta = gHiDPISupport ? [self convertPointToBacking:NSMakePoint([theEvent deltaX], [theEvent deltaY])] : NSMakePoint([theEvent deltaX], [theEvent deltaY]); float mouseDeltas[] = { float(dev_delta.x), @@ -397,7 +399,7 @@ attributedStringInfo getSegments(NSAttributedString *str) callDeltaUpdate(mouseDeltas, 0); - NSPoint mPoint = [self convertPointToBacking:[theEvent locationInWindow]]; + NSPoint mPoint = gHiDPISupport ? [self convertPointToBacking:[theEvent locationInWindow]] : [theEvent locationInWindow]; mMousePos[0] = mPoint.x; mMousePos[1] = mPoint.y; callMouseMoved(mMousePos, 0); @@ -412,7 +414,7 @@ attributedStringInfo getSegments(NSAttributedString *str) // The old CoreGraphics APIs we previously relied on are now flagged as obsolete. // NSEvent isn't obsolete, and provides us with the correct deltas. - NSPoint dev_delta = [self convertPointToBacking:NSMakePoint([theEvent deltaX], [theEvent deltaY])]; + NSPoint dev_delta = gHiDPISupport ? [self convertPointToBacking:NSMakePoint([theEvent deltaX], [theEvent deltaY])] : NSMakePoint([theEvent deltaX], [theEvent deltaY]); float mouseDeltas[] = { float(dev_delta.x), @@ -421,7 +423,7 @@ attributedStringInfo getSegments(NSAttributedString *str) callDeltaUpdate(mouseDeltas, 0); - NSPoint mPoint = [self convertPointToBacking:[theEvent locationInWindow]]; + NSPoint mPoint = gHiDPISupport ? [self convertPointToBacking:[theEvent locationInWindow]] : [theEvent locationInWindow]; mMousePos[0] = mPoint.x; mMousePos[1] = mPoint.y; callMouseDragged(mMousePos, 0); diff --git a/indra/llwindow/llwindowmacosx-objc.h b/indra/llwindow/llwindowmacosx-objc.h index 743089be6b..34da99de19 100644 --- a/indra/llwindow/llwindowmacosx-objc.h +++ b/indra/llwindow/llwindowmacosx-objc.h @@ -110,7 +110,8 @@ void glSwapBuffers(void* context); CGLContextObj getCGLContextObj(GLViewRef view); unsigned long getVramSize(GLViewRef view); float getDeviceUnitSize(GLViewRef view); -void getContentViewBounds(NSWindowRef window, float* bounds); +const CGPoint & getContentViewBoundsPosition(NSWindowRef window); +const CGSize & getContentViewBoundsSize(NSWindowRef window); const CGSize & getDeviceContentViewSize(NSWindowRef window, GLViewRef view); void getWindowSize(NSWindowRef window, float* size); void setWindowSize(NSWindowRef window, int width, int height); diff --git a/indra/llwindow/llwindowmacosx-objc.mm b/indra/llwindow/llwindowmacosx-objc.mm index 489f92fa14..156d7965cd 100644 --- a/indra/llwindow/llwindowmacosx-objc.mm +++ b/indra/llwindow/llwindowmacosx-objc.mm @@ -258,12 +258,14 @@ float getDeviceUnitSize(GLViewRef view) return [(LLOpenGLView*)view convertSizeToBacking:NSMakeSize(1, 1)].width; } -void getContentViewBounds(NSWindowRef window, float* bounds) +const CGPoint & getContentViewBoundsPosition(NSWindowRef window) { - bounds[0] = [[(LLNSWindow*)window contentView] bounds].origin.x; - bounds[1] = [[(LLNSWindow*)window contentView] bounds].origin.y; - bounds[2] = [[(LLNSWindow*)window contentView] bounds].size.width; - bounds[3] = [[(LLNSWindow*)window contentView] bounds].size.height; + return [[(LLNSWindow*)window contentView] bounds].origin; +} + +const CGSize & getContentViewBoundsSize(NSWindowRef window) +{ + return [[(LLNSWindow*)window contentView] bounds].size; } const CGSize & getDeviceContentViewSize(NSWindowRef window, GLViewRef view) diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 376b8610b5..20853eebd9 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -43,6 +43,7 @@ #include extern BOOL gDebugWindowProc; +BOOL gHiDPISupport = TRUE; const S32 BITS_PER_PIXEL = 32; const S32 MAX_NUM_RESOLUTIONS = 32; @@ -827,7 +828,6 @@ void LLWindowMacOSX::gatherInput() BOOL LLWindowMacOSX::getPosition(LLCoordScreen *position) { - float rect[4]; S32 err = -1; if(mFullscreen) @@ -838,10 +838,12 @@ BOOL LLWindowMacOSX::getPosition(LLCoordScreen *position) } else if(mWindow) { - getContentViewBounds(mWindow, rect); + const CGPoint & pos = getContentViewBoundsPosition(mWindow); - position->mX = rect[0]; - position->mY = rect[1]; + position->mX = pos.x; + position->mY = pos.y; + + err = noErr; } else { @@ -863,7 +865,7 @@ BOOL LLWindowMacOSX::getSize(LLCoordScreen *size) } else if(mWindow) { - const CGSize & sz = getDeviceContentViewSize(mWindow, mGLView); + const CGSize & sz = gHiDPISupport ? getDeviceContentViewSize(mWindow, mGLView) : getContentViewBoundsSize(mWindow); size->mX = sz.width; size->mY = sz.height; @@ -888,7 +890,7 @@ BOOL LLWindowMacOSX::getSize(LLCoordWindow *size) } else if(mWindow) { - const CGSize & sz = getDeviceContentViewSize(mWindow, mGLView); + const CGSize & sz = gHiDPISupport ? getDeviceContentViewSize(mWindow, mGLView) : getContentViewBoundsSize(mWindow); size->mX = sz.width; size->mY = sz.height; @@ -1100,6 +1102,9 @@ BOOL LLWindowMacOSX::setCursorPosition(const LLCoordWindow position) // trigger mouse move callback LLCoordGL gl_pos; convertCoords(position, &gl_pos); + float scale = getDeviceScaleFactor(); + gl_pos.mX *= scale; + gl_pos.mY *= scale; mCallbacks->handleMouseMove(this, gl_pos, (MASK)0); return result; @@ -1901,7 +1906,7 @@ MASK LLWindowMacOSX::modifiersToMask(S16 modifiers) F32 LLWindowMacOSX::getDeviceScaleFactor() { - return ::getDeviceUnitSize(mGLView); + return gHiDPISupport ? ::getDeviceUnitSize(mGLView) : LLWindow::getDeviceScaleFactor(); } #if LL_OS_DRAGDROP_ENABLED diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 8e8cce5787..657baf016b 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -8627,6 +8627,17 @@ Boolean Value 0 + + RenderHiDPI + + Comment + Enable support for HiDPI displays, like Retina (MacOS X ONLY, requires restart) + Persist + 1 + Type + Boolean + Value + 1 RenderPerformanceTest diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 23789cbce5..0d3d39dfea 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -276,6 +276,10 @@ extern BOOL gRandomizeFramerate; extern BOOL gPeriodicSlowFrame; extern BOOL gDebugGL; +#if LL_DARWIN +extern BOOL gHiDPISupport; +#endif + //////////////////////////////////////////////////////////// // All from the last globals push... @@ -589,6 +593,10 @@ static void settings_to_globals() gDebugWindowProc = gSavedSettings.getBOOL("DebugWindowProc"); gShowObjectUpdates = gSavedSettings.getBOOL("ShowObjectUpdates"); LLWorldMapView::sMapScale = gSavedSettings.getF32("MapScale"); + +#if LL_DARWIN + gHiDPISupport = gSavedSettings.getBOOL("RenderHiDPI"); +#endif } static void settings_modify() diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 7aff9fb586..7f700b76cc 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -2754,6 +2754,9 @@ BOOL LLFloaterPreferenceGraphicsAdvanced::postBuild() combo->remove("8x"); combo->remove("16x"); } + + LLCheckBoxCtrl *use_HiDPI = getChild("use HiDPI"); + use_HiDPI->setVisible(FALSE); #endif return TRUE; diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 392a843d6c..b6e4730d2e 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -3029,7 +3029,7 @@ void LLViewerWindow::moveCursorToCenter() //on a forced move, all deltas get zeroed out to prevent jumping mCurrentMousePoint.set(x,y); mLastMousePoint.set(x,y); - mCurrentMouseDelta.set(0,0); + mCurrentMouseDelta.set(0,0); } } diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index ca57f4fb97..f2e139dcca 100644 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -884,8 +884,13 @@ void LLWorldMapView::drawFrustum() // Compute the frustum coordinates. Take the UI scale into account. F32 ui_scale_factor = gSavedSettings.getF32("UIScaleFactor"); +#if defined(LL_DARWIN) F32 ctr_x = ((getLocalRect().getWidth() * 0.5f + sPanX) * ui_scale_factor) * LLUI::getScaleFactor().mV[VX]; F32 ctr_y = ((getLocalRect().getHeight() * 0.5f + sPanY) * ui_scale_factor) * LLUI::getScaleFactor().mV[VY]; +#else + F32 ctr_x = ((getLocalRect().getWidth() * 0.5f + sPanX) * ui_scale_factor); + F32 ctr_y = ((getLocalRect().getHeight() * 0.5f + sPanY) * ui_scale_factor); +#endif gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); diff --git a/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml b/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml index c2500951a6..bec484a5ea 100644 --- a/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml +++ b/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml @@ -357,6 +357,18 @@ tool_tip="Compresses textures in video memory, allowing for higher resolution textures to be loaded at the cost of some color quality." width="315" /> + + Date: Tue, 11 Dec 2018 18:11:58 +0200 Subject: SL-10176 - [Love Me Render] MacOS Quit / Shutdown crash --- indra/llwindow/llwindowmacosx-objc.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llwindow/llwindowmacosx-objc.mm b/indra/llwindow/llwindowmacosx-objc.mm index 156d7965cd..c3eb9b8c8a 100644 --- a/indra/llwindow/llwindowmacosx-objc.mm +++ b/indra/llwindow/llwindowmacosx-objc.mm @@ -380,8 +380,8 @@ void closeWindow(NSWindowRef window) void removeGLView(GLViewRef view) { + [(LLOpenGLView*)view clearGLContext]; [(LLOpenGLView*)view removeFromSuperview]; - [(LLOpenGLView*)view release]; } void setupInputWindow(NSWindowRef window, GLViewRef glview) -- cgit v1.2.3 From 2e55e529d48a4dd3f73584728f0b59f6d71585a6 Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Tue, 8 Jan 2019 18:26:34 +0200 Subject: SL-10194 Selecting mesh face doesn't highlight the face in any way - Implemented --- indra/newview/llface.cpp | 125 +++++++++++++++++++++++ indra/newview/llface.h | 1 + indra/newview/llselectmgr.cpp | 225 ++++++++++-------------------------------- indra/newview/llselectmgr.h | 1 - 4 files changed, 179 insertions(+), 173 deletions(-) diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 4f18cda92f..32280d3d90 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -36,6 +36,8 @@ #include "llmatrix4a.h" #include "v3color.h" +#include "lldefs.h" + #include "lldrawpoolavatar.h" #include "lldrawpoolbump.h" #include "llgl.h" @@ -601,6 +603,129 @@ void LLFace::renderSelected(LLViewerTexture *imagep, const LLColor4& color) } +void renderFace(LLDrawable* drawable, LLFace *face) +{ + LLVOVolume* vobj = drawable->getVOVolume(); + if (vobj) + { + LLVertexBuffer::unbind(); + gGL.pushMatrix(); + gGL.multMatrix((F32*)vobj->getRelativeXform().mMatrix); + + LLVolume* volume = NULL; + + if (drawable->isState(LLDrawable::RIGGED)) + { + vobj->updateRiggedVolume(); + volume = vobj->getRiggedVolume(); + } + else + { + volume = vobj->getVolume(); + } + + if (volume) + { + const LLVolumeFace& vol_face = volume->getVolumeFace(face->getTEOffset()); + LLVertexBuffer::drawElements(LLRender::TRIANGLES, vol_face.mPositions, NULL, vol_face.mNumIndices, vol_face.mIndices); + } + + gGL.popMatrix(); + } +} + +void LLFace::renderOneWireframe(const LLColor4 &color, F32 fogCfx, bool bSelected, bool wireframe_selection, bool bRenderHiddenSelections) +{ + //Need to because crash on ATI 3800 (and similar cards) MAINT-5018 + LLGLDisable multisample(LLPipeline::RenderFSAASamples > 0 ? GL_MULTISAMPLE_ARB : 0); + + LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr; + + if (shader) + { + gDebugProgram.bind(); + } + + gGL.matrixMode(LLRender::MM_MODELVIEW); + gGL.pushMatrix(); + + BOOL is_hud_object = mVObjp->isHUDAttachment(); + + if (mDrawablep->isActive()) + { + gGL.loadMatrix(gGLModelView); + gGL.multMatrix((F32*)mVObjp->getRenderMatrix().mMatrix); + } + else if (!is_hud_object) + { + gGL.loadIdentity(); + gGL.multMatrix(gGLModelView); + LLVector3 trans = mVObjp->getRegion()->getOriginAgent(); + gGL.translatef(trans.mV[0], trans.mV[1], trans.mV[2]); + } + + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + + + if (bRenderHiddenSelections) + { + gGL.blendFunc(LLRender::BF_SOURCE_COLOR, LLRender::BF_ONE); + LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE, GL_GEQUAL); + if (shader) + { + gGL.diffuseColor4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], 0.4f); + renderFace(mDrawablep, this); + } + else + { + LLGLEnable fog(GL_FOG); + glFogi(GL_FOG_MODE, GL_LINEAR); + float d = (LLViewerCamera::getInstance()->getPointOfInterest() - LLViewerCamera::getInstance()->getOrigin()).magVec(); + LLColor4 fogCol = color * fogCfx; + glFogf(GL_FOG_START, d); + glFogf(GL_FOG_END, d*(1 + (LLViewerCamera::getInstance()->getView() / LLViewerCamera::getInstance()->getDefaultFOV()))); + glFogfv(GL_FOG_COLOR, fogCol.mV); + + gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); + { + gGL.diffuseColor4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], 0.4f); + renderFace(mDrawablep, this); + } + } + } + + gGL.flush(); + gGL.setSceneBlendType(LLRender::BT_ALPHA); + + gGL.diffuseColor4f(color.mV[VRED] * 2, color.mV[VGREEN] * 2, color.mV[VBLUE] * 2, color.mV[VALPHA]); + + { + LLGLDisable depth(wireframe_selection ? 0 : GL_BLEND); + LLGLEnable stencil(wireframe_selection ? 0 : GL_STENCIL_TEST); + + if (!wireframe_selection) + { //modify wireframe into outline selection mode + glStencilFunc(GL_NOTEQUAL, 2, 0xffff); + glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP); + } + + LLGLEnable offset(GL_POLYGON_OFFSET_LINE); + glPolygonOffset(3.f, 3.f); + glLineWidth(5.f); + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + renderFace(mDrawablep, this); + } + + glLineWidth(1.f); + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + gGL.popMatrix(); + + if (shader) + { + shader->bind(); + } +} + /* removed in lieu of raycast uv detection void LLFace::renderSelectedUV() { diff --git a/indra/newview/llface.h b/indra/newview/llface.h index ee545acb94..7e68e81862 100644 --- a/indra/newview/llface.h +++ b/indra/newview/llface.h @@ -198,6 +198,7 @@ public: void renderSelectedUV(); void renderSelected(LLViewerTexture *image, const LLColor4 &color); + void renderOneWireframe(const LLColor4 &color, F32 fogCfx, bool bSelected, bool wireframe_selection, bool bRenderHiddenSelections); F32 getKey() const { return mDistance; } diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 20445ba56f..9c6be001f6 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -5837,6 +5837,7 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud) gGL.translatef(-hud_bbox.getCenterLocal().mV[VX] + (depth *0.5f), 0.f, 0.f); gGL.scalef(cur_zoom, cur_zoom, cur_zoom); } + if (mSelectedObjects->getNumNodes()) { LLUUID inspect_item_id= LLUUID::null; @@ -5854,6 +5855,9 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud) } } + bool wireframe_selection = (gFloaterTools && gFloaterTools->getVisible()) || LLSelectMgr::sRenderHiddenSelections; + F32 fogCfx = (F32)llclamp((LLSelectMgr::getInstance()->getSelectionCenterGlobal() - gAgentCamera.getCameraPositionGlobal()).magVec() / (LLSelectMgr::getInstance()->getBBoxOfSelection().getExtentLocal().magVec() * 4), 0.0, 1.0); + LLUUID focus_item_id = LLViewerMediaFocus::getInstance()->getFocusedObjectID(); for (S32 pass = 0; pass < 2; pass++) { @@ -5864,35 +5868,53 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud) LLViewerObject* objectp = node->getObject(); if (!objectp) continue; - if (objectp->isHUDAttachment() != for_hud) - { - continue; - } - if (objectp->getID() == focus_item_id) - { - node->renderOneSilhouette(gFocusMgr.getFocusColor()); - } - else if(objectp->getID() == inspect_item_id) - { - node->renderOneSilhouette(sHighlightInspectColor); - } - else if (node->isTransient()) - { - BOOL oldHidden = LLSelectMgr::sRenderHiddenSelections; - LLSelectMgr::sRenderHiddenSelections = FALSE; - node->renderOneSilhouette(sContextSilhouetteColor); - LLSelectMgr::sRenderHiddenSelections = oldHidden; - } - else if (objectp->isRootEdit()) - { - node->renderOneSilhouette(sSilhouetteParentColor); - } - else - { - node->renderOneSilhouette(sSilhouetteChildColor); - } - } - } + + if (objectp->mDrawable + && objectp->mDrawable->getVOVolume() + && objectp->mDrawable->getVOVolume()->isMesh()) + { + S32 num_tes = llmin((S32)objectp->getNumTEs(), (S32)objectp->getNumFaces()); // avatars have TEs but no faces + for (S32 te = 0; te < num_tes; ++te) + { + bool bSelected = node->isTESelected(te) && getTEMode(); + + objectp->mDrawable->getFace(te)->renderOneWireframe( + !bSelected ? LLColor4(sSilhouetteParentColor[VRED], sSilhouetteParentColor[VGREEN], sSilhouetteParentColor[VBLUE], LLSelectMgr::sHighlightAlpha * 2) : sHighlightInspectColor + , fogCfx, bSelected, wireframe_selection, node->isTransient() ? FALSE : LLSelectMgr::sRenderHiddenSelections); + } + } + else + { + if (objectp->isHUDAttachment() != for_hud) + { + continue; + } + if (objectp->getID() == focus_item_id) + { + node->renderOneSilhouette(gFocusMgr.getFocusColor()); + } + else if (objectp->getID() == inspect_item_id) + { + node->renderOneSilhouette(sHighlightInspectColor); + } + else if (node->isTransient()) + { + BOOL oldHidden = LLSelectMgr::sRenderHiddenSelections; + LLSelectMgr::sRenderHiddenSelections = FALSE; + node->renderOneSilhouette(sContextSilhouetteColor); + LLSelectMgr::sRenderHiddenSelections = oldHidden; + } + else if (objectp->isRootEdit()) + { + node->renderOneSilhouette(sSilhouetteParentColor); + } + else + { + node->renderOneSilhouette(sSilhouetteChildColor); + } + } + } //for all selected node's + } //for pass } if (mHighlightedObjects->getNumNodes()) @@ -6278,148 +6300,6 @@ BOOL LLSelectNode::allowOperationOnNode(PermissionBit op, U64 group_proxy_power) return (mPermissions->allowOperationBy(op, proxy_agent_id, group_id)); } - -//helper function for pushing relevant vertices from drawable to GL -void pushWireframe(LLDrawable* drawable) -{ - LLVOVolume* vobj = drawable->getVOVolume(); - if (vobj) - { - LLVertexBuffer::unbind(); - gGL.pushMatrix(); - gGL.multMatrix((F32*) vobj->getRelativeXform().mMatrix); - - LLVolume* volume = NULL; - - if (drawable->isState(LLDrawable::RIGGED)) - { - vobj->updateRiggedVolume(); - volume = vobj->getRiggedVolume(); - } - else - { - volume = vobj->getVolume(); - } - - if (volume) - { - for (S32 i = 0; i < volume->getNumVolumeFaces(); ++i) - { - const LLVolumeFace& face = volume->getVolumeFace(i); - LLVertexBuffer::drawElements(LLRender::TRIANGLES, face.mPositions, NULL, face.mNumIndices, face.mIndices); - } - } - - gGL.popMatrix(); - } - -} - -void LLSelectNode::renderOneWireframe(const LLColor4& color) -{ - //Need to because crash on ATI 3800 (and similar cards) MAINT-5018 - LLGLDisable multisample(LLPipeline::RenderFSAASamples > 0 ? GL_MULTISAMPLE_ARB : 0); - - LLViewerObject* objectp = getObject(); - if (!objectp) - { - return; - } - - LLDrawable* drawable = objectp->mDrawable; - if (!drawable) - { - return; - } - - LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr; - - if (shader) - { - gDebugProgram.bind(); - } - - gGL.matrixMode(LLRender::MM_MODELVIEW); - gGL.pushMatrix(); - - BOOL is_hud_object = objectp->isHUDAttachment(); - - if (drawable->isActive()) - { - gGL.loadMatrix(gGLModelView); - gGL.multMatrix((F32*)objectp->getRenderMatrix().mMatrix); - } - else if (!is_hud_object) - { - gGL.loadIdentity(); - gGL.multMatrix(gGLModelView); - LLVector3 trans = objectp->getRegion()->getOriginAgent(); - gGL.translatef(trans.mV[0], trans.mV[1], trans.mV[2]); - } - - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - - bool wireframe_selection = (gFloaterTools && gFloaterTools->getVisible()) || LLSelectMgr::sRenderHiddenSelections; - - if (LLSelectMgr::sRenderHiddenSelections) - { - gGL.blendFunc(LLRender::BF_SOURCE_COLOR, LLRender::BF_ONE); - LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE, GL_GEQUAL); - if (shader) - { - gGL.diffuseColor4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], 0.4f); - pushWireframe(drawable); - } - else - { - LLGLEnable fog(GL_FOG); - glFogi(GL_FOG_MODE, GL_LINEAR); - float d = (LLViewerCamera::getInstance()->getPointOfInterest() - LLViewerCamera::getInstance()->getOrigin()).magVec(); - LLColor4 fogCol = color * (F32)llclamp((LLSelectMgr::getInstance()->getSelectionCenterGlobal() - gAgentCamera.getCameraPositionGlobal()).magVec() / (LLSelectMgr::getInstance()->getBBoxOfSelection().getExtentLocal().magVec() * 4), 0.0, 1.0); - glFogf(GL_FOG_START, d); - glFogf(GL_FOG_END, d*(1 + (LLViewerCamera::getInstance()->getView() / LLViewerCamera::getInstance()->getDefaultFOV()))); - glFogfv(GL_FOG_COLOR, fogCol.mV); - - gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); - { - gGL.diffuseColor4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], 0.4f); - pushWireframe(drawable); - } - } - } - - gGL.flush(); - gGL.setSceneBlendType(LLRender::BT_ALPHA); - - gGL.diffuseColor4f(color.mV[VRED] * 2, color.mV[VGREEN] * 2, color.mV[VBLUE] * 2, LLSelectMgr::sHighlightAlpha * 2); - - { - LLGLDisable depth(wireframe_selection ? 0 : GL_BLEND); - LLGLEnable stencil(wireframe_selection ? 0 : GL_STENCIL_TEST); - - if (!wireframe_selection) - { //modify wireframe into outline selection mode - glStencilFunc(GL_NOTEQUAL, 2, 0xffff); - glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP); - } - - LLGLEnable offset(GL_POLYGON_OFFSET_LINE); - glPolygonOffset(3.f, 3.f); - glLineWidth(5.f); - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - pushWireframe(drawable); - } - - glLineWidth(1.f); - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - gGL.popMatrix(); - - if (shader) - { - shader->bind(); - } -} - //----------------------------------------------------------------------------- // renderOneSilhouette() //----------------------------------------------------------------------------- @@ -6440,7 +6320,8 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color) LLVOVolume* vobj = drawable->getVOVolume(); if (vobj && vobj->isMesh()) { - renderOneWireframe(color); + //This check (if(...)) with assert here just for ensure that this situation will not happens, and can be removed later. For example on the next release. + llassert(!"renderOneWireframe() was removed SL-10194"); return; } diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index f362497b03..303a984bd0 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -177,7 +177,6 @@ public: S32 getLastSelectedTE(); S32 getLastOperatedTE(); S32 getTESelectMask() { return mTESelectMask; } - void renderOneWireframe(const LLColor4& color); void renderOneSilhouette(const LLColor4 &color); void setTransient(BOOL transient) { mTransient = transient; } BOOL isTransient() { return mTransient; } -- cgit v1.2.3 From 4f458882f4f29d441e1ba0ede1ab50aa389b2aaa Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Mon, 14 Jan 2019 18:58:30 +0200 Subject: - add static const --- indra/llrender/llgl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 79a50d199a..c0f0cec80b 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -1890,7 +1890,7 @@ void LLGLState::checkClientArrays(const std::string& msg, U32 data_mask) GL_TEXTURE_COORD_ARRAY }; - U32 mask[] = + static const U32 mask[] = { //copied from llvertexbuffer.h 0x0001, //MAP_VERTEX, 0x0002, //MAP_NORMAL, -- cgit v1.2.3 From f6bccd6f9eb62178f9f3d912114d12a84a9e42d6 Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Mon, 14 Jan 2019 19:07:00 +0200 Subject: - remove getDeviceScaleFactor() and replace it to getSystemUISize() according Ansariel note --- indra/llwindow/llwindow.h | 3 --- indra/llwindow/llwindowmacosx.cpp | 8 ++++---- indra/llwindow/llwindowmacosx.h | 2 +- indra/newview/llviewerwindow.cpp | 10 +++++++--- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h index cb0daea2cd..a05ba8cbba 100644 --- a/indra/llwindow/llwindow.h +++ b/indra/llwindow/llwindow.h @@ -166,9 +166,6 @@ public: // Provide native key event data virtual LLSD getNativeKeyData() { return LLSD::emptyMap(); } - // Default scale - virtual float getDeviceScaleFactor() { return 1.0f; } - // Get system UI size based on DPI (for 96 DPI UI size should be 1.0) virtual F32 getSystemUISize() { return 1.0; } protected: diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 20853eebd9..b320b93d43 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -1102,7 +1102,7 @@ BOOL LLWindowMacOSX::setCursorPosition(const LLCoordWindow position) // trigger mouse move callback LLCoordGL gl_pos; convertCoords(position, &gl_pos); - float scale = getDeviceScaleFactor(); + float scale = getSystemUISize(); gl_pos.mX *= scale; gl_pos.mY *= scale; mCallbacks->handleMouseMove(this, gl_pos, (MASK)0); @@ -1135,7 +1135,7 @@ BOOL LLWindowMacOSX::getCursorPosition(LLCoordWindow *position) cursor_point[1] += mCursorLastEventDeltaY; } - float scale = getDeviceScaleFactor(); + float scale = getSystemUISize(); position->mX = cursor_point[0] * scale; position->mY = cursor_point[1] * scale; @@ -1904,9 +1904,9 @@ MASK LLWindowMacOSX::modifiersToMask(S16 modifiers) return mask; } -F32 LLWindowMacOSX::getDeviceScaleFactor() +F32 LLWindowMacOSX::getSystemUISize() { - return gHiDPISupport ? ::getDeviceUnitSize(mGLView) : LLWindow::getDeviceScaleFactor(); + return gHiDPISupport ? ::getDeviceUnitSize(mGLView) : LLWindow::getSystemUISize(); } #if LL_OS_DRAGDROP_ENABLED diff --git a/indra/llwindow/llwindowmacosx.h b/indra/llwindow/llwindowmacosx.h index fc5c9a0054..24651027e8 100644 --- a/indra/llwindow/llwindowmacosx.h +++ b/indra/llwindow/llwindowmacosx.h @@ -112,7 +112,7 @@ public: /*virtual*/ void allowLanguageTextInput(LLPreeditor *preeditor, BOOL b); /*virtual*/ void interruptLanguageTextInput(); /*virtual*/ void spawnWebBrowser(const std::string& escaped_url, bool async); - /*virtual*/ F32 getDeviceScaleFactor(); + /*virtual*/ F32 getSystemUISize(); static std::vector getDynamicFallbackFontList(); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 413fa59879..0d3a52346a 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1770,13 +1770,17 @@ LLViewerWindow::LLViewerWindow(const Params& p) gSavedSettings.setS32("FullScreenHeight",scr.mY); } - +#if LL_DARWIN + F32 system_scale_factor = 1.f; +#else F32 system_scale_factor = mWindow->getSystemUISize(); if (system_scale_factor < MIN_UI_SCALE || system_scale_factor > MAX_UI_SCALE) { // reset to default; system_scale_factor = 1.f; } +#endif + if (p.first_run || gSavedSettings.getF32("LastSystemUIScaleFactor") != system_scale_factor) { mSystemUIScaleFactorChanged = !p.first_run; @@ -1787,7 +1791,7 @@ LLViewerWindow::LLViewerWindow(const Params& p) // Get the real window rect the window was created with (since there are various OS-dependent reasons why // the size of a window or fullscreen context may have been adjusted slightly...) - F32 ui_scale_factor = llclamp(gSavedSettings.getF32("UIScaleFactor"), MIN_UI_SCALE, MAX_UI_SCALE) * mWindow->getDeviceScaleFactor(); + F32 ui_scale_factor = llclamp(gSavedSettings.getF32("UIScaleFactor"), MIN_UI_SCALE, MAX_UI_SCALE) * mWindow->getSystemUISize(); mDisplayScale.setVec(llmax(1.f / mWindow->getPixelAspectRatio(), 1.f), llmax(mWindow->getPixelAspectRatio(), 1.f)); mDisplayScale *= ui_scale_factor; @@ -5382,7 +5386,7 @@ F32 LLViewerWindow::getWorldViewAspectRatio() const void LLViewerWindow::calcDisplayScale() { - F32 ui_scale_factor = llclamp(gSavedSettings.getF32("UIScaleFactor"), MIN_UI_SCALE, MAX_UI_SCALE) * mWindow->getDeviceScaleFactor(); + F32 ui_scale_factor = llclamp(gSavedSettings.getF32("UIScaleFactor"), MIN_UI_SCALE, MAX_UI_SCALE) * mWindow->getSystemUISize(); LLVector2 display_scale; display_scale.setVec(llmax(1.f / mWindow->getPixelAspectRatio(), 1.f), llmax(mWindow->getPixelAspectRatio(), 1.f)); display_scale *= ui_scale_factor; -- cgit v1.2.3 From 9d1ea470bedc69d57c443c4efa966acdf6f4dbcd Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Tue, 15 Jan 2019 19:44:12 +0200 Subject: - fix scale problem on Windows --- indra/newview/llviewerwindow.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 0d3a52346a..d0c8145e58 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1604,7 +1604,6 @@ BOOL LLViewerWindow::handleDPIChanged(LLWindow *window, F32 ui_scale_factor, S32 if (ui_scale_factor >= MIN_UI_SCALE && ui_scale_factor <= MAX_UI_SCALE) { gSavedSettings.setF32("LastSystemUIScaleFactor", ui_scale_factor); - gSavedSettings.setF32("UIScaleFactor", ui_scale_factor); LLViewerWindow::reshape(window_width, window_height); mResDirty = true; return TRUE; -- cgit v1.2.3 From 4c0f6f5825bdd833d0bad05bf431c29acba45ae0 Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Fri, 25 Jan 2019 18:26:42 +0200 Subject: SL-10194 Selecting mesh face doesn't highlight the face in any way - Fixed according to Steeltoe notes. - Add const modifier for some methods --- indra/newview/llface.cpp | 2 +- indra/newview/llface.h | 2 +- indra/newview/llselectmgr.cpp | 29 +++++++++++++++++------------ indra/newview/llselectmgr.h | 15 ++++++++------- 4 files changed, 27 insertions(+), 21 deletions(-) diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 32280d3d90..b2da5bb9f8 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -634,7 +634,7 @@ void renderFace(LLDrawable* drawable, LLFace *face) } } -void LLFace::renderOneWireframe(const LLColor4 &color, F32 fogCfx, bool bSelected, bool wireframe_selection, bool bRenderHiddenSelections) +void LLFace::renderOneWireframe(const LLColor4 &color, F32 fogCfx, bool wireframe_selection, bool bRenderHiddenSelections) { //Need to because crash on ATI 3800 (and similar cards) MAINT-5018 LLGLDisable multisample(LLPipeline::RenderFSAASamples > 0 ? GL_MULTISAMPLE_ARB : 0); diff --git a/indra/newview/llface.h b/indra/newview/llface.h index 7e68e81862..736d45b7ad 100644 --- a/indra/newview/llface.h +++ b/indra/newview/llface.h @@ -198,7 +198,7 @@ public: void renderSelectedUV(); void renderSelected(LLViewerTexture *image, const LLColor4 &color); - void renderOneWireframe(const LLColor4 &color, F32 fogCfx, bool bSelected, bool wireframe_selection, bool bRenderHiddenSelections); + void renderOneWireframe(const LLColor4 &color, F32 fogCfx, bool wireframe_selection, bool bRenderHiddenSelections); F32 getKey() const { return mDistance; } diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 9c6be001f6..b36df244f8 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -5869,6 +5869,9 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud) if (!objectp) continue; + if(getTEMode() && !node->hasSelectedTE()) + continue; + if (objectp->mDrawable && objectp->mDrawable->getVOVolume() && objectp->mDrawable->getVOVolume()->isMesh()) @@ -5876,11 +5879,18 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud) S32 num_tes = llmin((S32)objectp->getNumTEs(), (S32)objectp->getNumFaces()); // avatars have TEs but no faces for (S32 te = 0; te < num_tes; ++te) { - bool bSelected = node->isTESelected(te) && getTEMode(); - - objectp->mDrawable->getFace(te)->renderOneWireframe( - !bSelected ? LLColor4(sSilhouetteParentColor[VRED], sSilhouetteParentColor[VGREEN], sSilhouetteParentColor[VBLUE], LLSelectMgr::sHighlightAlpha * 2) : sHighlightInspectColor - , fogCfx, bSelected, wireframe_selection, node->isTransient() ? FALSE : LLSelectMgr::sRenderHiddenSelections); + if (!getTEMode()) + { + objectp->mDrawable->getFace(te)->renderOneWireframe( + LLColor4(sSilhouetteParentColor[VRED], sSilhouetteParentColor[VGREEN], sSilhouetteParentColor[VBLUE], LLSelectMgr::sHighlightAlpha * 2) + , fogCfx, wireframe_selection, node->isTransient() ? FALSE : LLSelectMgr::sRenderHiddenSelections); + } + else if(node->isTESelected(te)) + { + objectp->mDrawable->getFace(te)->renderOneWireframe( + LLColor4(sSilhouetteParentColor[VRED], sSilhouetteParentColor[VGREEN], sSilhouetteParentColor[VBLUE], LLSelectMgr::sHighlightAlpha * 2) + , fogCfx, wireframe_selection, node->isTransient() ? FALSE : LLSelectMgr::sRenderHiddenSelections); + } } } else @@ -6078,7 +6088,7 @@ void LLSelectNode::selectTE(S32 te_index, BOOL selected) mLastTESelected = te_index; } -BOOL LLSelectNode::isTESelected(S32 te_index) +BOOL LLSelectNode::isTESelected(S32 te_index) const { if (te_index < 0 || te_index >= mObject->getNumTEs()) { @@ -6087,7 +6097,7 @@ BOOL LLSelectNode::isTESelected(S32 te_index) return (mTESelectMask & (0x1 << te_index)) != 0; } -S32 LLSelectNode::getLastSelectedTE() +S32 LLSelectNode::getLastSelectedTE() const { if (!isTESelected(mLastTESelected)) { @@ -6096,11 +6106,6 @@ S32 LLSelectNode::getLastSelectedTE() return mLastTESelected; } -S32 LLSelectNode::getLastOperatedTE() -{ - return mLastTESelected; -} - LLViewerObject* LLSelectNode::getObject() { if (!mObject) diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index 303a984bd0..ce0fee8803 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -173,13 +173,14 @@ public: void selectAllTEs(BOOL b); void selectTE(S32 te_index, BOOL selected); - BOOL isTESelected(S32 te_index); - S32 getLastSelectedTE(); - S32 getLastOperatedTE(); + BOOL isTESelected(S32 te_index) const; + bool hasSelectedTE() const { return TE_SELECT_MASK_ALL & mTESelectMask; } + S32 getLastSelectedTE() const; + S32 getLastOperatedTE() const { return mLastTESelected; } S32 getTESelectMask() { return mTESelectMask; } void renderOneSilhouette(const LLColor4 &color); void setTransient(BOOL transient) { mTransient = transient; } - BOOL isTransient() { return mTransient; } + BOOL isTransient() const { return mTransient; } LLViewerObject* getObject(); void setObject(LLViewerObject* object); // *NOTE: invalidate stored textures and colors when # faces change @@ -539,10 +540,10 @@ public: EGridMode getGridMode() { return mGridMode; } void getGrid(LLVector3& origin, LLQuaternion& rotation, LLVector3 &scale, bool for_snap_guides = false); - BOOL getTEMode() { return mTEMode; } - void setTEMode(BOOL b) { mTEMode = b; } + BOOL getTEMode() const { return mTEMode; } + void setTEMode(BOOL b) { mTEMode = b; } - BOOL shouldShowSelection() { return mShowSelection; } + BOOL shouldShowSelection() const { return mShowSelection; } LLBBox getBBoxOfSelection() const; LLBBox getSavedBBoxOfSelection() const { return mSavedSelectionBBox; } -- cgit v1.2.3 From 986567a6542603887c66daea7459b18f42267544 Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Mon, 4 Feb 2019 18:14:03 +0200 Subject: SL-5570 - Align planar faces" does not work on normal or specular maps --- indra/newview/llpanelface.cpp | 66 ++++++++++++++++++++++++++++++++++--------- indra/newview/llpanelface.h | 23 +++++++-------- 2 files changed, 65 insertions(+), 24 deletions(-) diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 38f181c803..5e6a44c09d 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -444,14 +444,17 @@ struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor LLSpinCtrl* ctrlTexOffsetS = mPanel->getChild("TexOffsetU"); LLSpinCtrl* ctrlTexOffsetT = mPanel->getChild("TexOffsetV"); LLSpinCtrl* ctrlTexRotation = mPanel->getChild("TexRot"); - LLComboBox* comboTexGen = mPanel->getChild("combobox texgen"); + LLComboBox* comboTexGen = mPanel->getChild("combobox texgen"); + LLCheckBoxCtrl* cb_planar_align = mPanel->getChild("checkbox planar align"); + bool align_planar = (cb_planar_align && cb_planar_align->get()); + llassert(comboTexGen); llassert(object); if (ctrlTexScaleS) { valid = !ctrlTexScaleS->getTentative(); // || !checkFlipScaleS->getTentative(); - if (valid) + if (valid || align_planar) { value = ctrlTexScaleS->get(); if (comboTexGen && @@ -460,13 +463,19 @@ struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor value *= 0.5f; } object->setTEScaleS( te, value ); + + if (align_planar) + { + LLPanelFace::LLSelectedTEMaterial::setNormalRepeatX(mPanel, value, te); + LLPanelFace::LLSelectedTEMaterial::setSpecularRepeatX(mPanel, value, te); + } } } if (ctrlTexScaleT) { valid = !ctrlTexScaleT->getTentative(); // || !checkFlipScaleT->getTentative(); - if (valid) + if (valid || align_planar) { value = ctrlTexScaleT->get(); //if( checkFlipScaleT->get() ) @@ -479,36 +488,60 @@ struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor value *= 0.5f; } object->setTEScaleT( te, value ); + + if (align_planar) + { + LLPanelFace::LLSelectedTEMaterial::setNormalRepeatY(mPanel, value, te); + LLPanelFace::LLSelectedTEMaterial::setSpecularRepeatY(mPanel, value, te); + } } } if (ctrlTexOffsetS) { valid = !ctrlTexOffsetS->getTentative(); - if (valid) + if (valid || align_planar) { value = ctrlTexOffsetS->get(); object->setTEOffsetS( te, value ); + + if (align_planar) + { + LLPanelFace::LLSelectedTEMaterial::setNormalOffsetX(mPanel, value, te); + LLPanelFace::LLSelectedTEMaterial::setSpecularOffsetX(mPanel, value, te); + } } } if (ctrlTexOffsetT) { valid = !ctrlTexOffsetT->getTentative(); - if (valid) + if (valid || align_planar) { value = ctrlTexOffsetT->get(); object->setTEOffsetT( te, value ); + + if (align_planar) + { + LLPanelFace::LLSelectedTEMaterial::setNormalOffsetY(mPanel, value, te); + LLPanelFace::LLSelectedTEMaterial::setSpecularOffsetY(mPanel, value, te); + } } } if (ctrlTexRotation) { valid = !ctrlTexRotation->getTentative(); - if (valid) + if (valid || align_planar) { value = ctrlTexRotation->get() * DEG_TO_RAD; object->setTERotation( te, value ); + + if (align_planar) + { + LLPanelFace::LLSelectedTEMaterial::setNormalRotation(mPanel, value, te); + LLPanelFace::LLSelectedTEMaterial::setSpecularRotation(mPanel, value, te); + } } } return true; @@ -550,14 +583,21 @@ struct LLPanelFaceSetAlignedTEFunctor : public LLSelectedTEFunctor if (set_aligned) { object->setTEOffset(te, uv_offset.mV[VX], uv_offset.mV[VY]); - object->setTEScale(te, uv_scale.mV[VX], uv_scale.mV[VY]); + object->setTEScale(te, uv_scale.mV[VX], uv_scale.mV[VY]); object->setTERotation(te, uv_rot); - LLPanelFace::LLSelectedTEMaterial::setNormalOffsetX(mPanel, uv_offset.mV[VX], te); - LLPanelFace::LLSelectedTEMaterial::setNormalOffsetY(mPanel, uv_offset.mV[VY], te); - LLPanelFace::LLSelectedTEMaterial::setSpecularOffsetX(mPanel, uv_offset.mV[VX], te); - LLPanelFace::LLSelectedTEMaterial::setSpecularOffsetY(mPanel, uv_offset.mV[VY], te); - LLPanelFace::LLSelectedTEMaterial::setNormalRotation(mPanel, uv_rot, te); - LLPanelFace::LLSelectedTEMaterial::setSpecularRotation(mPanel, uv_rot, te); + + LLPanelFace::LLSelectedTEMaterial::setNormalRotation(mPanel, uv_rot, te, object->getID()); + LLPanelFace::LLSelectedTEMaterial::setSpecularRotation(mPanel, uv_rot, te, object->getID()); + + LLPanelFace::LLSelectedTEMaterial::setNormalOffsetX(mPanel, uv_offset.mV[VX], te, object->getID()); + LLPanelFace::LLSelectedTEMaterial::setNormalOffsetY(mPanel, uv_offset.mV[VY], te, object->getID()); + LLPanelFace::LLSelectedTEMaterial::setNormalRepeatX(mPanel, uv_scale.mV[VX], te, object->getID()); + LLPanelFace::LLSelectedTEMaterial::setNormalRepeatY(mPanel, uv_scale.mV[VY], te, object->getID()); + + LLPanelFace::LLSelectedTEMaterial::setSpecularOffsetX(mPanel, uv_offset.mV[VX], te, object->getID()); + LLPanelFace::LLSelectedTEMaterial::setSpecularOffsetY(mPanel, uv_offset.mV[VY], te, object->getID()); + LLPanelFace::LLSelectedTEMaterial::setSpecularRepeatX(mPanel, uv_scale.mV[VX], te, object->getID()); + LLPanelFace::LLSelectedTEMaterial::setSpecularRepeatY(mPanel, uv_scale.mV[VY], te, object->getID()); } } if (!set_aligned) diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h index 4937966034..0b40d7d41a 100644 --- a/indra/newview/llpanelface.h +++ b/indra/newview/llpanelface.h @@ -252,16 +252,16 @@ private: typename DataType, typename SetValueType, void (LLMaterial::*MaterialEditFunc)(SetValueType data) > - static void edit(LLPanelFace* p, DataType data, int te = -1) + static void edit(LLPanelFace* p, DataType data, int te = -1, const LLUUID &only_for_object_id = LLUUID()) { LLMaterialEditFunctor< DataType, SetValueType, MaterialEditFunc > edit(data); struct LLSelectedTEEditMaterial : public LLSelectedTEMaterialFunctor { - LLSelectedTEEditMaterial(LLPanelFace* panel, LLMaterialEditFunctor< DataType, SetValueType, MaterialEditFunc >* editp) : _panel(panel), _edit(editp) {} + LLSelectedTEEditMaterial(LLPanelFace* panel, LLMaterialEditFunctor< DataType, SetValueType, MaterialEditFunc >* editp, const LLUUID &only_for_object_id) : _panel(panel), _edit(editp), _only_for_object_id(only_for_object_id) {} virtual ~LLSelectedTEEditMaterial() {}; virtual LLMaterialPtr apply(LLViewerObject* object, S32 face, LLTextureEntry* tep, LLMaterialPtr& current_material) { - if (_edit) + if (_edit && (_only_for_object_id.isNull() || _only_for_object_id == object->getID())) { LLMaterialPtr new_material = _panel->createDefaultMaterial(current_material); llassert_always(new_material); @@ -325,14 +325,15 @@ private: return NULL; } LLMaterialEditFunctor< DataType, SetValueType, MaterialEditFunc >* _edit; - LLPanelFace* _panel; - } editor(p, &edit); - LLSelectMgr::getInstance()->selectionSetMaterialParams(&editor, te); + LLPanelFace *_panel; + const LLUUID & _only_for_object_id; + } editor(p, &edit, only_for_object_id); + LLSelectMgr::getInstance()->selectionSetMaterialParams(&editor, te); } template< typename DataType, - typename ReturnType, + typename ReturnType, ReturnType (LLMaterial::* const MaterialGetFunc)() const > static void getTEMaterialValue(DataType& data_to_return, bool& identical,DataType default_value, bool has_tolerance = false, DataType tolerance = DataType()) { @@ -437,10 +438,10 @@ public: // Mutators for selected TE material // - #define DEF_EDIT_MAT_STATE(DataType,ReturnType,MaterialMemberFunc) \ - static void MaterialMemberFunc(LLPanelFace* p, DataType data, int te = -1) \ - { \ - edit< DataType, ReturnType, &LLMaterial::MaterialMemberFunc >(p, data, te); \ + #define DEF_EDIT_MAT_STATE(DataType,ReturnType,MaterialMemberFunc) \ + static void MaterialMemberFunc(LLPanelFace* p, DataType data, int te = -1, const LLUUID &only_for_object_id = LLUUID()) \ + { \ + edit< DataType, ReturnType, &LLMaterial::MaterialMemberFunc >(p, data, te, only_for_object_id); \ } // Accessors for selected TE state proper (legacy settings etc) -- cgit v1.2.3 From 51c2385d5294ff3c34d2130e1be5be8cfd159c17 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Fri, 8 Feb 2019 00:52:23 +0100 Subject: Clean up UI scaling --- indra/newview/app_settings/settings.xml | 2 +- indra/newview/llstartup.cpp | 4 --- indra/newview/llviewerwindow.cpp | 41 +--------------------- indra/newview/llviewerwindow.h | 4 --- .../newview/skins/default/xui/de/notifications.xml | 4 --- .../newview/skins/default/xui/en/notifications.xml | 12 ------- .../newview/skins/default/xui/es/notifications.xml | 4 --- .../newview/skins/default/xui/fr/notifications.xml | 4 --- .../newview/skins/default/xui/it/notifications.xml | 4 --- .../newview/skins/default/xui/ja/notifications.xml | 4 --- .../newview/skins/default/xui/pt/notifications.xml | 4 --- .../newview/skins/default/xui/ru/notifications.xml | 4 --- .../newview/skins/default/xui/tr/notifications.xml | 4 --- .../newview/skins/default/xui/zh/notifications.xml | 4 --- 14 files changed, 2 insertions(+), 97 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 688bcb8298..9c4811da7f 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -13125,7 +13125,7 @@ LastSystemUIScaleFactor Comment - Size of system UI during last run. On Windows 100% (96 DPI) system setting is 1.0 UI size + OBSOLETE: System UI scale factor is now automatically and independently from UIScaleFactor applied Persist 1 Type diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 37aaece5d6..5979014b36 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -793,10 +793,6 @@ bool idle_startup() } } display_startup(); - if (gViewerWindow->getSystemUIScaleFactorChanged()) - { - LLViewerWindow::showSystemUIScaleFactorChanged(); - } LLStartUp::setStartupState( STATE_LOGIN_WAIT ); // Wait for user input } else diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index d0c8145e58..ff5061159e 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1603,7 +1603,6 @@ BOOL LLViewerWindow::handleDPIChanged(LLWindow *window, F32 ui_scale_factor, S32 { if (ui_scale_factor >= MIN_UI_SCALE && ui_scale_factor <= MAX_UI_SCALE) { - gSavedSettings.setF32("LastSystemUIScaleFactor", ui_scale_factor); LLViewerWindow::reshape(window_width, window_height); mResDirty = true; return TRUE; @@ -1685,8 +1684,7 @@ LLViewerWindow::LLViewerWindow(const Params& p) mResDirty(false), mStatesDirty(false), mCurrResolutionIndex(0), - mProgressView(NULL), - mSystemUIScaleFactorChanged(false) + mProgressView(NULL) { // gKeyboard is still NULL, so it doesn't do LLWindowListener any good to // pass its value right now. Instead, pass it a nullary function that @@ -1762,13 +1760,6 @@ LLViewerWindow::LLViewerWindow(const Params& p) LLCoordScreen scr; mWindow->getSize(&scr); - if(p.fullscreen && ( scr.mX!=p.width || scr.mY!=p.height)) - { - LL_WARNS() << "Fullscreen has forced us in to a different resolution now using "<getSystemUISize(); @@ -1883,33 +1866,11 @@ LLViewerWindow::LLViewerWindow(const Params& p) mWorldViewRectScaled = calcScaledRect(mWorldViewRectRaw, mDisplayScale); } -//static -void LLViewerWindow::showSystemUIScaleFactorChanged() -{ - LLNotificationsUtil::add("SystemUIScaleFactorChanged", LLSD(), LLSD(), onSystemUIScaleFactorChanged); -} - std::string LLViewerWindow::getLastSnapshotDir() { return sSnapshotDir; } -//static -bool LLViewerWindow::onSystemUIScaleFactorChanged(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - if(option == 0) - { - LLFloaterReg::toggleInstanceOrBringToFront("preferences"); - LLFloater* pref_floater = LLFloaterReg::getInstance("preferences"); - LLTabContainer* tab_container = pref_floater->getChild("pref core"); - tab_container->selectTabByName("advanced1"); - - } - return false; -} - - void LLViewerWindow::initGLDefaults() { gGL.setSceneBlendType(LLRender::BT_ALPHA); diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index 83ca18f85d..d41a606f11 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -424,8 +424,6 @@ public: void calcDisplayScale(); static LLRect calcScaledRect(const LLRect & rect, const LLVector2& display_scale); - bool getSystemUIScaleFactorChanged() { return mSystemUIScaleFactorChanged; } - static void showSystemUIScaleFactorChanged(); static std::string getLastSnapshotDir(); private: @@ -441,7 +439,6 @@ private: S32 getChatConsoleBottomPad(); // Vertical padding for child console rect, varied by bottom clutter LLRect getChatConsoleRect(); // Get optimal cosole rect. - static bool onSystemUIScaleFactorChanged(const LLSD& notification, const LLSD& response); private: LLWindow* mWindow; // graphical window object bool mActive; @@ -515,7 +512,6 @@ private: LLPointer mDragHoveredObject; static LLTrace::SampleStatHandle<> sMouseVelocityStat; - bool mSystemUIScaleFactorChanged; // system UI scale factor changed from last run }; // diff --git a/indra/newview/skins/default/xui/de/notifications.xml b/indra/newview/skins/default/xui/de/notifications.xml index 43af1d8655..94ec441b15 100644 --- a/indra/newview/skins/default/xui/de/notifications.xml +++ b/indra/newview/skins/default/xui/de/notifications.xml @@ -1615,10 +1615,6 @@ Geben Sie das Objekt zum Verkauf frei und versuchen Sie es erneut. Möchten Sie Ihren Internetbrowser öffnen, um diesen Inhalt anzuzeigen? - - Der UI-Größenfaktor des Systems hat sich seit der letzten Ausführung geändert. Möchten Sie die Seite mit den UI-Größeneinstellungen öffnen? - - Möchten Sie Ihre [http://secondlife.com/account/ Startseite] aufrufen, um Ihr Konto zu verwalten? diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index cc57e1375a..b180159998 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -3899,18 +3899,6 @@ Do you want to open your Web browser to view this content? yestext="OK"/> - -System UI size factor has changed since last run. Do you want to open UI size adjustment settings page? - confirm - - - - - El factor de tamaño de IU del sistema ha cambiado desde la última ejecución. ¿Deseas abrir la página de ajustes de tamaño de la IU? - - ¿Ir al [http://secondlife.com/account/ Panel de Control] para administrar tu cuenta? diff --git a/indra/newview/skins/default/xui/fr/notifications.xml b/indra/newview/skins/default/xui/fr/notifications.xml index 74abecf760..62237221dd 100644 --- a/indra/newview/skins/default/xui/fr/notifications.xml +++ b/indra/newview/skins/default/xui/fr/notifications.xml @@ -1598,10 +1598,6 @@ Veuillez choisir un objet à vendre et réessayer. Voulez-vous ouvrir votre navigateur web système pour afficher ce contenu ? - - Le facteur de taille de l’interface système a changé depuis la dernière exécution. Voulez-vous ouvrir la page des paramètres d’ajustement de la taille de l’interface ? - - Accéder à votre [http://secondlife.com/account/ Page d'accueil] pour gérer votre compte ? diff --git a/indra/newview/skins/default/xui/it/notifications.xml b/indra/newview/skins/default/xui/it/notifications.xml index d1a47535d8..0abcde80e0 100644 --- a/indra/newview/skins/default/xui/it/notifications.xml +++ b/indra/newview/skins/default/xui/it/notifications.xml @@ -1601,10 +1601,6 @@ Imposta l'oggetto per la vendita e riprova. Vuoi aprire il browser per vedere questi contenuti? - - Il fattore dimensioni UI del sistema è cambiato rispetto all'ultima sessione. Vuoi aprire la pagina delle impostazioni di regolazione delle dimensioni UI? - - Vuoi andare su [http://secondlife.com/account/ Dashboard] per gestire il tuo account? diff --git a/indra/newview/skins/default/xui/ja/notifications.xml b/indra/newview/skins/default/xui/ja/notifications.xml index 99ba5b2655..abd9515e34 100644 --- a/indra/newview/skins/default/xui/ja/notifications.xml +++ b/indra/newview/skins/default/xui/ja/notifications.xml @@ -1630,10 +1630,6 @@ SHA1 フィンガープリント: [MD5_DIGEST] Web ブラウザを開いてこのコンテンツを表示しますか? - - 前回実行時からシステム UI サイズ係数が変更されています。UI サイズ調整設定ページを開きますか? - - [http://jp.secondlife.com/account/ マイアカウント] ページに移動してアカウントを管理しますか? diff --git a/indra/newview/skins/default/xui/pt/notifications.xml b/indra/newview/skins/default/xui/pt/notifications.xml index 5c848034d8..fde883131a 100644 --- a/indra/newview/skins/default/xui/pt/notifications.xml +++ b/indra/newview/skins/default/xui/pt/notifications.xml @@ -1592,10 +1592,6 @@ Por favor, ponha o objeto à venda e tente novamente. Abrir uma janela do navegador para ver essas informações? - - O fator de tamanho da interface do sistema foi alterado desde a última execução. Deseja abrir a página de configurações de ajuste de tamanho da interface? - - Deseja abrir o [http://secondlife.com/account/ Painel] para gerenciar sua conta? diff --git a/indra/newview/skins/default/xui/ru/notifications.xml b/indra/newview/skins/default/xui/ru/notifications.xml index d752bf254e..85314638c5 100644 --- a/indra/newview/skins/default/xui/ru/notifications.xml +++ b/indra/newview/skins/default/xui/ru/notifications.xml @@ -1600,10 +1600,6 @@ Открыть браузер для просмотра этого контента? - - Со времени последнего запуска изменился системный коэффициент размера интерфейса. Открыть страницу настроек размера интерфейса? - - Перейти на [http://secondlife.com/account/ информационную панель] для управления вашим аккаунтом? diff --git a/indra/newview/skins/default/xui/tr/notifications.xml b/indra/newview/skins/default/xui/tr/notifications.xml index d72d89f1f5..187638d488 100644 --- a/indra/newview/skins/default/xui/tr/notifications.xml +++ b/indra/newview/skins/default/xui/tr/notifications.xml @@ -1601,10 +1601,6 @@ Nesneyi satılık olarak ayarlayıp tekrar deneyin. Bu içeriği görüntülemek için Web tarayıcınızı açmak istiyor musunuz? - - Sistem kullanıcı arayüzü faktörü son çalıştırmadan bu yana değişti. Kullanıcı arayüzü büyüklük değiştirme ayarları sayfasını açmak istiyor musunuz? - - Hesabınızı yönetmek için [http://secondlife.com/account/ Kontrol Paneli] adresine gidilsin mi? diff --git a/indra/newview/skins/default/xui/zh/notifications.xml b/indra/newview/skins/default/xui/zh/notifications.xml index 9fe7b5acae..ea635d0e5d 100644 --- a/indra/newview/skins/default/xui/zh/notifications.xml +++ b/indra/newview/skins/default/xui/zh/notifications.xml @@ -1597,10 +1597,6 @@ SHA1 指紋:[MD5_DIGEST] 你確定要開啟網頁瀏覽器去察看這個內容? - - 系統使用者介面的尺寸倍數自從上次執行後已經改變。 你想要開啟使用者介面尺寸調整的設定頁嗎? - - 前往你的[http://secondlife.com/account/ 塗鴉牆]以進行管理你的帳戶? -- cgit v1.2.3 From f78ff795088ff3672bc739b1f204be7df4a8f560 Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Mon, 18 Feb 2019 21:55:48 +0200 Subject: Update contributions list --- doc/contributions.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/contributions.txt b/doc/contributions.txt index 57cd72648b..afde7838df 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -221,6 +221,7 @@ Ansariel Hiller MAINT-6917 MAINT-8085 MAINT-8723 + SL-10385 Aralara Rajal Arare Chantilly CHUIBUG-191 -- cgit v1.2.3 From e58a45ec46c5a9418d6b7f24d33762a8f91ada98 Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Fri, 1 Mar 2019 22:39:32 +0200 Subject: mac build fix (add up to: https://bitbucket.org/lindenlab/viewer-cougar/pull-requests/46/clean-up-ui-scaling/diff) --- indra/newview/llviewerwindow.cpp | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index e1700abc49..cc10d08f3a 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1763,17 +1763,6 @@ LLViewerWindow::LLViewerWindow(const Params& p) LLCoordScreen scr; mWindow->getSize(&scr); -#if LL_DARWIN - F32 system_scale_factor = 1.f; -#else - F32 system_scale_factor = mWindow->getSystemUISize(); - if (system_scale_factor < MIN_UI_SCALE || system_scale_factor > MAX_UI_SCALE) - { - // reset to default; - system_scale_factor = 1.f; - } -#endif - // Get the real window rect the window was created with (since there are various OS-dependent reasons why // the size of a window or fullscreen context may have been adjusted slightly...) F32 ui_scale_factor = llclamp(gSavedSettings.getF32("UIScaleFactor"), MIN_UI_SCALE, MAX_UI_SCALE) * mWindow->getSystemUISize(); -- cgit v1.2.3 From 9b9338204722fe893d039fb7daf6f52dcbbb3421 Mon Sep 17 00:00:00 2001 From: "callum@gmail.com" Date: Fri, 8 Mar 2019 12:48:10 -0800 Subject: pull in updated 3p-cef-bin package: CEF 3.3626.1895.g7001d56 (Chromium 72.0.3626.121) with fix for CVE-2019-5786 --- autobuild.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index 9b7ff39334..2bef0ef666 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -580,9 +580,9 @@ archive hash - 118987b1a5b56214cfdbd0c763e180da + bb069c5c6e8d0bc401e43b66ed6d4176 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/15127/97748/dullahan-1.1.1080_3.3325.1750.gaabe4c4-darwin64-513449.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/33604/278468/dullahan-1.1.1300_3.3626.1895.g7001d56-darwin64-525104.tar.bz2 name darwin64 @@ -592,9 +592,9 @@ archive hash - 2ecc71350b30a1057091b9cd7af18b1c + 1c68f5ea0427fb8dd602e99f1d72d608 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/15128/97755/dullahan-1.1.1080_3.3325.1750.gaabe4c4-windows-513449.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/33603/278469/dullahan-1.1.1300_3.3626.1895.g7001d56-windows-525104.tar.bz2 name windows @@ -604,16 +604,16 @@ archive hash - 2ed3e49388514dafb907c59a209d580e + 2d05676d9cb16b42d01f2938d6bdc533 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/15129/97760/dullahan-1.1.1080_3.3325.1750.gaabe4c4-windows64-513449.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/33605/278476/dullahan-1.1.1300_3.3626.1895.g7001d56-windows64-525104.tar.bz2 name windows64 version - 1.1.1080_3.3325.1750.gaabe4c4 + 1.1.1300_3.3626.1895.g7001d56 elfio -- cgit v1.2.3 From 9203140564245341abfd15f4d7a495f3f134fb87 Mon Sep 17 00:00:00 2001 From: "callum@gmail.com" Date: Fri, 8 Mar 2019 19:12:19 -0800 Subject: Pick up new version of Dullahan (1.1.1301) that doesn't crash because size change for browser surface was initiated too early --- autobuild.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index 2bef0ef666..d2924eca52 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -580,9 +580,9 @@ archive hash - bb069c5c6e8d0bc401e43b66ed6d4176 + 54fccdb81eea7393df0bdfe7bd0af79d url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/33604/278468/dullahan-1.1.1300_3.3626.1895.g7001d56-darwin64-525104.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/33640/279058/dullahan-1.1.1305_3.3626.1895.g7001d56-darwin64-525122.tar.bz2 name darwin64 @@ -592,9 +592,9 @@ archive hash - 1c68f5ea0427fb8dd602e99f1d72d608 + 0516ef9be6377cbdedc1ecef8d7d6b2c url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/33603/278469/dullahan-1.1.1300_3.3626.1895.g7001d56-windows-525104.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/33642/279070/dullahan-1.1.1305_3.3626.1895.g7001d56-windows-525122.tar.bz2 name windows @@ -604,16 +604,16 @@ archive hash - 2d05676d9cb16b42d01f2938d6bdc533 + d9c23b391f627b3773122d84ed7436f8 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/33605/278476/dullahan-1.1.1300_3.3626.1895.g7001d56-windows64-525104.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/33641/279065/dullahan-1.1.1305_3.3626.1895.g7001d56-windows64-525122.tar.bz2 name windows64 version - 1.1.1300_3.3626.1895.g7001d56 + 1.1.1305_3.3626.1895.g7001d56 elfio -- cgit v1.2.3 From c2ff5a28789a6343b445d48373c84096085303f7 Mon Sep 17 00:00:00 2001 From: callum_linden Date: Fri, 8 Mar 2019 21:29:32 -0800 Subject: Runtime files required by CEF changed in this version of CEF. We add them to the cef-bin and dullahan 3p packages but they were not copied to the right place - now they are --- indra/newview/viewer_manifest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index c0f642c852..fcb97ded8f 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -635,7 +635,7 @@ class WindowsManifest(ViewerManifest): self.path("dullahan_host.exe") self.path("natives_blob.bin") self.path("snapshot_blob.bin") - self.path("widevinecdmadapter.dll") + self.path("v8_context_snapshot.bin") # MSVC DLLs needed for CEF and have to be in same directory as plugin with self.prefix(src=os.path.join(self.args['build'], os.pardir, -- cgit v1.2.3 From 89f99f6ba441e53ab2144e4689f5c95ce10c749e Mon Sep 17 00:00:00 2001 From: "callum@gmail.com" Date: Tue, 12 Mar 2019 13:49:21 -0700 Subject: Pull in Dullahan 1.1.1309 with fix for macOS version --- autobuild.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index d2924eca52..e6c6803d89 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -580,9 +580,9 @@ archive hash - 54fccdb81eea7393df0bdfe7bd0af79d + 9c219f5fe35161eefb8abe1c6b8524ea url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/33640/279058/dullahan-1.1.1305_3.3626.1895.g7001d56-darwin64-525122.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/33755/280172/dullahan-1.1.1309_3.3626.1895.g7001d56-darwin64-525191.tar.bz2 name darwin64 @@ -592,9 +592,9 @@ archive hash - 0516ef9be6377cbdedc1ecef8d7d6b2c + 4b62b7726ba4b6912711b232539a51ed url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/33642/279070/dullahan-1.1.1305_3.3626.1895.g7001d56-windows-525122.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/33756/280178/dullahan-1.1.1309_3.3626.1895.g7001d56-windows-525191.tar.bz2 name windows @@ -604,16 +604,16 @@ archive hash - d9c23b391f627b3773122d84ed7436f8 + 06c3ae1ac1c0b9ce044ad839d95faff8 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/33641/279065/dullahan-1.1.1305_3.3626.1895.g7001d56-windows64-525122.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/33757/280182/dullahan-1.1.1309_3.3626.1895.g7001d56-windows64-525191.tar.bz2 name windows64 version - 1.1.1305_3.3626.1895.g7001d56 + 1.1.1309_3.3626.1895.g7001d56 elfio -- cgit v1.2.3 From f632b4deaef340758dfea6840f94b8b3c8751caf Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Wed, 13 Mar 2019 17:35:35 +0200 Subject: Fixed (#3) --- indra/newview/llworldmapview.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index f2e139dcca..93d1dacf1f 100644 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -883,13 +883,13 @@ void LLWorldMapView::drawFrustum() F32 half_width_pixels = half_width_meters * meters_to_pixels; // Compute the frustum coordinates. Take the UI scale into account. - F32 ui_scale_factor = gSavedSettings.getF32("UIScaleFactor"); #if defined(LL_DARWIN) - F32 ctr_x = ((getLocalRect().getWidth() * 0.5f + sPanX) * ui_scale_factor) * LLUI::getScaleFactor().mV[VX]; - F32 ctr_y = ((getLocalRect().getHeight() * 0.5f + sPanY) * ui_scale_factor) * LLUI::getScaleFactor().mV[VY]; + F32 ui_scale_factor = gSavedSettings.getF32("UIScaleFactor"); + F32 ctr_x = ((getLocalRect().getWidth() * 0.5f + sPanX) * ui_scale_factor) * LLUI::getScaleFactor().mV[VX]; + F32 ctr_y = ((getLocalRect().getHeight() * 0.5f + sPanY) * ui_scale_factor) * LLUI::getScaleFactor().mV[VY]; #else - F32 ctr_x = ((getLocalRect().getWidth() * 0.5f + sPanX) * ui_scale_factor); - F32 ctr_y = ((getLocalRect().getHeight() * 0.5f + sPanY) * ui_scale_factor); + F32 ctr_x = ((getLocalRect().getWidth() * 0.5f + sPanX) * LLUI::getScaleFactor().mV[VX]); + F32 ctr_y = ((getLocalRect().getHeight() * 0.5f + sPanY) * LLUI::getScaleFactor().mV[VY]); #endif gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); -- cgit v1.2.3 From 2046e01f80035538f998f9e105dfd21c217a660c Mon Sep 17 00:00:00 2001 From: "callum@gmail.com" Date: Fri, 15 Mar 2019 14:36:21 -0700 Subject: Pull in updated Dullahan (1.1.1313) with a fix for the DullahanHelper.app icon appearing in the Apple Dock --- autobuild.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index e6c6803d89..5b84256ab8 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -580,9 +580,9 @@ archive hash - 9c219f5fe35161eefb8abe1c6b8524ea + 29973c47ad65c18e9c45b5e95e8d3364 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/33755/280172/dullahan-1.1.1309_3.3626.1895.g7001d56-darwin64-525191.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/33962/282718/dullahan-1.1.1313_3.3626.1895.g7001d56-darwin64-525319.tar.bz2 name darwin64 @@ -592,9 +592,9 @@ archive hash - 4b62b7726ba4b6912711b232539a51ed + 239dc2288ab12ccfdee6c0eb91539f49 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/33756/280178/dullahan-1.1.1309_3.3626.1895.g7001d56-windows-525191.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/33964/282730/dullahan-1.1.1313_3.3626.1895.g7001d56-windows-525319.tar.bz2 name windows @@ -604,16 +604,16 @@ archive hash - 06c3ae1ac1c0b9ce044ad839d95faff8 + c86a97fa3de24057575e8942c402e720 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/33757/280182/dullahan-1.1.1309_3.3626.1895.g7001d56-windows64-525191.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/33963/282731/dullahan-1.1.1313_3.3626.1895.g7001d56-windows64-525319.tar.bz2 name windows64 version - 1.1.1309_3.3626.1895.g7001d56 + 1.1.1313_3.3626.1895.g7001d56 elfio -- cgit v1.2.3 From 72f21b399e5a07ee162116f677e643b21e54d7bb Mon Sep 17 00:00:00 2001 From: "callum@gmail.com" Date: Mon, 18 Mar 2019 15:36:16 -0700 Subject: Pull in a change to Dullahan that allows user to specify flag that lets video/audio autoplay like it did before Chrome 70? (Dullahan v1.1.1320). Also sets a flag in media plugin CEF code to change the settings from false (default) to true --- autobuild.xml | 14 +++++++------- indra/media_plugins/cef/media_plugin_cef.cpp | 1 + 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index 5b84256ab8..5f072512c1 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -580,9 +580,9 @@ archive hash - 29973c47ad65c18e9c45b5e95e8d3364 + 23aeaf23e7db2484a1850017141860dd url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/33962/282718/dullahan-1.1.1313_3.3626.1895.g7001d56-darwin64-525319.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/34069/283470/dullahan-1.1.1320_3.3626.1895.g7001d56-darwin64-525361.tar.bz2 name darwin64 @@ -592,9 +592,9 @@ archive hash - 239dc2288ab12ccfdee6c0eb91539f49 + 71fa66203326aca918796e874976c080 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/33964/282730/dullahan-1.1.1313_3.3626.1895.g7001d56-windows-525319.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/34070/283477/dullahan-1.1.1320_3.3626.1895.g7001d56-windows-525361.tar.bz2 name windows @@ -604,16 +604,16 @@ archive hash - c86a97fa3de24057575e8942c402e720 + c7162e4805f50a3609f5dc63d0cf2bc0 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/33963/282731/dullahan-1.1.1313_3.3626.1895.g7001d56-windows64-525319.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/34071/283480/dullahan-1.1.1320_3.3626.1895.g7001d56-windows64-525361.tar.bz2 name windows64 version - 1.1.1313_3.3626.1895.g7001d56 + 1.1.1320_3.3626.1895.g7001d56 elfio diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index 2bd5526a86..66b316df90 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -519,6 +519,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) settings.webgl_enabled = true; settings.log_file = mCefLogFile; settings.log_verbose = mCefLogVerbose; + settings.autoplay_without_gesture = true; std::vector custom_schemes(1, "secondlife"); mCEFLib->setCustomSchemes(custom_schemes); -- cgit v1.2.3 From ee39ebd523455a32234cf3d362ca96ebdcd4d86b Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Wed, 20 Mar 2019 19:40:14 +0200 Subject: Backed out changeset: 29f763ea2f9b The fix caused SL-10357 --- indra/newview/pipeline.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 7be5c86679..e8c9909f8c 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -2514,8 +2514,8 @@ void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_cl LLSpatialPartition* part = region->getSpatialPartition(i); if (part) { - if (LLViewerRegion::PARTITION_BRIDGE == i || hasRenderType(part->mDrawableType)) - { //pass PARTITION BRIDGE because LLDrawable can be moved to this partition + if (hasRenderType(part->mDrawableType)) + { part->cull(camera); } } -- cgit v1.2.3 From a3f4405cba135ed6b68c74e9e192273122543b9c Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 2 Apr 2019 14:34:12 -0400 Subject: Added tag 6.1.1-release for changeset 50f0ece62ddb --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index fcf043b1ea..b0da8b0d98 100755 --- a/.hgtags +++ b/.hgtags @@ -545,3 +545,4 @@ ac3b1332ad4f55b7182a8cbcc1254535a0069f75 5.1.7-release 821edfcd14919c0e95c590866171c61fb57e8623 6.0.0-release 21b7604680ef6b6ea67f8bebaaa588d6e263bdc1 6.0.1-release a3143db58a0f6b005232bf9018e7fef17ff9ec90 6.1.0-release +50f0ece62ddb5a244ecb6d00ef5a89d80ad50efa 6.1.1-release -- cgit v1.2.3 From 5cf18cb867be567bf921f0b94a78fd822e4112ad Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 2 Apr 2019 14:34:12 -0400 Subject: increment viewer version to 6.1.2 --- 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 f3b5af39e4..5e3254243a 100644 --- a/indra/newview/VIEWER_VERSION.txt +++ b/indra/newview/VIEWER_VERSION.txt @@ -1 +1 @@ -6.1.1 +6.1.2 -- cgit v1.2.3