r.FastVRam.DistanceFieldTileIntersectionResources

r.FastVRam.DistanceFieldTileIntersectionResources

#Overview

name: r.FastVRam.DistanceFieldTileIntersectionResources

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.FastVRam.DistanceFieldTileIntersectionResources is to control the allocation of distance field tile intersection resources in fast VRAM. This setting is part of the rendering system, specifically related to distance field rendering and optimization.

This setting variable is primarily used in the Renderer module of Unreal Engine 5. It affects the memory allocation strategy for distance field tile intersection resources, which are crucial for efficient rendering of distance field effects.

The value of this variable is set using a console variable (CVAR) system, as evident from the FASTVRAM_CVAR macro used in the code. It’s initialized with a default value of 1, indicating that by default, these resources are allocated in fast VRAM.

The associated variable DistanceFieldTileIntersectionResources interacts directly with r.FastVRam.DistanceFieldTileIntersectionResources. It’s an EBufferUsageFlags enum that determines how the engine should allocate memory for these resources.

Developers must be aware that changing this setting can affect rendering performance and memory usage. Allocating these resources in fast VRAM can improve rendering speed but may consume more of the limited fast VRAM available on the GPU.

Best practices when using this variable include:

  1. Only modify it if you’re experiencing performance issues related to distance field rendering.
  2. Monitor GPU memory usage when adjusting this setting.
  3. Test thoroughly on target hardware to ensure optimal performance.

Regarding the associated variable DistanceFieldTileIntersectionResources:

Developers should treat this associated variable as the internal representation of the CVar setting, and generally should not modify it directly, instead using the CVar system to control its value.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneRendering.cpp:510

Scope: file

Source code excerpt:


FASTVRAM_CVAR(DistanceFieldCulledObjectBuffers, 1);
FASTVRAM_CVAR(DistanceFieldTileIntersectionResources, 1);
FASTVRAM_CVAR(DistanceFieldAOScreenGridResources, 1);
FASTVRAM_CVAR(ForwardLightingCullingResources, 1);
FASTVRAM_CVAR(GlobalDistanceFieldCullGridBuffers, 1);

TSharedPtr<FVirtualShadowMapClipmap> FVisibleLightInfo::FindShadowClipmapForView(const FViewInfo* View) const
{

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneRendering.cpp:510

Scope: file

Source code excerpt:


FASTVRAM_CVAR(DistanceFieldCulledObjectBuffers, 1);
FASTVRAM_CVAR(DistanceFieldTileIntersectionResources, 1);
FASTVRAM_CVAR(DistanceFieldAOScreenGridResources, 1);
FASTVRAM_CVAR(ForwardLightingCullingResources, 1);
FASTVRAM_CVAR(GlobalDistanceFieldCullGridBuffers, 1);

TSharedPtr<FVirtualShadowMapClipmap> FVisibleLightInfo::FindShadowClipmapForView(const FViewInfo* View) const
{

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneRendering.cpp:709

Scope (from outer to inner):

file
function     void FFastVramConfig::Update

Source code excerpt:


	bDirty |= UpdateBufferFlagFromCVar(CVarFastVRam_DistanceFieldCulledObjectBuffers, DistanceFieldCulledObjectBuffers);
	bDirty |= UpdateBufferFlagFromCVar(CVarFastVRam_DistanceFieldTileIntersectionResources, DistanceFieldTileIntersectionResources);
	bDirty |= UpdateBufferFlagFromCVar(CVarFastVRam_DistanceFieldAOScreenGridResources, DistanceFieldAOScreenGridResources);
	bDirty |= UpdateBufferFlagFromCVar(CVarFastVRam_ForwardLightingCullingResources, ForwardLightingCullingResources);
	bDirty |= UpdateBufferFlagFromCVar(CVarFastVRam_GlobalDistanceFieldCullGridBuffers, GlobalDistanceFieldCullGridBuffers);

	// When Substrate is enable, remove Scene color from fast VRAM to leave space for material buffer which has more impact on performance
	if (Substrate::IsSubstrateEnabled() && !IsForwardShadingEnabled(GMaxRHIShaderPlatform))

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneRendering.h:2861

Scope: file

Source code excerpt:

	// Buffers
	EBufferUsageFlags DistanceFieldCulledObjectBuffers;
	EBufferUsageFlags DistanceFieldTileIntersectionResources;
	EBufferUsageFlags DistanceFieldAOScreenGridResources;
	EBufferUsageFlags ForwardLightingCullingResources;
	EBufferUsageFlags GlobalDistanceFieldCullGridBuffers;
	bool bDirty;

private: