r.CapsuleIndirectShadows

r.CapsuleIndirectShadows

#Overview

name: r.CapsuleIndirectShadows

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

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of r.CapsuleIndirectShadows is to control whether capsule indirect shadowing is allowed on skinned components with bCastCapsuleIndirectShadow enabled. This setting is part of the rendering system in Unreal Engine 5, specifically related to shadow rendering.

The Unreal Engine subsystem that relies on this setting variable is the Renderer module, as evident from the file paths in the Callsites section (Runtime/Renderer/Private/CapsuleShadowRendering.cpp and CapsuleShadowRendering.h).

The value of this variable is set through the console variable system. It’s initialized with a default value of 1 (enabled) and can be changed at runtime using the console command “r.CapsuleIndirectShadows”.

The associated variable GCapsuleIndirectShadows interacts directly with r.CapsuleIndirectShadows. They share the same value, with GCapsuleIndirectShadows being the actual integer variable used in the code.

Developers should be aware that this variable affects performance and visual quality. Enabling capsule indirect shadows can provide more realistic lighting but may have a performance cost. It’s also important to note that this setting only affects skinned components with bCastCapsuleIndirectShadow enabled.

Best practices when using this variable include:

  1. Consider the performance implications when enabling this feature, especially on lower-end hardware.
  2. Use in conjunction with other shadow settings for optimal visual results.
  3. Test thoroughly on target platforms to ensure acceptable performance.

Regarding the associated variable GCapsuleIndirectShadows:

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/CapsuleShadowRendering.cpp:50

Scope: file

Source code excerpt:

int32 GCapsuleIndirectShadows = 1;
FAutoConsoleVariableRef CVarCapsuleIndirectShadows(
	TEXT("r.CapsuleIndirectShadows"),
	GCapsuleIndirectShadows,
	TEXT("Whether to allow capsule indirect shadowing on skinned components with bCastCapsuleIndirectShadow enabled."),
	ECVF_Scalability | ECVF_RenderThreadSafe
	);

int32 GCapsuleShadowsFullResolution = 0;

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/CapsuleShadowRendering.cpp:48

Scope: file

Source code excerpt:

	);

int32 GCapsuleIndirectShadows = 1;
FAutoConsoleVariableRef CVarCapsuleIndirectShadows(
	TEXT("r.CapsuleIndirectShadows"),
	GCapsuleIndirectShadows,
	TEXT("Whether to allow capsule indirect shadowing on skinned components with bCastCapsuleIndirectShadow enabled."),
	ECVF_Scalability | ECVF_RenderThreadSafe
	);

int32 GCapsuleShadowsFullResolution = 0;
FAutoConsoleVariableRef CVarCapsuleShadowsFullResolution(

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/CapsuleShadowRendering.h:11

Scope: file

Source code excerpt:

extern int32 GCapsuleShadows;
extern int32 GCapsuleDirectShadows;
extern int32 GCapsuleIndirectShadows;

inline bool SupportsCapsuleShadows(FStaticShaderPlatform ShaderPlatform)
{
	return GCapsuleShadows
		&& FDataDrivenShaderPlatformInfo::GetSupportsCapsuleShadows(ShaderPlatform);
}

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/CapsuleShadowRendering.h:26

Scope (from outer to inner):

file
function     inline bool SupportsCapsuleIndirectShadows

Source code excerpt:

inline bool SupportsCapsuleIndirectShadows(FStaticShaderPlatform ShaderPlatform)
{
	return GCapsuleIndirectShadows && SupportsCapsuleShadows(ShaderPlatform);
}