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).

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:

  1. Consider the performance impact of enabling Niagara sprites in ray tracing, especially for scenes with many sprite-based effects.
  2. Test scenes with this setting both enabled and disabled to find the right balance between visual quality and performance.
  3. 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:

#Setting Variables

#References In INI files

Location: <Workspace>/Projects/Lyra/Config/DefaultEngine.ini:139, section: [/Script/Engine.RendererSettings]

#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);