r.SSProfilesPreIntegratedTextureResolution

r.SSProfilesPreIntegratedTextureResolution

#Overview

name: r.SSProfilesPreIntegratedTextureResolution

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.SSProfilesPreIntegratedTextureResolution is to control the resolution of the subsurface profile preintegrated texture in Unreal Engine’s rendering system.

This setting variable is primarily used in the rendering subsystem of Unreal Engine, specifically for subsurface scattering (SSS) profiles. It is defined in the SubsurfaceProfile.cpp file, which is part of the Engine module.

The value of this variable is set through the console variable system in Unreal Engine. It’s initialized with a default value of 64, but can be changed at runtime using console commands or through project settings.

The associated variable CVarSSProfilesPreIntegratedTextureResolution directly interacts with r.SSProfilesPreIntegratedTextureResolution. They share the same value and purpose.

Developers must be aware that this variable affects the quality and performance of subsurface scattering rendering. A higher resolution will result in better quality but may impact performance, while a lower resolution might improve performance at the cost of visual fidelity.

Best practices when using this variable include:

  1. Adjusting it based on the specific needs of your project, balancing between quality and performance.
  2. Testing different values to find the optimal resolution for your specific use case.
  3. Considering the target hardware when setting this value, as higher resolutions may be more demanding on less powerful systems.

Regarding the associated variable CVarSSProfilesPreIntegratedTextureResolution:

The purpose of CVarSSProfilesPreIntegratedTextureResolution is identical to r.SSProfilesPreIntegratedTextureResolution, as they share the same value and functionality.

This variable is used in the Engine module, specifically in the rendering subsystem for subsurface scattering profiles.

The value is set when the TAutoConsoleVariable is created, with a default of 64. It can be modified at runtime through the console variable system.

CVarSSProfilesPreIntegratedTextureResolution directly interacts with r.SSProfilesPreIntegratedTextureResolution, as they are essentially the same variable.

Developers should be aware that this variable is accessed using GetValueOnAnyThread(), which means it can be safely read from any thread.

Best practices for using this variable include:

  1. Using it to read the current value of the subsurface profile preintegrated texture resolution.
  2. Considering thread safety when accessing or modifying this variable.
  3. Using this variable in conjunction with other subsurface scattering-related settings for optimal results.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Rendering/SubsurfaceProfile.cpp:14

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarSSProfilesPreIntegratedTextureResolution(
	TEXT("r.SSProfilesPreIntegratedTextureResolution"),
	64,
	TEXT("The resolution of the subsurface profile preintegrated texture.\n"),
	ECVF_RenderThreadSafe
);

static TAutoConsoleVariable<int32> CVarSSProfilesSamplingChannelSelection(

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Rendering/SubsurfaceProfile.cpp:13

Scope: file

Source code excerpt:

DEFINE_LOG_CATEGORY_STATIC(LogSubsurfaceProfile, Log, All);

static TAutoConsoleVariable<int32> CVarSSProfilesPreIntegratedTextureResolution(
	TEXT("r.SSProfilesPreIntegratedTextureResolution"),
	64,
	TEXT("The resolution of the subsurface profile preintegrated texture.\n"),
	ECVF_RenderThreadSafe
);

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Rendering/SubsurfaceProfile.cpp:256

Scope (from outer to inner):

file
function     IPooledRenderTarget* FSubsurfaceProfileTexture::GetSSProfilesPreIntegratedTexture

Source code excerpt:


	// PreIntegrated SSS look up texture
	int32 SSProfilesPreIntegratedTextureResolution = FMath::RoundUpToPowerOfTwo(FMath::Max(CVarSSProfilesPreIntegratedTextureResolution.GetValueOnAnyThread(), 32));
	
	// Generate the new preintegrated texture if needed.
	if (!GSSProfilesPreIntegratedTexture ||
		GSSProfilesPreIntegratedTexture->GetDesc().Extent != SSProfilesPreIntegratedTextureResolution ||
		ForceUpdateSSProfilesPreIntegratedTexture())
	{