From 93260cfeff2382dd1ffeecaef208d37bf21c2a01 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 4 May 2022 16:07:50 +0000 Subject: SL-17283 LLReflectionMapManager prototype. Remove snapshot code related overhead from reflection map renders. Add parallax correction and support for multiple reflection maps. --- indra/newview/llreflectionmapmanager.h | 51 ++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 indra/newview/llreflectionmapmanager.h (limited to 'indra/newview/llreflectionmapmanager.h') diff --git a/indra/newview/llreflectionmapmanager.h b/indra/newview/llreflectionmapmanager.h new file mode 100644 index 0000000000..40e925d916 --- /dev/null +++ b/indra/newview/llreflectionmapmanager.h @@ -0,0 +1,51 @@ +/** + * @file llreflectionmapmanager.h + * @brief LLReflectionMapManager class declaration + * + * $LicenseInfo:firstyear=2022&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2022, 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$ + */ + +#pragma once + +#include "llreflectionmap.h" + +class LLReflectionMapManager +{ +public: + // allocate an environment map of the given resolution + LLReflectionMapManager(); + + // maintain reflection probes + void update(); + + // drop a reflection probe at the specified position in agent space + void addProbe(const LLVector3& pos); + + // Populate "maps" with the N most relevant Reflection Maps where N is no more than maps.size() + // If less than maps.size() ReflectionMaps are available, will assign trailing elements to nullptr. + // maps -- presized array of Reflection Map pointers + void getReflectionMaps(std::vector& maps); + + // list of active reflection maps + std::vector mProbes; +}; + -- cgit v1.2.3 From 3400e5fd302c0d9dea6386c4d5bf38876f2cc287 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 16 May 2022 17:21:08 +0000 Subject: SL-17284 Reflection probe tuning and optimization take 1 --- indra/newview/llreflectionmapmanager.h | 77 +++++++++++++++++++++++++++++++++- 1 file changed, 75 insertions(+), 2 deletions(-) (limited to 'indra/newview/llreflectionmapmanager.h') diff --git a/indra/newview/llreflectionmapmanager.h b/indra/newview/llreflectionmapmanager.h index 40e925d916..24ac40b264 100644 --- a/indra/newview/llreflectionmapmanager.h +++ b/indra/newview/llreflectionmapmanager.h @@ -27,9 +27,20 @@ #pragma once #include "llreflectionmap.h" +#include "llrendertarget.h" +#include "llcubemaparray.h" -class LLReflectionMapManager +class LLSpatialGroup; + +// number of reflection probes to keep in vram +#define LL_REFLECTION_PROBE_COUNT 256 + +// reflection probe resolution +#define LL_REFLECTION_PROBE_RESOLUTION 256 + +class alignas(16) LLReflectionMapManager { + LL_ALIGN_NEW public: // allocate an environment map of the given resolution LLReflectionMapManager(); @@ -40,12 +51,74 @@ public: // drop a reflection probe at the specified position in agent space void addProbe(const LLVector3& pos); + // add a probe for the given spatial group + LLReflectionMap* addProbe(LLSpatialGroup* group); + // Populate "maps" with the N most relevant Reflection Maps where N is no more than maps.size() // If less than maps.size() ReflectionMaps are available, will assign trailing elements to nullptr. // maps -- presized array of Reflection Map pointers void getReflectionMaps(std::vector& maps); + // called by LLSpatialGroup constructor + // If spatial group should receive a Reflection Probe, will create one for the specified spatial group + LLReflectionMap* registerSpatialGroup(LLSpatialGroup* group); + + // force an update of all probes + void rebuild(); + + // called on region crossing to "shift" probes into new coordinate frame + void shift(const LLVector4a& offset); + +private: + friend class LLPipeline; + + // delete the probe with the given index in mProbes + void deleteProbe(U32 i); + + // get a free cube index + // if no cube indices are free, free one starting from the back of the probe list + S32 allocateCubeIndex(); + + // update the neighbors of the given probe + void updateNeighbors(LLReflectionMap* probe); + + void setUniforms(); + + // render target for cube snapshots + // used to generate mipmaps without doing a copy-to-texture + LLRenderTarget mRenderTarget; + + std::vector mMipChain; + + // storage for reflection probes + LLPointer mTexture; + + // array indicating if a particular cubemap is free + bool mCubeFree[LL_REFLECTION_PROBE_COUNT]; + + // start tracking the given spatial group + void trackGroup(LLSpatialGroup* group); + + // perform an update on the currently updating Probe + void doProbeUpdate(); + // list of active reflection maps - std::vector mProbes; + std::vector > mProbes; + + // list of reflection maps to kill + std::vector > mKillList; + + // list of reflection maps to create + std::vector > mCreateList; + + // handle to UBO + U32 mUBO = 0; + + // list of maps being used for rendering + std::vector mReflectionMaps; + + LLReflectionMap* mUpdatingProbe = nullptr; + U32 mUpdatingFace = 0; + }; -- cgit v1.2.3 From 53c692c9597551c9a1ba8eee346432de51d9d22d Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 17 May 2022 14:32:07 -0500 Subject: SL-17416 Quick 'n dirty reflection probe override hack. --- indra/newview/llreflectionmapmanager.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'indra/newview/llreflectionmapmanager.h') diff --git a/indra/newview/llreflectionmapmanager.h b/indra/newview/llreflectionmapmanager.h index 24ac40b264..f7feabbf66 100644 --- a/indra/newview/llreflectionmapmanager.h +++ b/indra/newview/llreflectionmapmanager.h @@ -31,6 +31,7 @@ #include "llcubemaparray.h" class LLSpatialGroup; +class LLViewerObject; // number of reflection probes to keep in vram #define LL_REFLECTION_PROBE_COUNT 256 @@ -38,6 +39,9 @@ class LLSpatialGroup; // reflection probe resolution #define LL_REFLECTION_PROBE_RESOLUTION 256 +// reflection probe mininum scale +#define LL_REFLECTION_PROBE_MINIMUM_SCALE 1.f; + class alignas(16) LLReflectionMapManager { LL_ALIGN_NEW @@ -63,12 +67,21 @@ public: // If spatial group should receive a Reflection Probe, will create one for the specified spatial group LLReflectionMap* registerSpatialGroup(LLSpatialGroup* group); + // presently hacked into LLViewerObject::setTE + // Used by LLViewerObjects that are Reflection Probes + // Guaranteed to not return null + LLReflectionMap* registerViewerObject(LLViewerObject* vobj); + // force an update of all probes void rebuild(); // called on region crossing to "shift" probes into new coordinate frame void shift(const LLVector4a& offset); + // debug display, called from llspatialpartition if reflection + // probe debug display is active + void renderDebug(); + private: friend class LLPipeline; @@ -82,6 +95,7 @@ private: // update the neighbors of the given probe void updateNeighbors(LLReflectionMap* probe); + // update UBO used for rendering void setUniforms(); // render target for cube snapshots -- cgit v1.2.3 From 63878a60eb8ab6884ed3aeec63a28e5089636092 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 18 May 2022 23:09:57 -0500 Subject: SL-17416 Box reflection probe influence volumes --- indra/newview/llreflectionmapmanager.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'indra/newview/llreflectionmapmanager.h') diff --git a/indra/newview/llreflectionmapmanager.h b/indra/newview/llreflectionmapmanager.h index f7feabbf66..9417fe2416 100644 --- a/indra/newview/llreflectionmapmanager.h +++ b/indra/newview/llreflectionmapmanager.h @@ -52,9 +52,6 @@ public: // maintain reflection probes void update(); - // drop a reflection probe at the specified position in agent space - void addProbe(const LLVector3& pos); - // add a probe for the given spatial group LLReflectionMap* addProbe(LLSpatialGroup* group); -- cgit v1.2.3 From 096ad1306d1a5db300592d9be87ab6762777d400 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 19 May 2022 22:36:03 -0500 Subject: SL-17286 Only update reflection probe UBO once per pipe flush --- indra/newview/llreflectionmapmanager.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/newview/llreflectionmapmanager.h') diff --git a/indra/newview/llreflectionmapmanager.h b/indra/newview/llreflectionmapmanager.h index 9417fe2416..e3942beaae 100644 --- a/indra/newview/llreflectionmapmanager.h +++ b/indra/newview/llreflectionmapmanager.h @@ -92,7 +92,10 @@ private: // update the neighbors of the given probe void updateNeighbors(LLReflectionMap* probe); - // update UBO used for rendering + // update UBO used for rendering (call only once per render pipe flush) + void updateUniforms(); + + // bind UBO used for rendering void setUniforms(); // render target for cube snapshots -- cgit v1.2.3 From 6eaf8521abae0deeb1162f9c61747183110176b0 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 20 May 2022 19:05:28 -0500 Subject: SL-17287 Instrument and optimize cubemap render. Fix for cubemap snapshots doing a full resolution render instead of a 512x512 render. --- indra/newview/llreflectionmapmanager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llreflectionmapmanager.h') diff --git a/indra/newview/llreflectionmapmanager.h b/indra/newview/llreflectionmapmanager.h index e3942beaae..bf963f3486 100644 --- a/indra/newview/llreflectionmapmanager.h +++ b/indra/newview/llreflectionmapmanager.h @@ -48,7 +48,7 @@ class alignas(16) LLReflectionMapManager public: // allocate an environment map of the given resolution LLReflectionMapManager(); - + // maintain reflection probes void update(); -- cgit v1.2.3 From 509476f95ed75ce8289ecd69b4c94d9912e1d3df Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 10 Jun 2022 01:13:41 -0500 Subject: SL-17574 Add probe detail combo box to advanced graphics preferences. Fix spot light shadows not working in probes. --- indra/newview/llreflectionmapmanager.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'indra/newview/llreflectionmapmanager.h') diff --git a/indra/newview/llreflectionmapmanager.h b/indra/newview/llreflectionmapmanager.h index bf963f3486..3b5cdc5520 100644 --- a/indra/newview/llreflectionmapmanager.h +++ b/indra/newview/llreflectionmapmanager.h @@ -46,6 +46,13 @@ class alignas(16) LLReflectionMapManager { LL_ALIGN_NEW public: + enum class DetailLevel + { + STATIC_ONLY = 0, + STATIC_AND_DYNAMIC, + REALTIME = 2 + }; + // allocate an environment map of the given resolution LLReflectionMapManager(); @@ -115,6 +122,9 @@ private: // perform an update on the currently updating Probe void doProbeUpdate(); + + // update the specified face of the specified probe + void updateProbeFace(LLReflectionMap* probe, U32 face); // list of active reflection maps std::vector > mProbes; @@ -133,6 +143,5 @@ private: LLReflectionMap* mUpdatingProbe = nullptr; U32 mUpdatingFace = 0; - }; -- cgit v1.2.3 From 31e2fa5e50bc5aad265e8ec12613223eeb3ae3e1 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 21 Jun 2022 22:44:30 -0500 Subject: SL-17600 WIP -- Proper radiance maps (not just mipped cubemaps). --- indra/newview/llreflectionmapmanager.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llreflectionmapmanager.h') diff --git a/indra/newview/llreflectionmapmanager.h b/indra/newview/llreflectionmapmanager.h index 3b5cdc5520..551a461e63 100644 --- a/indra/newview/llreflectionmapmanager.h +++ b/indra/newview/llreflectionmapmanager.h @@ -29,6 +29,7 @@ #include "llreflectionmap.h" #include "llrendertarget.h" #include "llcubemaparray.h" +#include "llcubemap.h" class LLSpatialGroup; class LLViewerObject; -- cgit v1.2.3 From d0d1b832d4983f35ab29947eb6fda54a8aa48f8a Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 22 Jun 2022 13:25:50 -0500 Subject: SL-17600 Proper irradiance probes. --- indra/newview/llreflectionmapmanager.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/newview/llreflectionmapmanager.h') diff --git a/indra/newview/llreflectionmapmanager.h b/indra/newview/llreflectionmapmanager.h index 551a461e63..5f0b11ec17 100644 --- a/indra/newview/llreflectionmapmanager.h +++ b/indra/newview/llreflectionmapmanager.h @@ -39,6 +39,7 @@ class LLViewerObject; // reflection probe resolution #define LL_REFLECTION_PROBE_RESOLUTION 256 +#define LL_IRRADIANCE_MAP_RESOLUTION 64 // reflection probe mininum scale #define LL_REFLECTION_PROBE_MINIMUM_SCALE 1.f; @@ -112,9 +113,12 @@ private: std::vector mMipChain; - // storage for reflection probes + // storage for reflection probe radiance maps (plus two scratch space cubemaps) LLPointer mTexture; + // storage for reflection probe irradiance maps + LLPointer mIrradianceMaps; + // array indicating if a particular cubemap is free bool mCubeFree[LL_REFLECTION_PROBE_COUNT]; -- cgit v1.2.3 From 9c6b197b3eacabb21ba098b7d1f6017f3de34432 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 29 Aug 2022 18:46:48 -0500 Subject: SL-18037 Workaround AMD driver bug (drop reflection probe count to 16 on amd) --- indra/newview/llreflectionmapmanager.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'indra/newview/llreflectionmapmanager.h') diff --git a/indra/newview/llreflectionmapmanager.h b/indra/newview/llreflectionmapmanager.h index 5f0b11ec17..29a9ece2f8 100644 --- a/indra/newview/llreflectionmapmanager.h +++ b/indra/newview/llreflectionmapmanager.h @@ -35,7 +35,7 @@ class LLSpatialGroup; class LLViewerObject; // number of reflection probes to keep in vram -#define LL_REFLECTION_PROBE_COUNT 256 +#define LL_MAX_REFLECTION_PROBE_COUNT 256 // reflection probe resolution #define LL_REFLECTION_PROBE_RESOLUTION 256 @@ -88,6 +88,9 @@ public: // probe debug display is active void renderDebug(); + // call once at startup to allocate cubemap arrays + void initReflectionMaps(); + private: friend class LLPipeline; @@ -120,7 +123,7 @@ private: LLPointer mIrradianceMaps; // array indicating if a particular cubemap is free - bool mCubeFree[LL_REFLECTION_PROBE_COUNT]; + bool mCubeFree[LL_MAX_REFLECTION_PROBE_COUNT]; // start tracking the given spatial group void trackGroup(LLSpatialGroup* group); @@ -148,5 +151,8 @@ private: LLReflectionMap* mUpdatingProbe = nullptr; U32 mUpdatingFace = 0; + + // number of reflection probes to use for rendering (based on saved setting RenderReflectionProbeCount) + U32 mReflectionProbeCount; }; -- cgit v1.2.3 From c466e44334fd60c8270b68c70b8ae999b8dbd395 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 20 Sep 2022 19:09:26 -0500 Subject: SL-18190 Reduce banding (stay in linear space as much as possible, increase precision of reflection probes). Faster radiance and irradiance map generation. --- indra/newview/llreflectionmapmanager.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview/llreflectionmapmanager.h') diff --git a/indra/newview/llreflectionmapmanager.h b/indra/newview/llreflectionmapmanager.h index 29a9ece2f8..493f53efb8 100644 --- a/indra/newview/llreflectionmapmanager.h +++ b/indra/newview/llreflectionmapmanager.h @@ -119,6 +119,9 @@ private: // storage for reflection probe radiance maps (plus two scratch space cubemaps) LLPointer mTexture; + // vertex buffer for pushing verts to filter shaders + LLPointer mVertexBuffer; + // storage for reflection probe irradiance maps LLPointer mIrradianceMaps; -- cgit v1.2.3 From 1900df361558313f10e8b27ada03bcefd41241d9 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 4 Oct 2022 12:20:19 -0500 Subject: SL-18293, SL-18190 -- Fix for debug displays not showing up (wireframe still busted). WIP on reflection probe/PBR driven water shader. --- indra/newview/llreflectionmapmanager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llreflectionmapmanager.h') diff --git a/indra/newview/llreflectionmapmanager.h b/indra/newview/llreflectionmapmanager.h index 493f53efb8..4dcd822677 100644 --- a/indra/newview/llreflectionmapmanager.h +++ b/indra/newview/llreflectionmapmanager.h @@ -62,7 +62,7 @@ public: void update(); // add a probe for the given spatial group - LLReflectionMap* addProbe(LLSpatialGroup* group); + LLReflectionMap* addProbe(LLSpatialGroup* group = nullptr); // Populate "maps" with the N most relevant Reflection Maps where N is no more than maps.size() // If less than maps.size() ReflectionMaps are available, will assign trailing elements to nullptr. -- cgit v1.2.3 From dafa93304335c3c48042e4b5a014dea2480f253f Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 11 Oct 2022 16:33:51 -0500 Subject: SL-18190 Fix for mystery circle showing up on east side of reflection probes. Add one probe to rule them all as a fallback for pixels that aren't inside any influence volume. --- indra/newview/llreflectionmapmanager.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llreflectionmapmanager.h') diff --git a/indra/newview/llreflectionmapmanager.h b/indra/newview/llreflectionmapmanager.h index 4dcd822677..14b762998a 100644 --- a/indra/newview/llreflectionmapmanager.h +++ b/indra/newview/llreflectionmapmanager.h @@ -155,6 +155,8 @@ private: LLReflectionMap* mUpdatingProbe = nullptr; U32 mUpdatingFace = 0; + LLPointer mDefaultProbe; // default reflection probe to fall back to for pixels with no probe influences (should always be at cube index 0) + // number of reflection probes to use for rendering (based on saved setting RenderReflectionProbeCount) U32 mReflectionProbeCount; }; -- cgit v1.2.3 From de4c018499ddaebbe466fb5a8938554a2d4a3b19 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 19 Oct 2022 14:41:17 -0500 Subject: SL-18105 Hook up render pipe directly to LLTextureEntry::mGLTFMaterial and add LLViewerFetchedTextures to LLFetchedGLTFMaterial. Lower reflection probe resolution to 128x128 per side. --- indra/newview/llreflectionmapmanager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llreflectionmapmanager.h') diff --git a/indra/newview/llreflectionmapmanager.h b/indra/newview/llreflectionmapmanager.h index 14b762998a..e0a2c00db3 100644 --- a/indra/newview/llreflectionmapmanager.h +++ b/indra/newview/llreflectionmapmanager.h @@ -38,7 +38,7 @@ class LLViewerObject; #define LL_MAX_REFLECTION_PROBE_COUNT 256 // reflection probe resolution -#define LL_REFLECTION_PROBE_RESOLUTION 256 +#define LL_REFLECTION_PROBE_RESOLUTION 128 #define LL_IRRADIANCE_MAP_RESOLUTION 64 // reflection probe mininum scale -- cgit v1.2.3 From dc4f65a2ec1fdd65a77223baaadec38ba38c3bb6 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 30 Nov 2022 14:22:10 -0600 Subject: SL-18745 Fix for LLVertexBuffer assertion on shutdown. --- indra/newview/llreflectionmapmanager.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview/llreflectionmapmanager.h') diff --git a/indra/newview/llreflectionmapmanager.h b/indra/newview/llreflectionmapmanager.h index e0a2c00db3..4e2ff7c751 100644 --- a/indra/newview/llreflectionmapmanager.h +++ b/indra/newview/llreflectionmapmanager.h @@ -58,6 +58,9 @@ public: // allocate an environment map of the given resolution LLReflectionMapManager(); + // release any GL state + void cleanup(); + // maintain reflection probes void update(); -- cgit v1.2.3 From ed2b768da29f8dc4f96b463fe4d4087deab75a37 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 2 Dec 2022 09:56:42 -0600 Subject: SL-18745 Fix for assert on teleport. --- indra/newview/llreflectionmapmanager.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview/llreflectionmapmanager.h') diff --git a/indra/newview/llreflectionmapmanager.h b/indra/newview/llreflectionmapmanager.h index 4e2ff7c751..14a6c089da 100644 --- a/indra/newview/llreflectionmapmanager.h +++ b/indra/newview/llreflectionmapmanager.h @@ -97,6 +97,9 @@ public: private: friend class LLPipeline; + // initialize mCubeFree array to default values + void initCubeFree(); + // delete the probe with the given index in mProbes void deleteProbe(U32 i); -- cgit v1.2.3 From 10b8dcc497599042655dcc4037c9ae98d494bd6f Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 30 Jan 2023 18:56:19 -0600 Subject: SL-19015 Bump probe resolution back to 256 by default (drop to 128 if vram < 2GB), remove irradiance map feedback loop (one bounce, but but more stable and allows for much brighter first bounce), make sky contribution to irradiance not tint the world blue. Make irradiance that appears in radiance maps match world irradiance. --- indra/newview/llreflectionmapmanager.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'indra/newview/llreflectionmapmanager.h') diff --git a/indra/newview/llreflectionmapmanager.h b/indra/newview/llreflectionmapmanager.h index 14a6c089da..5936b26b88 100644 --- a/indra/newview/llreflectionmapmanager.h +++ b/indra/newview/llreflectionmapmanager.h @@ -38,7 +38,6 @@ class LLViewerObject; #define LL_MAX_REFLECTION_PROBE_COUNT 256 // reflection probe resolution -#define LL_REFLECTION_PROBE_RESOLUTION 128 #define LL_IRRADIANCE_MAP_RESOLUTION 64 // reflection probe mininum scale @@ -94,6 +93,9 @@ public: // call once at startup to allocate cubemap arrays void initReflectionMaps(); + // True if currently updating a radiance map, false if currently updating an irradiance map + bool isRadiancePass() { return mRadiancePass; } + private: friend class LLPipeline; @@ -161,9 +163,21 @@ private: LLReflectionMap* mUpdatingProbe = nullptr; U32 mUpdatingFace = 0; + // if true, we're generating the radiance map for the current probe, otherwise we're generating the irradiance map. + // Update sequence should be to generate the irradiance map from render of the world that has no irradiance, + // then generate the radiance map from a render of the world that includes irradiance. + // This should avoid feedback loops and ensure that the colors in the radiance maps match the colors in the environment. + bool mRadiancePass = false; + LLPointer mDefaultProbe; // default reflection probe to fall back to for pixels with no probe influences (should always be at cube index 0) // number of reflection probes to use for rendering (based on saved setting RenderReflectionProbeCount) U32 mReflectionProbeCount; + + // resolution of reflection probes + U32 mProbeResolution = 128; + + // maximum LoD of reflection probes (mip levels - 1) + F32 mMaxProbeLOD = 6.f; }; -- cgit v1.2.3 From 4259ea79535e88ef6d8ec8415c53c28d0c2d89ac Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 3 Feb 2023 11:34:11 -0600 Subject: SL-19150 Fix for stuttering real-time reflection probes. --- indra/newview/llreflectionmapmanager.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/newview/llreflectionmapmanager.h') diff --git a/indra/newview/llreflectionmapmanager.h b/indra/newview/llreflectionmapmanager.h index 5936b26b88..85f428d75b 100644 --- a/indra/newview/llreflectionmapmanager.h +++ b/indra/newview/llreflectionmapmanager.h @@ -169,6 +169,11 @@ private: // This should avoid feedback loops and ensure that the colors in the radiance maps match the colors in the environment. bool mRadiancePass = false; + // same as above, but for the realtime probe. + // Realtime probes should update all six sides of the irradiance map on "odd" frames and all six sides of the + // radiance map on "even" frames. + bool mRealtimeRadiancePass = false; + LLPointer mDefaultProbe; // default reflection probe to fall back to for pixels with no probe influences (should always be at cube index 0) // number of reflection probes to use for rendering (based on saved setting RenderReflectionProbeCount) -- cgit v1.2.3 From 19f7497d9a01731cbd82be4b522d8b879cdcb8a0 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 21 Feb 2023 20:42:25 -0600 Subject: DRTVWR-559 WIP -- occlusion culling for reflection probes -- has a defect for objects close to the camera at some angles and leaks query objects, will follow up. --- indra/newview/llreflectionmapmanager.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview/llreflectionmapmanager.h') diff --git a/indra/newview/llreflectionmapmanager.h b/indra/newview/llreflectionmapmanager.h index 85f428d75b..fef308541d 100644 --- a/indra/newview/llreflectionmapmanager.h +++ b/indra/newview/llreflectionmapmanager.h @@ -96,6 +96,9 @@ public: // True if currently updating a radiance map, false if currently updating an irradiance map bool isRadiancePass() { return mRadiancePass; } + // perform occlusion culling on all active reflection probes + void doOcclusion(); + private: friend class LLPipeline; -- cgit v1.2.3 From 1f79379bf215c5368337c64b4f72c7c9ef3e09c2 Mon Sep 17 00:00:00 2001 From: RunitaiLinden Date: Wed, 5 Apr 2023 11:55:51 -0500 Subject: SL-19538 Followup -- tune exposure parameters and clamp local light ambiance. Make render targets 16F and scrube NaNs (thanks Rye). Update midday. (#154) --- indra/newview/llreflectionmapmanager.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview/llreflectionmapmanager.h') diff --git a/indra/newview/llreflectionmapmanager.h b/indra/newview/llreflectionmapmanager.h index fef308541d..9a46af58b3 100644 --- a/indra/newview/llreflectionmapmanager.h +++ b/indra/newview/llreflectionmapmanager.h @@ -187,5 +187,8 @@ private: // maximum LoD of reflection probes (mip levels - 1) F32 mMaxProbeLOD = 6.f; + + // amount to scale local lights during an irradiance map update (set during updateProbeFace and used by LLPipeline) + F32 mLightScale = 1.f; }; -- cgit v1.2.3 From 413ce656c8e910bf3758afc3fa354e07be2d4561 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 7 Apr 2023 14:10:53 -0500 Subject: SL-19538 Clear probes on sky setting slam. Better probe update prioritization. Incidental decruft. --- indra/newview/llreflectionmapmanager.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'indra/newview/llreflectionmapmanager.h') diff --git a/indra/newview/llreflectionmapmanager.h b/indra/newview/llreflectionmapmanager.h index 9a46af58b3..066b1e380f 100644 --- a/indra/newview/llreflectionmapmanager.h +++ b/indra/newview/llreflectionmapmanager.h @@ -80,8 +80,8 @@ public: // Guaranteed to not return null LLReflectionMap* registerViewerObject(LLViewerObject* vobj); - // force an update of all probes - void rebuild(); + // reset all state on the next update + void reset(); // called on region crossing to "shift" probes into new coordinate frame void shift(const LLVector4a& offset); @@ -190,5 +190,8 @@ private: // amount to scale local lights during an irradiance map update (set during updateProbeFace and used by LLPipeline) F32 mLightScale = 1.f; + + // if true, reset all probe render state on the next update (for teleports and sky changes) + bool mReset = false; }; -- cgit v1.2.3 From 37eee397b70e2a13a1309025207d1c301f7070c5 Mon Sep 17 00:00:00 2001 From: RunitaiLinden Date: Tue, 18 Apr 2023 19:11:38 -0500 Subject: DRTVWR-559 Add control for automatic reflection probes to advanced preferences and featuretable. Remove Reflections checkbox. Don't persist reflection probe volume display between sessions. Incidental decruft. --- indra/newview/llreflectionmapmanager.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llreflectionmapmanager.h') diff --git a/indra/newview/llreflectionmapmanager.h b/indra/newview/llreflectionmapmanager.h index 066b1e380f..234bde51a8 100644 --- a/indra/newview/llreflectionmapmanager.h +++ b/indra/newview/llreflectionmapmanager.h @@ -77,6 +77,7 @@ public: // presently hacked into LLViewerObject::setTE // Used by LLViewerObjects that are Reflection Probes + // vobj must not be null // Guaranteed to not return null LLReflectionMap* registerViewerObject(LLViewerObject* vobj); -- cgit v1.2.3 From 5d862c994c18b155bc761fa16dd4070281a1345e Mon Sep 17 00:00:00 2001 From: RunitaiLinden Date: Tue, 25 Apr 2023 14:48:16 -0500 Subject: DRTVWR-559 Optimization pass on probe allocation and search. Incidental decruft. --- indra/newview/llreflectionmapmanager.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'indra/newview/llreflectionmapmanager.h') diff --git a/indra/newview/llreflectionmapmanager.h b/indra/newview/llreflectionmapmanager.h index 234bde51a8..c0618de410 100644 --- a/indra/newview/llreflectionmapmanager.h +++ b/indra/newview/llreflectionmapmanager.h @@ -110,7 +110,7 @@ private: void deleteProbe(U32 i); // get a free cube index - // if no cube indices are free, free one starting from the back of the probe list + // returns -1 if allocation failed S32 allocateCubeIndex(); // update the neighbors of the given probe @@ -137,12 +137,9 @@ private: // storage for reflection probe irradiance maps LLPointer mIrradianceMaps; - // array indicating if a particular cubemap is free - bool mCubeFree[LL_MAX_REFLECTION_PROBE_COUNT]; + // list of free cubemap indices + std::list mCubeFree; - // start tracking the given spatial group - void trackGroup(LLSpatialGroup* group); - // perform an update on the currently updating Probe void doProbeUpdate(); -- cgit v1.2.3 From 46e04fe273ce88c52c08a6417a01ec89bd4e89e9 Mon Sep 17 00:00:00 2001 From: RunitaiLinden Date: Tue, 23 May 2023 16:11:43 -0500 Subject: DRTVWR-559 Remove RenderReflectionProbeCount (which is bugged) and lean on RenderReflectionProbeLevel for preferences (which works). --- indra/newview/llreflectionmapmanager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llreflectionmapmanager.h') diff --git a/indra/newview/llreflectionmapmanager.h b/indra/newview/llreflectionmapmanager.h index c0618de410..5a3901cae9 100644 --- a/indra/newview/llreflectionmapmanager.h +++ b/indra/newview/llreflectionmapmanager.h @@ -177,7 +177,7 @@ private: LLPointer mDefaultProbe; // default reflection probe to fall back to for pixels with no probe influences (should always be at cube index 0) - // number of reflection probes to use for rendering (based on saved setting RenderReflectionProbeCount) + // number of reflection probes to use for rendering U32 mReflectionProbeCount; // resolution of reflection probes -- cgit v1.2.3 From bc4e90ea5e462662f90c860d69aaa53b88f189c5 Mon Sep 17 00:00:00 2001 From: RunitaiLinden Date: Mon, 2 Oct 2023 14:19:04 -0500 Subject: SL-20124 Wipe reflection probes when applying parcel EEP settings and pause updates on probes until transition completes. --- indra/newview/llreflectionmapmanager.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'indra/newview/llreflectionmapmanager.h') diff --git a/indra/newview/llreflectionmapmanager.h b/indra/newview/llreflectionmapmanager.h index 5a3901cae9..b77a33da89 100644 --- a/indra/newview/llreflectionmapmanager.h +++ b/indra/newview/llreflectionmapmanager.h @@ -84,6 +84,12 @@ public: // reset all state on the next update void reset(); + // pause all updates other than the default probe + void pause(); + + // unpause (see pause) + void resume(); + // called on region crossing to "shift" probes into new coordinate frame void shift(const LLVector4a& offset); @@ -191,5 +197,8 @@ private: // if true, reset all probe render state on the next update (for teleports and sky changes) bool mReset = false; + + // if true, only update the default probe + bool mPaused = false; }; -- cgit v1.2.3