r.CapsuleIndirectShadows
r.CapsuleIndirectShadows
#Overview
name: r.CapsuleIndirectShadows
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to allow capsule indirect shadowing on skinned components with bCastCapsuleIndirectShadow enabled.
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:
- Consider the performance implications when enabling this feature, especially on lower-end hardware.
- Use in conjunction with other shadow settings for optimal visual results.
- Test thoroughly on target platforms to ensure acceptable performance.
Regarding the associated variable GCapsuleIndirectShadows:
- It’s the actual integer variable used in the code to control the capsule indirect shadows feature.
- It’s declared as an external variable in CapsuleShadowRendering.h, making it accessible across multiple files in the Renderer module.
- It’s used in the SupportsCapsuleIndirectShadows function to determine if capsule indirect shadows are supported on a given shader platform.
- Developers should not modify GCapsuleIndirectShadows directly, but instead use the r.CapsuleIndirectShadows console variable to change its value.
#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);
}