r.VolumetricFog.Emissive
r.VolumetricFog.Emissive
#Overview
name: r.VolumetricFog.Emissive
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to allow the volumetric fog emissive component.
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.VolumetricFog.Emissive is to control whether the volumetric fog system should include an emissive component. This setting variable is part of the rendering system, specifically the volumetric fog subsystem in Unreal Engine 5.
Based on the callsites, this setting variable is primarily used in the Renderer module, particularly in the volumetric fog rendering pipeline. The main files that reference this variable are VolumetricFog.cpp and VolumetricFogVoxelization.cpp.
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 console commands or through engine configuration files.
The associated variable GVolumetricFogEmissive interacts directly with r.VolumetricFog.Emissive. They share the same value, with GVolumetricFogEmissive being the internal representation used in the C++ code.
Developers should be aware that:
- This variable affects the rendering performance and visual quality of volumetric fog.
- It’s a scalability option, meaning it can be adjusted based on performance requirements.
- It’s render thread safe, allowing for changes during runtime without causing threading issues.
Best practices when using this variable include:
- Consider the performance impact when enabling the emissive component, especially on lower-end hardware.
- Use it in conjunction with other volumetric fog settings for optimal visual results.
- Allow this setting to be configurable by end-users for performance scalability.
Regarding the associated variable GVolumetricFogEmissive:
- Its purpose is to serve as the internal representation of the r.VolumetricFog.Emissive setting.
- It’s used directly in the rendering code to determine whether to include the emissive component in volumetric fog calculations.
- The value is set by the console variable system and can be accessed throughout the renderer code.
- Developers should use this variable for conditional logic in the rendering pipeline related to volumetric fog emissive components.
- Best practice is to always check this variable’s value before performing emissive-related calculations or allocating resources for emissive fog components.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VolumetricFog.cpp:114
Scope: file
Source code excerpt:
int32 GVolumetricFogEmissive = 1;
FAutoConsoleVariableRef CVarVolumetricFogEmissive(
TEXT("r.VolumetricFog.Emissive"),
GVolumetricFogEmissive,
TEXT("Whether to allow the volumetric fog emissive component."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GVolumetricFogRectLightTexture = 0;
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VolumetricFogVoxelization.cpp:584
Scope (from outer to inner):
file
function void FVoxelizeVolumeMeshProcessor::CollectPSOInitializers
Source code excerpt:
AddRenderTargetInfo(VolumeDesc.Format, VolumeDesc.Flags, RenderTargetsInfo);
static const auto CVarVolumetrixFogEmissive = IConsoleManager::Get().FindConsoleVariable(TEXT("r.VolumetricFog.Emissive"));
const bool bUseEmissive = (!CVarVolumetrixFogEmissive) || (CVarVolumetrixFogEmissive->GetInt() > 0);
if (bUseEmissive)
{
AddRenderTargetInfo(VolumeDesc.Format, VolumeDesc.Flags, RenderTargetsInfo);
}
#Associated Variable and Callsites
This variable is associated with another variable named GVolumetricFogEmissive
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VolumetricFog.cpp:112
Scope: file
Source code excerpt:
);
int32 GVolumetricFogEmissive = 1;
FAutoConsoleVariableRef CVarVolumetricFogEmissive(
TEXT("r.VolumetricFog.Emissive"),
GVolumetricFogEmissive,
TEXT("Whether to allow the volumetric fog emissive component."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GVolumetricFogRectLightTexture = 0;
FAutoConsoleVariableRef CVarVolumetricRectLightTexture(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VolumetricFog.cpp:1390
Scope (from outer to inner):
file
function void FSceneRenderer::ComputeVolumetricFog
Source code excerpt:
FRDGTexture* BlackDummyTexture = GraphBuilder.RegisterExternalTexture(GSystemTextures.BlackDummy);
FRDGTexture* VolumetricBlackDummyTexture = GraphBuilder.RegisterExternalTexture(GSystemTextures.VolumetricBlackDummy);
const bool bUseEmissive = GVolumetricFogEmissive > 0;
// The potential light function for the main directional light is kept separate to be applied during the main VolumetricFogLightScattering pass (as an optimisation).
FRDGTexture* DirectionalLightFunctionTexture = GraphBuilder.RegisterExternalTexture(GSystemTextures.WhiteDummy);
bool bUseDirectionalLightShadowing = false;
// Recover the information about the light use as the forward directional light for cloud shadowing