From 0e91d18da3f203bcef681d3134b736978114c2bd Mon Sep 17 00:00:00 2001 From: RunitaiLinden Date: Mon, 5 Feb 2024 15:36:42 -0600 Subject: #677 Add mirror clipping to rigged shaders --- indra/newview/llenvironment.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/newview/llenvironment.cpp') diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index 60c2682078..affea3f69c 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -1675,8 +1675,6 @@ void LLEnvironment::update(const LLViewerCamera * cam) updateSettingsUniforms(); - // *TODO: potential optimization - this block may only need to be - // executed some of the time. For example for water shaders only. { LLViewerShaderMgr::shader_iter shaders_iter, end_shaders; end_shaders = LLViewerShaderMgr::instance()->endShaders(); @@ -1687,6 +1685,10 @@ void LLEnvironment::update(const LLViewerCamera * cam) || shaders_iter->mShaderGroup == LLGLSLShader::SG_WATER)) { shaders_iter->mUniformsDirty = TRUE; + if (shaders_iter->mRiggedVariant) + { + shaders_iter->mRiggedVariant->mUniformsDirty = TRUE; + } } } } -- cgit v1.2.3 From c1bde75768e1374d4f094936d52ed29f6f5d3cba Mon Sep 17 00:00:00 2001 From: RunitaiLinden Date: Fri, 8 Mar 2024 12:01:20 -0600 Subject: HDRI Local Preview (#953) * #926 WIP - HDRI import prototype v0 * #926 WIP -- add OpenEXR to autobuild.xml * #926 WIP -- Add OpenEXR cmake * #926 WIP -- Attempt at using OpenEXR autobuild package and don't hard code .exr file to load * #926 Unmangle autobuild.xml and get dll's in the right place (thanks, Caladbolg!) * implement mac shared libs plumbing for OpenEXR for secondlife/viewer#926 * Fix Xcode/clang compile error regarding new[]/delete[] mismatch * #926 HDRI Preview finishing touches. - Full ACES when HDRI is enabled - Fix for probes getting stuck paused - Add exposure and rotation controls --------- Co-authored-by: Brad Linden --- indra/newview/llenvironment.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'indra/newview/llenvironment.cpp') diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index affea3f69c..0b535e15b0 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -1770,8 +1770,10 @@ void LLEnvironment::updateGLVariablesForSettings(LLShaderUniforms* uniforms, con case LLSD::TypeArray: { LLVector4 vect4(value); + // always identify as a radiance pass if desaturating irradiance is disabled + static LLCachedControl desaturate_irradiance(gSavedSettings, "RenderDesaturateIrradiance", true); - if (gCubeSnapshot && !gPipeline.mReflectionMapManager.isRadiancePass()) + if (desaturate_irradiance && gCubeSnapshot && !gPipeline.mReflectionMapManager.isRadiancePass()) { // maximize and remove tinting if this is an irradiance map render pass and the parameter feeds into the sky background color auto max_vec = [](LLVector4 col) { @@ -2966,7 +2968,7 @@ void LLEnvironment::DayTransition::animate() // pause probe updates and reset reflection maps on sky change - gPipeline.mReflectionMapManager.pause(); + gPipeline.mReflectionMapManager.pause(mTransitionTime); gPipeline.mReflectionMapManager.reset(); mSky = mStartSky->buildClone(); @@ -3569,7 +3571,7 @@ namespace mInjectedSky->setSource(target_sky); // clear reflection probes and pause updates during sky change - gPipeline.mReflectionMapManager.pause(); + gPipeline.mReflectionMapManager.pause(transition); gPipeline.mReflectionMapManager.reset(); mBlenderSky = std::make_shared(target_sky, start_sky, psky, transition); -- cgit v1.2.3 From b06a99f7c76950484972e25d9dbbee8660a6a6c3 Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Wed, 15 May 2024 12:47:27 +0300 Subject: Post-merge spaces fix --- indra/newview/llenvironment.cpp | 90 ++++++++++++++++++++--------------------- 1 file changed, 45 insertions(+), 45 deletions(-) (limited to 'indra/newview/llenvironment.cpp') diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index 0b535e15b0..247a487ace 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -5,21 +5,21 @@ * $LicenseInfo:firstyear=2009&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2011, 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$ */ @@ -94,7 +94,7 @@ namespace const std::string KEY_ACTION("action"); const std::string KEY_ACTIONDATA("action_data"); const std::string KEY_EXPERIENCEID("public_id"); - const std::string KEY_OBJECTNAME("ObjectName"); // some of these do not conform to the '_' format. + const std::string KEY_OBJECTNAME("ObjectName"); // some of these do not conform to the '_' format. const std::string KEY_PARCELNAME("ParcelName"); // But changing these would also alter the Experience Log requirements. const std::string KEY_COUNT("Count"); @@ -370,13 +370,13 @@ namespace virtual ~LLSettingsInjected() {}; typename SETTINGT::ptr_t getSource() const { return this->mSource; } - void setSource(const typename SETTINGT::ptr_t &source) + void setSource(const typename SETTINGT::ptr_t &source) { if (source.get() == this) // do not set a source to itself. return; - this->mSource = source; - this->setDirtyFlag(true); - this->mLastSourceHash = 0; + this->mSource = source; + this->setDirtyFlag(true); + this->mLastSourceHash = 0; } virtual bool isDirty() const override { return SETTINGT::isDirty() || (this->mSource->isDirty()); } @@ -565,7 +565,7 @@ namespace if (!this->mSource) return; - // clears the dirty flag on this object. Need to prevent triggering + // clears the dirty flag on this object. Need to prevent triggering // more calls into this updateSettings LLSettingsBase::updateSettings(); @@ -824,7 +824,7 @@ const S32 LLEnvironment::NO_TRACK(-1); const S32 LLEnvironment::NO_VERSION(-3); // For viewer sided change, like ENV_LOCAL. -3 since -1 and -2 are taken by parcel initial server/viewer version const S32 LLEnvironment::VERSION_CLEANUP(-4); // for cleanups -const F32 LLEnvironment::SUN_DELTA_YAW(F_PI); // 180deg +const F32 LLEnvironment::SUN_DELTA_YAW(F_PI); // 180deg const U32 LLEnvironment::DayInstance::NO_ANIMATE_SKY(0x01); @@ -929,9 +929,9 @@ bool LLEnvironment::canEdit() const return true; } -LLSettingsSky::ptr_t LLEnvironment::getCurrentSky() const -{ - LLSettingsSky::ptr_t psky = mCurrentEnvironment->getSky(); +LLSettingsSky::ptr_t LLEnvironment::getCurrentSky() const +{ + LLSettingsSky::ptr_t psky = mCurrentEnvironment->getSky(); if (!psky && mCurrentEnvironment->getEnvironmentSelection() >= ENV_EDIT) { @@ -947,9 +947,9 @@ LLSettingsSky::ptr_t LLEnvironment::getCurrentSky() const return psky; } -LLSettingsWater::ptr_t LLEnvironment::getCurrentWater() const +LLSettingsWater::ptr_t LLEnvironment::getCurrentWater() const { - LLSettingsWater::ptr_t pwater = mCurrentEnvironment->getWater(); + LLSettingsWater::ptr_t pwater = mCurrentEnvironment->getWater(); if (!pwater && mCurrentEnvironment->getEnvironmentSelection() >= ENV_EDIT) { @@ -1235,7 +1235,7 @@ void LLEnvironment::setEnvironment(LLEnvironment::EnvSelection_t env, LLEnvironm } } } - + if (fixed.second) { logEnvironment(env, fixed.second, env_version); @@ -1531,12 +1531,12 @@ void LLEnvironment::updateEnvironment(LLSettingsBase::Seconds transition, bool f { if (transition != TRANSITION_INSTANT) { - DayInstance::ptr_t trans = std::make_shared( - mCurrentEnvironment->getSky(), mCurrentEnvironment->getWater(), pinstance, transition); - - trans->animate(); - - mCurrentEnvironment = trans; + DayInstance::ptr_t trans = std::make_shared( + mCurrentEnvironment->getSky(), mCurrentEnvironment->getWater(), pinstance, transition); + + trans->animate(); + + mCurrentEnvironment = trans; } else { @@ -1696,12 +1696,12 @@ void LLEnvironment::update(const LLViewerCamera * cam) void LLEnvironment::updateCloudScroll() { - // This is a function of the environment rather than the sky, since it should + // This is a function of the environment rather than the sky, since it should // persist through sky transitions. static LLTimer s_cloud_timer; F64 delta_t = s_cloud_timer.getElapsedTimeAndResetF64(); - + if (mCurrentEnvironment->getSky() && !mCloudScrollPaused) { LLVector2 rate = mCurrentEnvironment->getSky()->getCloudScrollRate(); @@ -1786,7 +1786,7 @@ void LLEnvironment::updateGLVariablesForSettings(LLShaderUniforms* uniforms, con }; switch (it.second.getShaderKey()) - { + { case LLShaderMgr::BLUE_HORIZON: case LLShaderMgr::BLUE_DENSITY: vect4 = max_vec(vect4); @@ -2188,7 +2188,7 @@ void LLEnvironment::coroUpdateEnvironment(S32 parcel_id, S32 track_no, UpdateInf query << "&"; } if (track_no != NO_TRACK) - { + { query << "trackno=" << track_no; } url += query.str(); @@ -2271,7 +2271,7 @@ void LLEnvironment::coroResetEnvironment(S32 parcel_id, S32 track_no, environmen LLSD result = httpAdapter->deleteAndSuspend(httpRequest, url); // results that come back may contain the new settings - LLSD notify; + LLSD notify; LLSD httpResults = result["http_result"]; LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); @@ -2551,7 +2551,7 @@ void LLEnvironment::onAgentPositionHasChanged(const LLVector3 &localpos) S32 LLEnvironment::calculateSkyTrackForAltitude(F64 altitude) { auto it = std::find_if_not(mTrackAltitudes.begin(), mTrackAltitudes.end(), [altitude](F32 test) { return altitude > test; }); - + if (it == mTrackAltitudes.begin()) return 1; else if (it == mTrackAltitudes.end()) @@ -2575,19 +2575,19 @@ void LLEnvironment::handleEnvironmentPush(LLSD &message) if (action == ACTION_CLEARENVIRONMENT) - { + { handleEnvironmentPushClear(experience_id, action_data, transition_time); } else if (action == ACTION_PUSHFULLENVIRONMENT) - { + { handleEnvironmentPushFull(experience_id, action_data, transition_time); } else if (action == ACTION_PUSHPARTIALENVIRONMENT) - { + { handleEnvironmentPushPartial(experience_id, action_data, transition_time); } else - { + { LL_WARNS("ENVIRONMENT", "GENERICMESSAGES") << "Unknown environment push action '" << action << "'" << LL_ENDL; } } @@ -2801,9 +2801,9 @@ bool LLEnvironment::DayInstance::setSky(const LLSettingsSky::ptr_t &psky) mInitialized = false; bool changed = psky == nullptr || mSky == nullptr || mSky->getHash() != psky->getHash(); - + bool different_sky = mSky != psky; - + mSky = psky; mSky->mReplaced |= different_sky; mSky->update(); @@ -2938,7 +2938,7 @@ LLEnvironment::DayTransition::DayTransition(const LLSettingsSky::ptr_t &skystart mNextInstance(end), mTransitionTime(time) { - + } bool LLEnvironment::DayTransition::applyTimeDelta(const LLSettingsBase::Seconds& delta) @@ -2950,14 +2950,14 @@ bool LLEnvironment::DayTransition::applyTimeDelta(const LLSettingsBase::Seconds& return changed; } -void LLEnvironment::DayTransition::animate() +void LLEnvironment::DayTransition::animate() { mNextInstance->animate(); mWater = mStartWater->buildClone(); mBlenderWater = std::make_shared(mWater, mStartWater, mNextInstance->getWater(), mTransitionTime); mBlenderWater->setOnFinished( - [this](LLSettingsBlender::ptr_t blender) { + [this](LLSettingsBlender::ptr_t blender) { mBlenderWater.reset(); if (!mBlenderSky && !mBlenderWater) @@ -3366,8 +3366,8 @@ namespace return changed; } - void DayInjection::setBaseDayInstance(const LLEnvironment::DayInstance::ptr_t &baseday) - { + void DayInjection::setBaseDayInstance(const LLEnvironment::DayInstance::ptr_t &baseday) + { mBaseDayInstance = baseday; if (mSkyExperience.isNull()) @@ -3576,7 +3576,7 @@ namespace mBlenderSky = std::make_shared(target_sky, start_sky, psky, transition); mBlenderSky->setOnFinished( - [this, psky](LLSettingsBlender::ptr_t blender) + [this, psky](LLSettingsBlender::ptr_t blender) { mBlenderSky.reset(); mInjectedSky->setSource(psky); @@ -3600,7 +3600,7 @@ namespace return; } if (transition == LLEnvironment::TRANSITION_INSTANT) - { + { mBlenderWater.reset(); mInjectedWater->setSource(pwater); } @@ -3612,7 +3612,7 @@ namespace mBlenderWater = std::make_shared(scratch_Water, start_Water, pwater, transition); mBlenderWater->setOnFinished( - [this, pwater](LLSettingsBlender::ptr_t blender) + [this, pwater](LLSettingsBlender::ptr_t blender) { mBlenderWater.reset(); mInjectedWater->setSource(pwater); @@ -3633,7 +3633,7 @@ namespace LLEnvironment::EnvSelection_t base_env(mBaseDayInstance->getEnvironmentSelection()); LLEnvironment::DayInstance::ptr_t nextbase = LLEnvironment::instance().getSharedEnvironmentInstance(); - if ((base_env == LLEnvironment::ENV_NONE) || (nextbase == mBaseDayInstance) || + if ((base_env == LLEnvironment::ENV_NONE) || (nextbase == mBaseDayInstance) || (!mSkyExperience.isNull() && !mWaterExperience.isNull())) { // base instance completely overridden, or not changed no transition will happen return; @@ -3665,7 +3665,7 @@ namespace void DayInjection::checkExperience() { if ((!mDayExperience.isNull()) && (mSkyExperience != mDayExperience) && (mWaterExperience != mDayExperience)) - { // There was a day experience but we've replaced it with a water and a sky experience. + { // There was a day experience but we've replaced it with a water and a sky experience. mDayExperience.setNull(); mBaseDayInstance = LLEnvironment::instance().getSharedEnvironmentInstance(); } -- cgit v1.2.3