summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/app_settings/settings.xml11
-rw-r--r--indra/newview/app_settings/shaders/class3/environment/waterF.glsl3
-rw-r--r--indra/newview/featuretable.txt10
-rw-r--r--indra/newview/featuretable_mac.txt10
-rw-r--r--indra/newview/llreflectionmapmanager.cpp90
-rw-r--r--indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml45
6 files changed, 131 insertions, 38 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 4ce7e0f729..b7127adc53 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -9087,6 +9087,17 @@
<key>Value</key>
<integer>1</integer>
</map>
+ <key>RenderReflectionProbeDynamicAllocation</key>
+ <map>
+ <key>Comment</key>
+ <string>Enable dynamic allocation of reflection probes. -1 means no dynamic allocation. Sets a buffer to allocate when a dynamic allocation occurs otherwise.</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>S32</string>
+ <key>Value</key>
+ <integer>-1</integer>
+ </map>
<key>RenderReflectionProbeCount</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/app_settings/shaders/class3/environment/waterF.glsl b/indra/newview/app_settings/shaders/class3/environment/waterF.glsl
index 1b7b0c1937..e57aa69731 100644
--- a/indra/newview/app_settings/shaders/class3/environment/waterF.glsl
+++ b/indra/newview/app_settings/shaders/class3/environment/waterF.glsl
@@ -26,6 +26,7 @@
// class3/environment/waterF.glsl
#define WATER_MINIMAL 1
+#define SHORELINE_FADE 1
out vec4 frag_color;
@@ -264,7 +265,7 @@ void main()
// Calculate some distance fade in the water to better assist with refraction blending and reducing the refraction texture's "disconnect".
#ifdef SHORELINE_FADE
- fade = max(0,min(1, (pos.z - refPos.z) / 10))
+ fade = max(0,min(1, (pos.z - refPos.z) / 10));
#else
fade = 1 * water_mask;
#endif
diff --git a/indra/newview/featuretable.txt b/indra/newview/featuretable.txt
index 443a7ae914..c0009d24ee 100644
--- a/indra/newview/featuretable.txt
+++ b/indra/newview/featuretable.txt
@@ -86,6 +86,7 @@ RenderTonemapType 1 1
RenderTonemapMix 1 1
RenderDisableVintageMode 1 1
RenderMaxTextureResolution 1 2048
+RenderReflectionProbeCount 1 256
//
// Low Graphics Settings
@@ -128,6 +129,7 @@ RenderTonemapType 1 1
RenderTonemapMix 1 0.7
RenderDisableVintageMode 1 0
RenderMaxTextureResolution 1 512
+RenderReflectionProbeCount 1 1
//
// Medium Low Graphics Settings
@@ -170,6 +172,7 @@ RenderTonemapType 1 1
RenderTonemapMix 1 0.7
RenderDisableVintageMode 1 0
RenderMaxTextureResolution 1 1024
+RenderReflectionProbeCount 1 32
//
// Medium Graphics Settings (standard)
@@ -211,6 +214,7 @@ RenderExposure 1 1
RenderTonemapType 1 1
RenderTonemapMix 1 0.7
RenderMaxTextureResolution 1 2048
+RenderReflectionProbeCount 1 64
//
// Medium High Graphics Settings
@@ -252,6 +256,7 @@ RenderExposure 1 1
RenderTonemapType 1 1
RenderTonemapMix 1 0.7
RenderMaxTextureResolution 1 2048
+RenderReflectionProbeCount 1 64
//
// High Graphics Settings (SSAO + sun shadows)
@@ -293,6 +298,7 @@ RenderExposure 1 1
RenderTonemapType 1 1
RenderTonemapMix 1 0.7
RenderMaxTextureResolution 1 2048
+RenderReflectionProbeCount 1 128
//
// High Ultra Graphics Settings (deferred + SSAO + all shadows)
@@ -334,6 +340,7 @@ RenderExposure 1 1
RenderTonemapType 1 1
RenderTonemapMix 1 0.7
RenderMaxTextureResolution 1 2048
+RenderReflectionProbeCount 1 256
//
// Ultra graphics (REALLY PURTY!)
@@ -375,6 +382,7 @@ RenderExposure 1 1
RenderTonemapType 1 1
RenderTonemapMix 1 0.7
RenderMaxTextureResolution 1 2048
+RenderReflectionProbeCount 1 256
//
// Class Unknown Hardware (unknown)
@@ -408,6 +416,7 @@ RenderReflectionProbeDetail 0 -1
RenderMirrors 0 0
RenderDisableVintageMode 1 0
RenderMaxTextureResolution 1 2048
+RenderReflectionProbeCount 0 0
list Intel
RenderAnisotropic 1 0
@@ -429,6 +438,7 @@ RenderMirrors 0 0
RenderGLMultiThreadedTextures 0 0
RenderGLMultiThreadedMedia 0 0
RenderDisableVintageMode 1 0
+RenderReflectionProbeCount 0 0
list TexUnit16orLess
RenderTerrainPBRDetail 1 -1
diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt
index dc9473b042..5940d1ec12 100644
--- a/indra/newview/featuretable_mac.txt
+++ b/indra/newview/featuretable_mac.txt
@@ -86,6 +86,7 @@ RenderTonemapMix 1 1
RenderDisableVintageMode 1 1
RenderDownScaleMethod 1 0
RenderMaxTextureResolution 1 2048
+RenderReflectionProbeCount 1 256
//
// Low Graphics Settings
@@ -128,6 +129,7 @@ RenderTonemapType 1 1
RenderTonemapMix 1 0.7
RenderDisableVintageMode 1 0
RenderMaxTextureResolution 1 512
+RenderReflectionProbeCount 1 1
//
// Medium Low Graphics Settings
@@ -170,6 +172,7 @@ RenderTonemapType 1 1
RenderTonemapMix 1 0.7
RenderDisableVintageMode 1 0
RenderMaxTextureResolution 1 1024
+RenderReflectionProbeCount 1 32
//
// Medium Graphics Settings (standard)
@@ -211,6 +214,7 @@ RenderExposure 1 1
RenderTonemapType 1 1
RenderTonemapMix 1 0.7
RenderMaxTextureResolution 1 2048
+RenderReflectionProbeCount 1 64
//
// Medium High Graphics Settings
@@ -252,6 +256,7 @@ RenderExposure 1 1
RenderTonemapType 1 1
RenderTonemapMix 1 0.7
RenderMaxTextureResolution 1 2048
+RenderReflectionProbeCount 1 64
//
// High Graphics Settings (SSAO + sun shadows)
@@ -293,6 +298,7 @@ RenderExposure 1 1
RenderTonemapType 1 1
RenderTonemapMix 1 0.7
RenderMaxTextureResolution 1 2048
+RenderReflectionProbeCount 1 128
//
// High Ultra Graphics Settings (SSAO + all shadows)
@@ -334,6 +340,7 @@ RenderExposure 1 1
RenderTonemapType 1 1
RenderTonemapMix 1 0.7
RenderMaxTextureResolution 1 2048
+RenderReflectionProbeCount 1 256
//
// Ultra graphics (REALLY PURTY!)
@@ -375,6 +382,7 @@ RenderExposure 1 1
RenderTonemapType 1 1
RenderTonemapMix 1 0.7
RenderMaxTextureResolution 1 2048
+RenderReflectionProbeCount 1 256
//
// Class Unknown Hardware (unknown)
@@ -407,6 +415,7 @@ RenderShadowDetail 0 0
RenderMirrors 0 0
RenderDisableVintageMode 1 0
RenderMaxTextureResolution 1 2048
+RenderReflectionProbeCount 0 0
list TexUnit8orLess
RenderDeferredSSAO 0 0
@@ -447,6 +456,7 @@ RenderReflectionProbeDetail 0 0
RenderReflectionsEnabled 0 0
RenderMirrors 0 0
RenderDisableVintageMode 1 0
+RenderReflectionProbeCount 0 0
list VaryingVectors16orLess
RenderTerrainPBRPlanarSampleCount 1 1
diff --git a/indra/newview/llreflectionmapmanager.cpp b/indra/newview/llreflectionmapmanager.cpp
index 34c6034e9e..f2abc7b8b7 100644
--- a/indra/newview/llreflectionmapmanager.cpp
+++ b/indra/newview/llreflectionmapmanager.cpp
@@ -224,48 +224,54 @@ void LLReflectionMapManager::update()
static LLCachedControl<S32> sDetail(gSavedSettings, "RenderReflectionProbeDetail", -1);
static LLCachedControl<S32> sLevel(gSavedSettings, "RenderReflectionProbeLevel", 3);
+ static LLCachedControl<U32> sReflectionProbeCount(gSavedSettings, "RenderReflectionProbeCount", 256U);
+ static LLCachedControl<S32> sProbeDynamicAllocation(gSavedSettings, "RenderReflectionProbeDynamicAllocation", -1);
+ mResetFade = llmin((F32)(mResetFade + gFrameIntervalSeconds * 2.f), 1.f);
- // Once every 20 frames, update the dynamic probe count.
- if (gFrameCount % 20)
{
U32 probe_count_temp = mDynamicProbeCount;
- if (sLevel == 0)
- {
- mDynamicProbeCount = 1;
- }
- else if (sLevel == 1)
+ if (sProbeDynamicAllocation > -1)
{
- mDynamicProbeCount = (U32)mProbes.size();
+ if (sLevel == 0)
+ {
+ mDynamicProbeCount = 1;
+ }
+ else if (sLevel == 1)
+ {
+ mDynamicProbeCount = (U32)mProbes.size();
+ }
+ else if (sLevel == 2)
+ {
+ mDynamicProbeCount = llmax((U32)mProbes.size(), 128);
+ }
+ else
+ {
+ mDynamicProbeCount = 256;
+ }
- }
- else if (sLevel == 2)
- {
- mDynamicProbeCount = llmax((U32)mProbes.size(), 128);
+ if (sProbeDynamicAllocation > 1)
+ {
+ // Round mDynamicProbeCount to the nearest increment of 16
+ mDynamicProbeCount = ((mDynamicProbeCount + sProbeDynamicAllocation / 2) / sProbeDynamicAllocation) * 16;
+ mDynamicProbeCount = llclamp(mDynamicProbeCount, 1, sReflectionProbeCount);
+ }
+ else
+ {
+ mDynamicProbeCount = llclamp(mDynamicProbeCount + sProbeDynamicAllocation, 1, sReflectionProbeCount);
+ }
}
else
{
- mDynamicProbeCount = 256;
+ mDynamicProbeCount = sReflectionProbeCount;
}
- // Round mDynamicProbeCount to the nearest increment of 32
- mDynamicProbeCount = ((mDynamicProbeCount + 16) / 32) * 32;
- mDynamicProbeCount = llclamp(mDynamicProbeCount, 1, LL_MAX_REFLECTION_PROBE_COUNT);
+ mDynamicProbeCount = llmin(mDynamicProbeCount, LL_MAX_REFLECTION_PROBE_COUNT);
- if (mDynamicProbeCount < probe_count_temp * 1.1 && mDynamicProbeCount > probe_count_temp * 0.9)
- mDynamicProbeCount = probe_count_temp;
- else
- mGlobalFadeTarget = 0.f;
+ if (mDynamicProbeCount != probe_count_temp)
+ mResetFade = 1.f;
}
- if (mGlobalFadeTarget < mResetFade)
- mResetFade = llmax(mGlobalFadeTarget, mResetFade - (F32)gFrameIntervalSeconds * 2);
- else
- mResetFade = llmin(mGlobalFadeTarget, mResetFade + (F32)gFrameIntervalSeconds * 2);
-
- if (mResetFade == mGlobalFadeTarget)
- {
- initReflectionMaps();
- }
+ initReflectionMaps();
static LLCachedControl<bool> render_hdr(gSavedSettings, "RenderHDREnabled", true);
@@ -356,6 +362,7 @@ void LLReflectionMapManager::update()
probe->mCubeArray = nullptr;
probe->mCubeIndex = -1;
probe->mComplete = false;
+ probe->mFadeIn = 0;
}
}
@@ -1418,8 +1425,6 @@ void LLReflectionMapManager::initReflectionMaps()
}
gEXRImage = nullptr;
- mGlobalFadeTarget = 1.f;
- mResetFade = -0.125f;
mReset = false;
mReflectionProbeCount = mDynamicProbeCount;
mProbeResolution = probe_resolution;
@@ -1429,15 +1434,25 @@ void LLReflectionMapManager::initReflectionMaps()
mTexture->getWidth() != mProbeResolution ||
mReflectionProbeCount + 2 != mTexture->getCount())
{
- mTexture = new LLCubeMapArray();
+ if (mTexture)
+ {
+ mTexture = new LLCubeMapArray(*mTexture, mProbeResolution, mReflectionProbeCount + 2);
- static LLCachedControl<bool> render_hdr(gSavedSettings, "RenderHDREnabled", true);
+ mIrradianceMaps = new LLCubeMapArray(*mIrradianceMaps, LL_IRRADIANCE_MAP_RESOLUTION, mReflectionProbeCount);
+ }
+ else
+ {
+ mTexture = new LLCubeMapArray();
+
+ static LLCachedControl<bool> render_hdr(gSavedSettings, "RenderHDREnabled", true);
- // store mReflectionProbeCount+2 cube maps, final two cube maps are used for render target and radiance map generation source)
- mTexture->allocate(mProbeResolution, 3, mReflectionProbeCount + 2, true, render_hdr);
+ // store mReflectionProbeCount+2 cube maps, final two cube maps are used for render target and radiance map generation
+ // source)
+ mTexture->allocate(mProbeResolution, 3, mReflectionProbeCount + 2, true, render_hdr);
- mIrradianceMaps = new LLCubeMapArray();
- mIrradianceMaps->allocate(LL_IRRADIANCE_MAP_RESOLUTION, 3, mReflectionProbeCount, false, render_hdr);
+ mIrradianceMaps = new LLCubeMapArray();
+ mIrradianceMaps->allocate(LL_IRRADIANCE_MAP_RESOLUTION, 3, mReflectionProbeCount, false, render_hdr);
+ }
}
// reset probe state
@@ -1457,6 +1472,7 @@ void LLReflectionMapManager::initReflectionMaps()
probe->mCubeArray = nullptr;
probe->mCubeIndex = -1;
probe->mNeighbors.clear();
+ probe->mFadeIn = 0;
}
mCubeFree.clear();
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 78d13293a8..6877ce6411 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
@@ -858,6 +858,51 @@
value="3"/>
</combo_box>
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="16"
+ layout="topleft"
+ left="420"
+ name="ReflectionProbeCount"
+ text_readonly_color="LabelDisabledColor"
+ top_delta="22"
+ width="128">
+ Max Reflection Probes:
+ </text>
+
+ <combo_box
+ control_name="RenderReflectionProbeCount"
+ height="18"
+ layout="topleft"
+ label="Max. Reflection Probes:"
+ left_delta="130"
+ top_delta="0"
+ name="ProbeCount"
+ width="150">
+ <combo_box.item
+ label="None"
+ name="1"
+ value="1"/>
+ <combo_box.item
+ label="Low"
+ name="32"
+ value="32"/>
+ <combo_box.item
+ label="Medium"
+ name="64"
+ value="64"/>
+ <combo_box.item
+ label="High"
+ name="128"
+ value="128"/>
+ <combo_box.item
+ label="Ultra"
+ name="256"
+ value="256"/>
+ </combo_box>
+
<slider
control_name="RenderExposure"
decimal_digits="1"