fx.ParticleDefaultLightInverseExposureBlend

fx.ParticleDefaultLightInverseExposureBlend

#Overview

name: fx.ParticleDefaultLightInverseExposureBlend

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 fx.ParticleDefaultLightInverseExposureBlend is to control the blending factor between intensity and intensity divided by exposure for particle lighting in Unreal Engine 5’s particle system.

This setting variable is primarily used in the particle system, specifically within the lighting module of the particle system. It is part of the Engine module, as evidenced by its location in the Engine/Source/Runtime/Engine directory.

The value of this variable is set through a console variable (CVar) system. It is initialized with a default value of 0.0f, but can be changed at runtime through console commands or programmatically.

The associated variable CVarParticleDefaultLightInverseExposureBlend directly interacts with fx.ParticleDefaultLightInverseExposureBlend. They share the same value and purpose.

Developers should be aware that this variable affects the lighting calculation for particles. A value of 0 means no blending (using pure intensity), while higher values will increasingly factor in the inverse of the exposure.

Best practices when using this variable include:

  1. Carefully consider the visual impact of changing this value, as it can significantly affect the appearance of particle lighting.
  2. Use it in conjunction with other lighting parameters for fine-tuning particle effects.
  3. Be mindful of performance implications when adjusting this value, especially in scenes with many particles.

Regarding the associated variable CVarParticleDefaultLightInverseExposureBlend:

The purpose of CVarParticleDefaultLightInverseExposureBlend is the same as fx.ParticleDefaultLightInverseExposureBlend - it controls the blending factor for particle lighting.

This variable is used in the UParticleModuleLight::SpawnEx function within the particle system. It’s part of the Engine module’s particle system implementation.

The value is set and accessed through the TAutoConsoleVariable system, which allows for runtime modification.

CVarParticleDefaultLightInverseExposureBlend directly interacts with fx.ParticleDefaultLightInverseExposureBlend, as they represent the same setting.

Developers should be aware that this variable is used as a fallback when the bOverrideInverseExposureBlend flag is false in the particle module.

Best practices include:

  1. Use this variable for global control of particle lighting blend, while using per-module settings for more specific control.
  2. Consider exposing this setting in debug or development builds for easier tuning.
  3. Document any changes to this variable, as it can affect the overall look of particle effects in the game.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Particles/ParticleModules.cpp:3046

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarParticleDefaultLightInverseExposureBlend(
	TEXT("fx.ParticleDefaultLightInverseExposureBlend"),
	0.0f,
	TEXT("Blend Factor used to blend between Intensity and Intensity / Exposure."),
	ECVF_Default
);

void UParticleModuleLight::SpawnEx(FParticleEmitterInstance* Owner, int32 Offset, float SpawnTime, struct FRandomStream* InRandomStream, FBaseParticle* ParticleBase)

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Particles/ParticleModules.cpp:3045

Scope: file

Source code excerpt:

	);

static TAutoConsoleVariable<int32> CVarParticleDefaultLightInverseExposureBlend(
	TEXT("fx.ParticleDefaultLightInverseExposureBlend"),
	0.0f,
	TEXT("Blend Factor used to blend between Intensity and Intensity / Exposure."),
	ECVF_Default
);

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Particles/ParticleModules.cpp:3064

Scope (from outer to inner):

file
function     void UParticleModuleLight::SpawnEx

Source code excerpt:

		// Exponent of 0 is interpreted by renderer as inverse squared falloff
		LightData.LightExponent = bUseInverseSquaredFalloff ? 0 : LightExponent.GetValue(Owner->EmitterTime, Owner->Component, InRandomStream);
		LightData.InverseExposureBlend = bOverrideInverseExposureBlend ? InverseExposureBlend : CVarParticleDefaultLightInverseExposureBlend.GetValueOnAnyThread();
		const float RandomNumber = InRandomStream->GetFraction();
		LightData.bValid = RandomNumber < SpawnFraction;
		LightData.bAffectsTranslucency = bAffectsTranslucency;
		LightData.bHighQuality = bHighQualityLights;
		LightData.LightId = 0;