r.SSS.Burley.NumSamplesOverride
r.SSS.Burley.NumSamplesOverride
#Overview
name: r.SSS.Burley.NumSamplesOverride
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
When zero, Burley SSS adaptively determines the number of samples. When non-zero, this value overrides the sample count.\n
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.SSS.Burley.NumSamplesOverride is to control the number of samples used in Burley Subsurface Scattering (SSS) calculations within Unreal Engine’s rendering system. This setting variable allows developers to override the adaptive sample count determination for Burley SSS.
This setting variable is primarily used by the rendering subsystem of Unreal Engine, specifically in the post-processing stage for subsurface scattering effects. It is also utilized by the Movie Render Pipeline plugin for high-resolution rendering settings.
The value of this variable is set through the console variable system in Unreal Engine. It can be modified at runtime using console commands or through code using the CVarSSSBurleyNumSamplesOverride variable.
The associated variable CVarSSSBurleyNumSamplesOverride directly interacts with r.SSS.Burley.NumSamplesOverride. They share the same value and purpose within the engine.
Developers must be aware that:
- When set to 0 (default), the Burley SSS system adaptively determines the number of samples.
- When set to a non-zero value, it overrides the adaptive sample count with the specified value.
- Changing this value affects the quality and performance of subsurface scattering rendering.
Best practices when using this variable include:
- Leave it at 0 for most scenarios to allow adaptive sampling.
- Use non-zero values only when specific quality requirements are needed, understanding the performance implications.
- When overriding, choose a value that balances quality and performance for your specific use case.
- Consider using this in conjunction with other SSS-related settings for optimal results.
Regarding the associated variable CVarSSSBurleyNumSamplesOverride:
- It is an internal representation of the r.SSS.Burley.NumSamplesOverride console variable.
- It is used directly in the rendering code to retrieve the current value of the setting.
- Developers should use this variable when accessing the value in C++ code, rather than parsing the console variable string.
- Any changes to CVarSSSBurleyNumSamplesOverride will directly affect the behavior of the Burley SSS system.
When working with CVarSSSBurleyNumSamplesOverride, developers should:
- Use GetValueOnRenderThread() to safely access its value in render thread code.
- Be cautious about frequently changing this value, as it may impact rendering performance.
- Consider caching the value if used in performance-critical sections of code.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessSubsurface.cpp:114
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
TAutoConsoleVariable<int32> CVarSSSBurleyNumSamplesOverride(
TEXT("r.SSS.Burley.NumSamplesOverride"),
0,
TEXT("When zero, Burley SSS adaptively determines the number of samples. When non-zero, this value overrides the sample count.\n"),
ECVF_RenderThreadSafe);
TAutoConsoleVariable<int32> CVarSSSBurleyEnableProfileIdCache(
TEXT("r.SSS.Burley.EnableProfileIdCache"),
#Loc: <Workspace>/Engine/Plugins/MovieScene/MovieRenderPipeline/Source/MovieRenderPipelineCore/Public/MoviePipelineHighResSetting.h:143
Scope (from outer to inner):
file
class class UMoviePipelineHighResSetting : public UMoviePipelineSetting
function virtual void SetupForPipelineImpl
Source code excerpt:
{
int32 NumSamples = bOverrideSubSurfaceScattering ? BurleySampleCount : 0;
MOVIEPIPELINE_STORE_AND_OVERRIDE_CVAR_INT(PrevBurleyOverride, TEXT("r.SSS.Burley.NumSamplesOverride"), NumSamples, true);
}
virtual void TeardownForPipelineImpl(UMoviePipeline* InPipeline) override
{
int32 NumSamples = 0; // Dummy
MOVIEPIPELINE_STORE_AND_OVERRIDE_CVAR_INT(PrevBurleyOverride, TEXT("r.SSS.Burley.NumSamplesOverride"), NumSamples, false);
}
public:
/**
* How many tiles should the resulting movie render be broken into? A tile should be no larger than
* the maximum texture resolution supported by your graphics card (likely 16k), so NumTiles should be
#Associated Variable and Callsites
This variable is associated with another variable named CVarSSSBurleyNumSamplesOverride
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessSubsurface.cpp:113
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
);
TAutoConsoleVariable<int32> CVarSSSBurleyNumSamplesOverride(
TEXT("r.SSS.Burley.NumSamplesOverride"),
0,
TEXT("When zero, Burley SSS adaptively determines the number of samples. When non-zero, this value overrides the sample count.\n"),
ECVF_RenderThreadSafe);
TAutoConsoleVariable<int32> CVarSSSBurleyEnableProfileIdCache(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessSubsurface.cpp:255
Scope: file
Source code excerpt:
const float SSSScaleX = SSSScaleZ / SUBSURFACE_KERNEL_SIZE * 0.5f;
const float SSSOverrideNumSamples = float(CVarSSSBurleyNumSamplesOverride.GetValueOnRenderThread());
const float MinGenerateMipsTileCount = FMath::Max(0.0f, CVarSSSMipmapsMinTileCount.GetValueOnRenderThread());
FSubsurfaceParameters Parameters;
Parameters.SubsurfaceParams = FVector4f(SSSScaleX, SSSScaleZ, SSSOverrideNumSamples, MinGenerateMipsTileCount);
Parameters.ViewUniformBuffer = View.ViewUniformBuffer;
Parameters.SceneTextures = SceneTextures;