r.SSS.SampleSet

r.SSS.SampleSet

#Overview

name: r.SSS.SampleSet

The value of this variable can be defined or overridden in .ini config files. 5 .ini config files referencing this setting variable.

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of r.SSS.SampleSet is to control the quality of the Separable Screenspace Subsurface Scattering (SSS) feature in Unreal Engine’s rendering system. It determines the number of samples used in the SSS calculation, which directly affects the visual quality and performance of the subsurface scattering effect.

This setting variable is primarily used by the rendering system, specifically the post-processing subsystem responsible for subsurface scattering effects. Based on the callsite information, it’s part of the Renderer module in Unreal Engine.

The value of this variable is set through the console variable system. It’s defined as a TAutoConsoleVariable with a default value of 2, which corresponds to the high quality setting (13*2+1 samples).

The associated variable CVarSSSSampleSet interacts directly with r.SSS.SampleSet. It’s the actual console variable object that stores and provides access to the value set by r.SSS.SampleSet.

Developers should be aware that:

  1. This variable has a significant impact on rendering quality and performance.
  2. It’s marked as render thread safe and scalable, meaning it can be adjusted at runtime and potentially automated based on performance metrics.
  3. There are three preset quality levels (0, 1, 2) corresponding to low, medium, and high quality respectively.

Best practices when using this variable include:

  1. Consider the target hardware when setting this value. Higher values provide better quality but at a performance cost.
  2. Use the scalability options to automatically adjust this setting based on the user’s hardware capabilities.
  3. If manually adjusting, test thoroughly to ensure a good balance between visual quality and performance.

Regarding the associated variable CVarSSSSampleSet:

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseScalability.ini:620, section: [EffectsQuality@0]

Location: <Workspace>/Engine/Config/BaseScalability.ini:647, section: [EffectsQuality@1]

Location: <Workspace>/Engine/Config/BaseScalability.ini:674, section: [EffectsQuality@2]

Location: <Workspace>/Engine/Config/BaseScalability.ini:701, section: [EffectsQuality@3]

Location: <Workspace>/Engine/Config/BaseScalability.ini:729, section: [EffectsQuality@Cine]

#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:70

Scope (from outer to inner):

file
namespace    anonymous

Source code excerpt:


	TAutoConsoleVariable<int32> CVarSSSSampleSet(
		TEXT("r.SSS.SampleSet"),
		2,
		TEXT("Defines how many samples we use for Separable Screenspace Subsurface Scattering feature.\n")
		TEXT(" 0: lowest quality (6*2+1)\n")
		TEXT(" 1: medium quality (9*2+1)\n")
		TEXT(" 2: high quality (13*2+1) (default)"),
		ECVF_RenderThreadSafe | ECVF_Scalability);

#Associated Variable and Callsites

This variable is associated with another variable named CVarSSSSampleSet. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessSubsurface.cpp:69

Scope (from outer to inner):

file
namespace    anonymous

Source code excerpt:

		ECVF_RenderThreadSafe | ECVF_Scalability);

	TAutoConsoleVariable<int32> CVarSSSSampleSet(
		TEXT("r.SSS.SampleSet"),
		2,
		TEXT("Defines how many samples we use for Separable Screenspace Subsurface Scattering feature.\n")
		TEXT(" 0: lowest quality (6*2+1)\n")
		TEXT(" 1: medium quality (9*2+1)\n")
		TEXT(" 2: high quality (13*2+1) (default)"),

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessSubsurface.cpp:194

Scope (from outer to inner):

file
function     int32 GetSSSSampleSet

Source code excerpt:

int32 GetSSSSampleSet()
{
	return CVarSSSSampleSet.GetValueOnRenderThread();
}

int32 GetSSSQuality()
{
	return CVarSSSQuality.GetValueOnRenderThread();
}