r.HeterogeneousVolumes.Shadows.Jitter

r.HeterogeneousVolumes.Shadows.Jitter

#Overview

name: r.HeterogeneousVolumes.Shadows.Jitter

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.HeterogeneousVolumes.Shadows.Jitter is to enable jittering when constructing shadows in heterogeneous volumes rendering. This setting is part of the rendering system, specifically for the heterogeneous volumes feature in Unreal Engine 5.

This setting variable is primarily used in the Renderer module of Unreal Engine, as evidenced by its location in the HeterogeneousVolumesVoxelGridPipeline.cpp file within the Runtime/Renderer directory.

The value of this variable is set through a console variable (CVar) system. It is initialized with a default value of 0, meaning jittering is disabled by default.

The associated variable CVarHeterogeneousVolumesShadowJitter directly interacts with r.HeterogeneousVolumes.Shadows.Jitter. It is used to access the value of the setting in the C++ code.

Developers must be aware that this variable affects shadow construction in heterogeneous volumes. Enabling jittering (by setting the value to non-zero) may impact performance and visual quality of shadows in these volumes.

Best practices when using this variable include:

  1. Only enable jittering if needed for specific visual effects or to reduce aliasing in shadows.
  2. Test performance impact when enabling jittering, as it may affect render times.
  3. Use in conjunction with other heterogeneous volumes settings for optimal results.

Regarding the associated variable CVarHeterogeneousVolumesShadowJitter:

The purpose of CVarHeterogeneousVolumesShadowJitter is to provide a programmatic interface to access and modify the r.HeterogeneousVolumes.Shadows.Jitter setting within the C++ code.

This variable is used in the Renderer module, specifically in the HeterogeneousVolumes namespace.

The value of CVarHeterogeneousVolumesShadowJitter is set through the console variable system and can be modified at runtime.

It interacts directly with r.HeterogeneousVolumes.Shadows.Jitter, essentially serving as its C++ representation.

Developers should be aware that changes to CVarHeterogeneousVolumesShadowJitter will affect the jittering behavior in shadow construction for heterogeneous volumes.

Best practices for using CVarHeterogeneousVolumesShadowJitter include:

  1. Use GetValueOnRenderThread() to safely access its value in render thread code.
  2. Avoid frequent changes to this variable, as it may impact performance and visual consistency.
  3. Consider exposing this setting in user interfaces for advanced graphics options if needed.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumesVoxelGridPipeline.cpp:267

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesShadowJitter(
	TEXT("r.HeterogeneousVolumes.Shadows.Jitter"),
	0,
	TEXT("Enables jittering when constructing shadows (Default = 0)\n"),
	ECVF_RenderThreadSafe
);

IMPLEMENT_UNIFORM_BUFFER_STRUCT(FOrthoVoxelGridUniformBufferParameters, "OrthoGridUniformBuffer");

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumesVoxelGridPipeline.cpp:266

Scope: file

Source code excerpt:

);

static TAutoConsoleVariable<int32> CVarHeterogeneousVolumesShadowJitter(
	TEXT("r.HeterogeneousVolumes.Shadows.Jitter"),
	0,
	TEXT("Enables jittering when constructing shadows (Default = 0)\n"),
	ECVF_RenderThreadSafe
);

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HeterogeneousVolumes/HeterogeneousVolumesVoxelGridPipeline.cpp:458

Scope (from outer to inner):

file
namespace    HeterogeneousVolumes
function     bool EnableJitterForShadows

Source code excerpt:

	bool EnableJitterForShadows()
	{
		return CVarHeterogeneousVolumesShadowJitter.GetValueOnRenderThread() != 0;
	}

	bool IsDynamicShadow(const FVisibleLightInfo* VisibleLightInfo)
	{
		check(VisibleLightInfo != nullptr);
		if (VisibleLightInfo)