r.VolumetricLightmap.VisualizationMinScreenFraction
r.VolumetricLightmap.VisualizationMinScreenFraction
#Overview
name: r.VolumetricLightmap.VisualizationMinScreenFraction
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Minimum screen size of a volumetric lightmap visualization sphere
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.VolumetricLightmap.VisualizationMinScreenFraction is to set the minimum screen size of a volumetric lightmap visualization sphere in the rendering system of Unreal Engine 5.
This setting variable is primarily used in the Renderer module of Unreal Engine 5, specifically in the visualization of volumetric lightmaps. It is part of the engine’s rendering subsystem.
The value of this variable is set through the Unreal Engine console variable system. It is defined as a FAutoConsoleVariableRef, which allows it to be modified at runtime through console commands or configuration files.
This variable interacts directly with GVolumetricLightmapVisualizationMinScreenFraction, which is the actual float variable used in the rendering code. The console variable r.VolumetricLightmap.VisualizationMinScreenFraction is linked to GVolumetricLightmapVisualizationMinScreenFraction, ensuring they always have the same value.
Developers should be aware that this variable affects the visualization of volumetric lightmaps, which is likely a debug or development feature rather than something used in final builds. Changing this value will affect how small the visualization spheres can appear on screen.
Best practices when using this variable include:
- Only modifying it when working on or debugging volumetric lightmap visualizations.
- Being cautious about setting it too low, as very small spheres might impact performance or visibility.
- Considering the target hardware when adjusting this value, as it may affect rendering performance.
Regarding the associated variable GVolumetricLightmapVisualizationMinScreenFraction:
The purpose of GVolumetricLightmapVisualizationMinScreenFraction is to store the actual value used in the rendering code for the minimum screen size of volumetric lightmap visualization spheres.
This variable is used directly in the Renderer module, specifically in the VisualizeVolumetricLightmap function of the FDeferredShadingSceneRenderer class.
The value of this variable is set through the associated console variable r.VolumetricLightmap.VisualizationMinScreenFraction.
It interacts with the console variable system and is used in the shader parameter setup for volumetric lightmap visualization.
Developers should be aware that modifying this variable directly in code is not recommended, as it should be controlled through the console variable system for consistency.
Best practices for this variable include:
- Treating it as read-only in most code contexts.
- Using the console variable r.VolumetricLightmap.VisualizationMinScreenFraction to modify its value when needed.
- Being aware of its impact on volumetric lightmap visualization when debugging or profiling rendering performance.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VisualizeVolumetricLightmap.cpp:37
Scope: file
Source code excerpt:
float GVolumetricLightmapVisualizationMinScreenFraction = .001f;
FAutoConsoleVariableRef CVarVolumetricLightmapVisualizationMinScreenFraction(
TEXT("r.VolumetricLightmap.VisualizationMinScreenFraction"),
GVolumetricLightmapVisualizationMinScreenFraction,
TEXT("Minimum screen size of a volumetric lightmap visualization sphere"),
ECVF_RenderThreadSafe
);
// Nvidia has lower vertex throughput when only processing a few verts per instance
#Associated Variable and Callsites
This variable is associated with another variable named GVolumetricLightmapVisualizationMinScreenFraction
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VisualizeVolumetricLightmap.cpp:35
Scope: file
Source code excerpt:
);
float GVolumetricLightmapVisualizationMinScreenFraction = .001f;
FAutoConsoleVariableRef CVarVolumetricLightmapVisualizationMinScreenFraction(
TEXT("r.VolumetricLightmap.VisualizationMinScreenFraction"),
GVolumetricLightmapVisualizationMinScreenFraction,
TEXT("Minimum screen size of a volumetric lightmap visualization sphere"),
ECVF_RenderThreadSafe
);
// Nvidia has lower vertex throughput when only processing a few verts per instance
const int32 GQuadsPerVisualizeInstance = 8;
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VisualizeVolumetricLightmap.cpp:131
Scope (from outer to inner):
file
function void FDeferredShadingSceneRenderer::VisualizeVolumetricLightmap
Source code excerpt:
PassParameters->Common.View = View.ViewUniformBuffer;
PassParameters->Common.VisualizationRadiusScale = GVolumetricLightmapVisualizationRadiusScale;
PassParameters->Common.VisualizationMinScreenFraction = GVolumetricLightmapVisualizationMinScreenFraction;
{
FVector3f DiffuseColorValue(.18f, .18f, .18f);
if (!ViewFamily.EngineShowFlags.Materials)
{
DiffuseColorValue = FVector3f(GEngine->LightingOnlyBrightness);