r.RayTracing.Geometry.NiagaraSprites
r.RayTracing.Geometry.NiagaraSprites
#Overview
name: r.RayTracing.Geometry.NiagaraSprites
The value of this variable can be defined or overridden in .ini config files. 1
.ini config file referencing this setting variable.
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Include Niagara sprites in ray tracing effects (default = 1 (Niagara sprites enabled in ray tracing))
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.RayTracing.Geometry.NiagaraSprites is to control whether Niagara sprites are included in ray tracing effects within Unreal Engine 5. This setting is specifically related to the rendering system, particularly the ray tracing functionality.
This setting variable is primarily used within the Niagara plugin, which is part of Unreal Engine’s visual effects system. Based on the callsites, it’s clear that the NiagaraRendererSprites module relies on this setting.
The value of this variable is set through a console variable (CVarRayTracingNiagaraSprites) with a default value of 1, meaning Niagara sprites are enabled in ray tracing by default.
The associated variable CVarRayTracingNiagaraSprites interacts directly with r.RayTracing.Geometry.NiagaraSprites. They share the same value and purpose.
Developers must be aware that this variable affects the performance and visual quality of ray-traced scenes that include Niagara sprite effects. Enabling this feature (value of 1) will include Niagara sprites in ray tracing calculations, potentially increasing visual fidelity but also increasing computational cost.
Best practices when using this variable include:
- Consider the performance impact of enabling Niagara sprites in ray tracing, especially for scenes with many sprite-based effects.
- Test scenes with this setting both enabled and disabled to find the right balance between visual quality and performance.
- Be aware that disabling this feature (setting to 0) will exclude Niagara sprites from ray tracing effects, which might lead to visual inconsistencies in fully ray-traced scenes.
Regarding the associated variable CVarRayTracingNiagaraSprites:
- Its purpose is identical to r.RayTracing.Geometry.NiagaraSprites, serving as the actual console variable implementation.
- It’s used in the Niagara plugin, specifically within the NiagaraRendererSprites module.
- The value is set at initialization with a default of 1, but can be changed at runtime through console commands.
- It directly controls whether the GetDynamicRayTracingInstances function includes Niagara sprites in ray tracing calculations.
- Developers should be aware that changes to this variable will immediately affect ray tracing behavior for Niagara sprites.
- Best practices include using this variable for debugging or performance tuning, and considering its impact on both visual quality and rendering performance.
#Setting Variables
#References In INI files
Location: <Workspace>/Projects/Lyra/Config/DefaultEngine.ini:139, section: [/Script/Engine.RendererSettings]
- INI Section:
/Script/Engine.RendererSettings
- Raw value:
0
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/FX/Niagara/Source/Niagara/Private/NiagaraRendererSprites.cpp:31
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarRayTracingNiagaraSprites(
TEXT("r.RayTracing.Geometry.NiagaraSprites"),
1,
TEXT("Include Niagara sprites in ray tracing effects (default = 1 (Niagara sprites enabled in ray tracing))"));
/** Dynamic data for sprite renderers. */
struct FNiagaraDynamicDataSprites : public FNiagaraDynamicDataBase
#Associated Variable and Callsites
This variable is associated with another variable named CVarRayTracingNiagaraSprites
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/FX/Niagara/Source/Niagara/Private/NiagaraRendererSprites.cpp:30
Scope: file
Source code excerpt:
);
static TAutoConsoleVariable<int32> CVarRayTracingNiagaraSprites(
TEXT("r.RayTracing.Geometry.NiagaraSprites"),
1,
TEXT("Include Niagara sprites in ray tracing effects (default = 1 (Niagara sprites enabled in ray tracing))"));
/** Dynamic data for sprite renderers. */
#Loc: <Workspace>/Engine/Plugins/FX/Niagara/Source/Niagara/Private/NiagaraRendererSprites.cpp:1072
Scope (from outer to inner):
file
function void FNiagaraRendererSprites::GetDynamicRayTracingInstances
Source code excerpt:
void FNiagaraRendererSprites::GetDynamicRayTracingInstances(FRayTracingMaterialGatheringContext& Context, TArray<FRayTracingInstance>& OutRayTracingInstances, const FNiagaraSceneProxy* SceneProxy)
{
if (!CVarRayTracingNiagaraSprites.GetValueOnRenderThread())
{
return;
}
check(SceneProxy);