summaryrefslogtreecommitdiff
path: root/indra/newview/pipeline.cpp
diff options
context:
space:
mode:
authorJonathan "Geenz" Goodman <geenz@lindenlab.com>2023-06-15 09:33:20 -0700
committerGitHub <noreply@github.com>2023-06-15 09:33:20 -0700
commit44f26248ec668635b5d5b161f4736a670d364792 (patch)
treeefa26f27eac0b6d1a83a9e25a5396efa7cb0e637 /indra/newview/pipeline.cpp
parent3305fbe1cf5fe3faa6dc5479aa29e6c891ee943f (diff)
parent07aed1e18646fa788ad79320aaa3e2ff3c7a3f60 (diff)
Merge pull request #245 from secondlife/DRTVWR-583-glossy-ssr
Performance and visual tuning of glossy SSR
Diffstat (limited to 'indra/newview/pipeline.cpp')
-rw-r--r--indra/newview/pipeline.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index c88b8b42ff..38f27d4dfa 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -195,6 +195,7 @@ S32 LLPipeline::RenderScreenSpaceReflectionIterations;
F32 LLPipeline::RenderScreenSpaceReflectionRayStep;
F32 LLPipeline::RenderScreenSpaceReflectionDistanceBias;
F32 LLPipeline::RenderScreenSpaceReflectionDepthRejectBias;
+F32 LLPipeline::RenderScreenSpaceReflectionAdaptiveStepMultiplier;
S32 LLPipeline::RenderScreenSpaceReflectionGlossySamples;
S32 LLPipeline::RenderBufferVisualization;
LLTrace::EventStatHandle<S64> LLPipeline::sStatBatchSize("renderbatchsize");
@@ -334,6 +335,7 @@ LLPipeline::LLPipeline() :
mTextureMatrixOps(0),
mNumVisibleNodes(0),
mNumVisibleFaces(0),
+ mPoissonOffset(0),
mInitialized(false),
mShadersLoaded(false),
@@ -552,7 +554,8 @@ void LLPipeline::init()
connectRefreshCachedSettingsSafe("RenderScreenSpaceReflectionRayStep");
connectRefreshCachedSettingsSafe("RenderScreenSpaceReflectionDistanceBias");
connectRefreshCachedSettingsSafe("RenderScreenSpaceReflectionDepthRejectBias");
- connectRefreshCachedSettingsSafe("RenderScreenSpaceReflectionsGlossySamples");
+ connectRefreshCachedSettingsSafe("RenderScreenSpaceReflectionAdaptiveStepMultiplier");
+ connectRefreshCachedSettingsSafe("RenderScreenSpaceReflectionGlossySamples");
connectRefreshCachedSettingsSafe("RenderBufferVisualization");
gSavedSettings.getControl("RenderAutoHideSurfaceAreaLimit")->getCommitSignal()->connect(boost::bind(&LLPipeline::refreshCachedSettings));
}
@@ -1039,6 +1042,7 @@ void LLPipeline::refreshCachedSettings()
RenderScreenSpaceReflectionRayStep = gSavedSettings.getF32("RenderScreenSpaceReflectionRayStep");
RenderScreenSpaceReflectionDistanceBias = gSavedSettings.getF32("RenderScreenSpaceReflectionDistanceBias");
RenderScreenSpaceReflectionDepthRejectBias = gSavedSettings.getF32("RenderScreenSpaceReflectionDepthRejectBias");
+ RenderScreenSpaceReflectionAdaptiveStepMultiplier = gSavedSettings.getF32("RenderScreenSpaceReflectionAdaptiveStepMultiplier");
RenderScreenSpaceReflectionGlossySamples = gSavedSettings.getS32("RenderScreenSpaceReflectionGlossySamples");
RenderBufferVisualization = gSavedSettings.getS32("RenderBufferVisualization");
sReflectionProbesEnabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderReflectionsEnabled") && gSavedSettings.getBOOL("RenderReflectionsEnabled");
@@ -8436,6 +8440,13 @@ void LLPipeline::bindReflectionProbes(LLGLSLShader& shader)
shader.uniform1f(LLShaderMgr::DEFERRED_SSR_RAY_STEP, RenderScreenSpaceReflectionRayStep);
shader.uniform1f(LLShaderMgr::DEFERRED_SSR_GLOSSY_SAMPLES, RenderScreenSpaceReflectionGlossySamples);
shader.uniform1f(LLShaderMgr::DEFERRED_SSR_REJECT_BIAS, RenderScreenSpaceReflectionDepthRejectBias);
+ mPoissonOffset++;
+
+ if (mPoissonOffset > 128 - RenderScreenSpaceReflectionGlossySamples)
+ mPoissonOffset = 0;
+
+ shader.uniform1f(LLShaderMgr::DEFERRED_SSR_NOISE_SINE, mPoissonOffset);
+ shader.uniform1f(LLShaderMgr::DEFERRED_SSR_ADAPTIVE_STEP_MULT, RenderScreenSpaceReflectionAdaptiveStepMultiplier);
channel = shader.enableTexture(LLShaderMgr::SCENE_DEPTH);
if (channel > -1)