From b37eb2642f6e6e4d1e32a49c7ab31f70321cd979 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Fri, 10 Nov 2017 16:17:25 -0800 Subject: Remove delete preset dialog, Initial settings for selection level (Region/Parcel/Local) --- indra/newview/llsky.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llsky.cpp') diff --git a/indra/newview/llsky.cpp b/indra/newview/llsky.cpp index 3ef89ba920..a961f0e3b4 100644 --- a/indra/newview/llsky.cpp +++ b/indra/newview/llsky.cpp @@ -51,7 +51,6 @@ #include "llvosky.h" #include "llcubemap.h" #include "llviewercontrol.h" -#include "llenvmanager.h" #include "llvowlsky.h" -- cgit v1.2.3 From 35873f5963791af08a9951624dc96481a71fa1d7 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Mon, 13 Nov 2017 16:43:47 -0800 Subject: Clean up on sun and moon --- indra/newview/llsky.cpp | 67 +++++++++++++++++-------------------------------- 1 file changed, 23 insertions(+), 44 deletions(-) (limited to 'indra/newview/llsky.cpp') diff --git a/indra/newview/llsky.cpp b/indra/newview/llsky.cpp index a961f0e3b4..fb3123fd81 100644 --- a/indra/newview/llsky.cpp +++ b/indra/newview/llsky.cpp @@ -76,7 +76,6 @@ LLSky::LLSky() mLightingGeneration = 0; mUpdatedThisFrame = TRUE; - mOverrideSimSunPosition = FALSE; mSunPhase = 0.f; } @@ -133,33 +132,13 @@ void LLSky::resetVertexBuffers() } } -void LLSky::setOverrideSun(BOOL override) -{ - if (!mOverrideSimSunPosition && override) - { - mLastSunDirection = getSunDirection(); - } - else if (mOverrideSimSunPosition && !override) - { - setSunDirection(mLastSunDirection, LLVector3::zero); - } - mOverrideSimSunPosition = override; -} - -void LLSky::setSunDirection(const LLVector3 &sun_direction, const LLVector3 &sun_ang_velocity) +void LLSky::setSunDirection(const LLVector3 &sun_direction, const LLVector3 &moon_direction) { if(mVOSkyp.notNull()) { - mVOSkyp->setSunDirection(sun_direction, sun_ang_velocity); + mVOSkyp->setSunDirection(sun_direction, moon_direction); } } - -void LLSky::setSunTargetDirection(const LLVector3 &sun_direction, const LLVector3 &sun_ang_velocity) -{ - mSunTargDir = sun_direction; -} - - LLVector3 LLSky::getSunDirection() const { if (mVOSkyp) @@ -327,13 +306,13 @@ void LLSky::init(const LLVector3 &sun_direction) LLGLState::checkStates(); LLGLState::checkTextureChannels(); - if (gSavedSettings.getBOOL("SkyOverrideSimSunPosition") || mOverrideSimSunPosition) + if (gSavedSettings.getBOOL("SkyOverrideSimSunPosition")) { - setSunDirection(mSunDefaultPosition, LLVector3(0.f, 0.f, 0.f)); + setSunDirection(mSunDefaultPosition, -mSunDefaultPosition); } else { - setSunDirection(sun_direction, LLVector3(0.f, 0.f, 0.f)); + setSunDirection(sun_direction, -sun_direction); } LLGLState::checkStates(); @@ -363,24 +342,24 @@ void LLSky::setWind(const LLVector3& average_wind) void LLSky::propagateHeavenlyBodies(F32 dt) { - if (!mOverrideSimSunPosition) - { - LLVector3 curr_dir = getSunDirection(); - LLVector3 diff = mSunTargDir - curr_dir; - const F32 dist = diff.normVec(); - if (dist > 0) - { - const F32 step = llmin (dist, 0.00005f); - //const F32 step = min (dist, 0.0001); - diff *= step; - curr_dir += diff; - curr_dir.normVec(); - if (mVOSkyp) - { - mVOSkyp->setSunDirection(curr_dir, LLVector3()); - } - } - } +// if (!mOverrideSimSunPosition) +// { +// LLVector3 curr_dir = getSunDirection(); +// LLVector3 diff = mSunTargDir - curr_dir; +// const F32 dist = diff.normVec(); +// if (dist > 0) +// { +// const F32 step = llmin (dist, 0.00005f); +// //const F32 step = min (dist, 0.0001); +// diff *= step; +// curr_dir += diff; +// curr_dir.normVec(); +// if (mVOSkyp) +// { +// mVOSkyp->setSunDirection(curr_dir); +// } +// } +// } } F32 LLSky::getSunPhase() const -- cgit v1.2.3 From 096ea05a936d178ce0533708edab27708e9e718f Mon Sep 17 00:00:00 2001 From: "Graham Linden graham@lindenlab.com" Date: Thu, 8 Mar 2018 00:04:03 +0000 Subject: Rename getFogColor from water and sky settings to getWaterFogColor and getSkyFogColor. --- indra/newview/llsky.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llsky.cpp') diff --git a/indra/newview/llsky.cpp b/indra/newview/llsky.cpp index fb3123fd81..15aebda5ad 100644 --- a/indra/newview/llsky.cpp +++ b/indra/newview/llsky.cpp @@ -377,11 +377,11 @@ void LLSky::setSunPhase(const F32 phase) ////////////////////////////////////////////////////////////////////// -LLColor4 LLSky::getFogColor() const +LLColor4 LLSky::getSkyFogColor() const { if (mVOSkyp) { - return mVOSkyp->getFogColor(); + return mVOSkyp->getSkyFogColor(); } return LLColor4(1.f, 1.f, 1.f, 1.f); -- cgit v1.2.3 From 8082cb86682c008389cb8127f295e6566ec368e5 Mon Sep 17 00:00:00 2001 From: "Graham Linden graham@lindenlab.com" Date: Fri, 18 May 2018 23:14:56 +0100 Subject: Make nighttime elev constant _SIN, since it uses a sin value. Put that constant in sky settings and eliminate dups. Fix up logic around when to use heavenly bodies (fix broken moon in basic sky). Remove unnecessary clip to horizon. Put in temp code to ena/dis sun/moon based on LLEnvironment::getIsDaytime(). --- indra/newview/llsky.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'indra/newview/llsky.cpp') diff --git a/indra/newview/llsky.cpp b/indra/newview/llsky.cpp index 15aebda5ad..a81e74b6ed 100644 --- a/indra/newview/llsky.cpp +++ b/indra/newview/llsky.cpp @@ -51,18 +51,16 @@ #include "llvosky.h" #include "llcubemap.h" #include "llviewercontrol.h" +#include "llenvironment.h" #include "llvowlsky.h" F32 azimuth_from_vector(const LLVector3 &v); F32 elevation_from_vector(const LLVector3 &v); -LLSky gSky; -// ---------------- LLSky ---------------- - -const F32 LLSky::NIGHTTIME_ELEVATION = -8.0f; // degrees -const F32 LLSky::NIGHTTIME_ELEVATION_COS = (F32)sin(NIGHTTIME_ELEVATION*DEG_TO_RAD); +LLSky gSky; +// ---------------- LLSky ---------------- ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// -- cgit v1.2.3 From 13536bb273b7413aa4461c8eeaf5a6a865f4234d Mon Sep 17 00:00:00 2001 From: "Graham Linden graham@lindenlab.com" Date: Tue, 22 May 2018 21:42:54 +0100 Subject: Remove some obsolete sky funcs. Remove Matrix3/4 funcs using LLQuat 4-float init incorrectly (they are redundant to angle/axis versions anyway). Fix up tests referring to removed funcs above. --- indra/newview/llsky.cpp | 55 ------------------------------------------------- 1 file changed, 55 deletions(-) (limited to 'indra/newview/llsky.cpp') diff --git a/indra/newview/llsky.cpp b/indra/newview/llsky.cpp index a81e74b6ed..4ad579b33f 100644 --- a/indra/newview/llsky.cpp +++ b/indra/newview/llsky.cpp @@ -74,7 +74,6 @@ LLSky::LLSky() mLightingGeneration = 0; mUpdatedThisFrame = TRUE; - mSunPhase = 0.f; } @@ -292,27 +291,6 @@ void LLSky::init(const LLVector3 &sun_direction) gSky.setFogRatio(gSavedSettings.getF32("RenderFogRatio")); - //////////////////////////// - // - // Legacy code, ignore - // - // - - // Get the parameters. - mSunDefaultPosition = gSavedSettings.getVector3("SkySunDefaultPosition"); - - LLGLState::checkStates(); - LLGLState::checkTextureChannels(); - - if (gSavedSettings.getBOOL("SkyOverrideSimSunPosition")) - { - setSunDirection(mSunDefaultPosition, -mSunDefaultPosition); - } - else - { - setSunDirection(sun_direction, -sun_direction); - } - LLGLState::checkStates(); LLGLState::checkTextureChannels(); @@ -337,39 +315,6 @@ void LLSky::setWind(const LLVector3& average_wind) } } - -void LLSky::propagateHeavenlyBodies(F32 dt) -{ -// if (!mOverrideSimSunPosition) -// { -// LLVector3 curr_dir = getSunDirection(); -// LLVector3 diff = mSunTargDir - curr_dir; -// const F32 dist = diff.normVec(); -// if (dist > 0) -// { -// const F32 step = llmin (dist, 0.00005f); -// //const F32 step = min (dist, 0.0001); -// diff *= step; -// curr_dir += diff; -// curr_dir.normVec(); -// if (mVOSkyp) -// { -// mVOSkyp->setSunDirection(curr_dir); -// } -// } -// } -} - -F32 LLSky::getSunPhase() const -{ - return mSunPhase; -} - -void LLSky::setSunPhase(const F32 phase) -{ - mSunPhase = phase; -} - ////////////////////////////////////////////////////////////////////// // Private Methods ////////////////////////////////////////////////////////////////////// -- cgit v1.2.3 From 64302d3000b69b31e72eb6a3bd8a981c80cb88de Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Fri, 1 Jun 2018 00:18:36 +0100 Subject: Modify use of sky settings, reduce complexity, and name funcs to indicate coord systems in use. Fix class2 softenLightF shader. --- indra/newview/llsky.cpp | 157 +++--------------------------------------------- 1 file changed, 9 insertions(+), 148 deletions(-) (limited to 'indra/newview/llsky.cpp') diff --git a/indra/newview/llsky.cpp b/indra/newview/llsky.cpp index f7ccf7c7ff..41fe206ada 100644 --- a/indra/newview/llsky.cpp +++ b/indra/newview/llsky.cpp @@ -129,170 +129,31 @@ void LLSky::resetVertexBuffers() } } -void LLSky::setSunDirection(const LLVector3 &sun_direction, const LLVector3 &moon_direction) +void LLSky::setSunAndMoonDirectionsCFR(const LLVector3 &sun_direction, const LLVector3 &moon_direction) { - if(mVOSkyp.notNull()) { - mVOSkyp->setSunDirection(sun_direction, moon_direction); + if(mVOSkyp.notNull()) { + mVOSkyp->setSunAndMoonDirectionsCFR(sun_direction, moon_direction); } } -/*LLVector3 LLSky::getSunDirection() const -{ - if (mVOSkyp) - { - return mVOSkyp->getToSun(); - } - else - { - return LLVector3::z_axis; - } -} - - -LLVector3 LLSky::getMoonDirection() const -{ - if (mVOSkyp) - { - return mVOSkyp->getToMoon(); - } - else - { - return LLVector3::z_axis; - } -}*/ - - -LLColor4 LLSky::getSunDiffuseColor() const -{ - if (mVOSkyp) - { - return LLColor4(mVOSkyp->getSunDiffuseColor()); - } - else - { - return LLColor4(1.f, 1.f, 1.f, 1.f); - } -} - -LLColor4 LLSky::getSunAmbientColor() const -{ - if (mVOSkyp) - { - return LLColor4(mVOSkyp->getSunAmbientColor()); - } - else - { - return LLColor4(0.f, 0.f, 0.f, 1.f); - } -} - - -LLColor4 LLSky::getMoonDiffuseColor() const -{ - if (mVOSkyp) - { - return LLColor4(mVOSkyp->getMoonDiffuseColor()); - } - else - { - return LLColor4(1.f, 1.f, 1.f, 1.f); - } -} - -LLColor4 LLSky::getMoonAmbientColor() const -{ - if (mVOSkyp) - { - return LLColor4(mVOSkyp->getMoonAmbientColor()); - } - else - { - return LLColor4(0.f, 0.f, 0.f, 0.f); - } -} - - -LLColor4 LLSky::getTotalAmbientColor() const -{ - if (mVOSkyp) - { - return mVOSkyp->getTotalAmbientColor(); - } - else - { - return LLColor4(1.f, 1.f, 1.f, 1.f); - } -} - - -/*BOOL LLSky::sunUp() const -{ - if (mVOSkyp) - { - return mVOSkyp->isSunUp(); - } - else - { - return TRUE; - } -}*/ - - -LLColor4U LLSky::getFadeColor() const -{ - if (mVOSkyp) - { - return mVOSkyp->getFadeColor(); - } - else - { - return LLColor4(1.f, 1.f, 1.f, 1.f); - } -} - - ////////////////////////////////////////////////////////////////////// // Public Methods ////////////////////////////////////////////////////////////////////// -void LLSky::init(const LLVector3 &sun_direction) +void LLSky::init() { - LLGLState::checkStates(); - LLGLState::checkTextureChannels(); - mVOWLSkyp = static_cast(gObjectList.createObjectViewer(LLViewerObject::LL_VO_WL_SKY, NULL)); - mVOWLSkyp->initSunDirection(sun_direction, LLVector3::zero); + mVOWLSkyp->init(); gPipeline.createObject(mVOWLSkyp.get()); - LLGLState::checkStates(); - LLGLState::checkTextureChannels(); - mVOSkyp = (LLVOSky *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_SKY, NULL); - - LLGLState::checkStates(); - LLGLState::checkTextureChannels(); - - mVOSkyp->initSunDirection(sun_direction, LLVector3()); - - LLGLState::checkStates(); - LLGLState::checkTextureChannels(); - - gPipeline.createObject((LLViewerObject *)mVOSkyp); - - LLGLState::checkStates(); - LLGLState::checkTextureChannels(); + mVOSkyp->init(); + gPipeline.createObject(mVOSkyp.get()); mVOGroundp = (LLVOGround*)gObjectList.createObjectViewer(LLViewerObject::LL_VO_GROUND, NULL); - LLVOGround *groundp = mVOGroundp; - gPipeline.createObject((LLViewerObject *)groundp); - - LLGLState::checkStates(); - LLGLState::checkTextureChannels(); - - gSky.setFogRatio(gSavedSettings.getF32("RenderFogRatio")); + gPipeline.createObject(mVOGroundp.get()); - LLGLState::checkStates(); - LLGLState::checkTextureChannels(); + gSky.setFogRatio(gSavedSettings.getF32("RenderFogRatio")); mUpdatedThisFrame = TRUE; } -- cgit v1.2.3 From 507c4921826e73635f6ae31087ab0e6cd1280f43 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Fri, 8 Jun 2018 22:22:20 +0100 Subject: Add specific shader for the moon to allow different rendering at day vs night. Add MouseMoon positioning ala MouseSun debug setting and accessors to use it. --- indra/newview/llsky.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'indra/newview/llsky.cpp') diff --git a/indra/newview/llsky.cpp b/indra/newview/llsky.cpp index 41fe206ada..bb108fa6ac 100644 --- a/indra/newview/llsky.cpp +++ b/indra/newview/llsky.cpp @@ -136,6 +136,20 @@ void LLSky::setSunAndMoonDirectionsCFR(const LLVector3 &sun_direction, const LLV } } +void LLSky::setSunDirectionCFR(const LLVector3 &sun_direction) +{ + if(mVOSkyp.notNull()) { + mVOSkyp->setSunDirectionCFR(sun_direction); + } +} + +void LLSky::setMoonDirectionCFR(const LLVector3 &moon_direction) +{ + if(mVOSkyp.notNull()) { + mVOSkyp->setMoonDirectionCFR(moon_direction); + } +} + ////////////////////////////////////////////////////////////////////// // Public Methods ////////////////////////////////////////////////////////////////////// -- cgit v1.2.3 From a0598b12656cdcf22ba95cacd01b5ff36f8f1b26 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Mon, 11 Jun 2018 17:46:16 +0100 Subject: Fix water fog consolidation in underwater shaders. Add plumbing facilities to allow current and next moon textures to be passed to moon shader. Modify moon shader to blend between current and next moon textures by blend factor. --- indra/newview/llsky.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'indra/newview/llsky.cpp') diff --git a/indra/newview/llsky.cpp b/indra/newview/llsky.cpp index bb108fa6ac..6b7db9bb01 100644 --- a/indra/newview/llsky.cpp +++ b/indra/newview/llsky.cpp @@ -129,6 +129,20 @@ void LLSky::resetVertexBuffers() } } +void LLSky::setSunTextures(const LLUUID& sun_texture, const LLUUID& sun_texture_next) +{ + if(mVOSkyp.notNull()) { + mVOSkyp->setSunTextures(sun_texture, sun_texture_next); + } +} + +void LLSky::setMoonTextures(const LLUUID& moon_texture, const LLUUID& moon_texture_next) +{ + if(mVOSkyp.notNull()) { + mVOSkyp->setMoonTextures(moon_texture, moon_texture_next); + } +} + void LLSky::setSunAndMoonDirectionsCFR(const LLVector3 &sun_direction, const LLVector3 &moon_direction) { if(mVOSkyp.notNull()) { -- cgit v1.2.3 From fc8d0de673da0e02915556008a365aca67472eba Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Mon, 11 Jun 2018 22:39:57 +0100 Subject: Make cloud rendering use textures defined in sky settings and add code to shaders to lerp between current and next cloud texture. --- indra/newview/llsky.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra/newview/llsky.cpp') diff --git a/indra/newview/llsky.cpp b/indra/newview/llsky.cpp index 6b7db9bb01..5d85778da5 100644 --- a/indra/newview/llsky.cpp +++ b/indra/newview/llsky.cpp @@ -143,6 +143,13 @@ void LLSky::setMoonTextures(const LLUUID& moon_texture, const LLUUID& moon_textu } } +void LLSky::setCloudNoiseTextures(const LLUUID& cloud_noise_texture, const LLUUID& cloud_noise_texture_next) +{ + if(mVOSkyp.notNull()) { + mVOSkyp->setCloudNoiseTextures(cloud_noise_texture, cloud_noise_texture_next); + } +} + void LLSky::setSunAndMoonDirectionsCFR(const LLVector3 &sun_direction, const LLVector3 &moon_direction) { if(mVOSkyp.notNull()) { -- cgit v1.2.3 From a90e61b798711306496c2ed7aa5cce6d096ea466 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 10 Jul 2018 19:08:14 +0100 Subject: Support blending current/next bloom textures in deferred star rendering. --- indra/newview/llsky.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra/newview/llsky.cpp') diff --git a/indra/newview/llsky.cpp b/indra/newview/llsky.cpp index 5d85778da5..9c7fc225a0 100644 --- a/indra/newview/llsky.cpp +++ b/indra/newview/llsky.cpp @@ -150,6 +150,13 @@ void LLSky::setCloudNoiseTextures(const LLUUID& cloud_noise_texture, const LLUUI } } +void LLSky::setBloomTextures(const LLUUID& bloom_texture, const LLUUID& bloom_texture_next) +{ + if(mVOSkyp.notNull()) { + mVOSkyp->setBloomTextures(bloom_texture, bloom_texture_next); + } +} + void LLSky::setSunAndMoonDirectionsCFR(const LLVector3 &sun_direction, const LLVector3 &moon_direction) { if(mVOSkyp.notNull()) { -- cgit v1.2.3 From f45edabe478eb2e5ed899377f541875cbd566977 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Wed, 22 Aug 2018 23:02:16 +0100 Subject: MAINT-9026 hook up sun/moon scale to settingsvo and render code --- indra/newview/llsky.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'indra/newview/llsky.cpp') diff --git a/indra/newview/llsky.cpp b/indra/newview/llsky.cpp index 9c7fc225a0..0740878901 100644 --- a/indra/newview/llsky.cpp +++ b/indra/newview/llsky.cpp @@ -129,6 +129,22 @@ void LLSky::resetVertexBuffers() } } +void LLSky::setSunScale(F32 sun_scale) +{ + if(mVOSkyp.notNull()) + { + mVOSkyp->setSunScale(sun_scale); + } +} + +void LLSky::setMoonScale(F32 moon_scale) +{ + if(mVOSkyp.notNull()) + { + mVOSkyp->setMoonScale(moon_scale); + } +} + void LLSky::setSunTextures(const LLUUID& sun_texture, const LLUUID& sun_texture_next) { if(mVOSkyp.notNull()) { -- cgit v1.2.3 From ca336f26db4446b016ab89654bf75f7651294533 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Mon, 10 Dec 2018 17:35:29 +0200 Subject: SL-9698 [EEP] Add beacons that point to sun & moon position --- indra/newview/llsky.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'indra/newview/llsky.cpp') diff --git a/indra/newview/llsky.cpp b/indra/newview/llsky.cpp index 0740878901..71de99b4ec 100644 --- a/indra/newview/llsky.cpp +++ b/indra/newview/llsky.cpp @@ -52,7 +52,7 @@ #include "llcubemap.h" #include "llviewercontrol.h" #include "llenvironment.h" - +#include "llvoavatarself.h" #include "llvowlsky.h" F32 azimuth_from_vector(const LLVector3 &v); @@ -234,6 +234,23 @@ void LLSky::setWind(const LLVector3& average_wind) } } +void LLSky::addSunMoonBeacons() +{ + if (!gAgentAvatarp || !mVOSkyp) return; + + static LLUICachedControl show_sun_beacon("sunbeacon", false); + static LLUICachedControl show_moon_beacon("moonbeacon", false); + + if (show_sun_beacon) + { + renderSunMoonBeacons(gAgentAvatarp->getPositionAgent(), mVOSkyp->getSun().getDirection(), LLColor4(1.f, 0.5f, 0.f, 0.5f)); + } + if (show_moon_beacon) + { + renderSunMoonBeacons(gAgentAvatarp->getPositionAgent(), mVOSkyp->getMoon().getDirection(), LLColor4(1.f, 0.f, 0.8f, 0.5f)); + } +} + ////////////////////////////////////////////////////////////////////// // Private Methods ////////////////////////////////////////////////////////////////////// -- cgit v1.2.3