r.ManyLights.IESProfiles
r.ManyLights.IESProfiles
#Overview
name: r.ManyLights.IESProfiles
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to support IES profiles on lights.
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.ManyLights.IESProfiles is to control whether IES (Illuminating Engineering Society) profiles are supported on lights in the Many Lights rendering system of Unreal Engine 5.
This setting variable is primarily used in the rendering system, specifically within the Many Lights module. The Many Lights system is a part of Unreal Engine’s deferred shading renderer, which handles efficient rendering of multiple light sources.
Based on the callsites, this variable is used in the Renderer module, particularly in the ManyLights.cpp file. It affects the behavior of the FDeferredShadingSceneRenderer class, which is responsible for rendering the scene using deferred shading techniques.
The value of this variable is set through a console variable (CVarManyLightsIESProfiles) with a default value of 1, meaning IES profiles are supported by default. This can be changed at runtime or through configuration files.
The associated variable CVarManyLightsIESProfiles interacts directly with r.ManyLights.IESProfiles. It’s used to retrieve the current value of the setting in the render thread.
Developers should be aware that enabling IES profiles (by setting this variable to 1) may have performance implications, as it adds complexity to the lighting calculations. It should be used judiciously, especially in performance-critical scenarios.
Best practices when using this variable include:
- Consider the performance impact of enabling IES profiles, especially for mobile or low-end platforms.
- Use it in conjunction with actual IES profile data for lights to achieve more realistic lighting effects.
- Test the visual and performance differences with this setting enabled and disabled to make informed decisions.
Regarding the associated variable CVarManyLightsIESProfiles:
- Its purpose is to provide a programmatic way to access and modify the r.ManyLights.IESProfiles setting.
- It’s used within the rendering code to determine whether to include IES profile calculations in the lighting shaders.
- The value is typically retrieved using GetValueOnRenderThread() to ensure thread-safe access.
- Developers can use this variable to dynamically toggle IES profile support at runtime if needed.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/ManyLights/ManyLights.cpp:136
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int> CVarManyLightsIESProfiles(
TEXT("r.ManyLights.IESProfiles"),
1,
TEXT("Whether to support IES profiles on lights."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
namespace ManyLights
#Associated Variable and Callsites
This variable is associated with another variable named CVarManyLightsIESProfiles
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/ManyLights/ManyLights.cpp:135
Scope: file
Source code excerpt:
);
static TAutoConsoleVariable<int> CVarManyLightsIESProfiles(
TEXT("r.ManyLights.IESProfiles"),
1,
TEXT("Whether to support IES profiles on lights."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/ManyLights/ManyLights.cpp:927
Scope (from outer to inner):
file
function void FDeferredShadingSceneRenderer::RenderManyLights
Source code excerpt:
FGenerateLightSamplesCS::FPermutationDomain PermutationVector;
PermutationVector.Set<FGenerateLightSamplesCS::FTileType>(TileType);
PermutationVector.Set<FGenerateLightSamplesCS::FIESProfile>(CVarManyLightsIESProfiles.GetValueOnRenderThread() != 0);
PermutationVector.Set<FGenerateLightSamplesCS::FLightFunctionAtlas>(bUseLightFunctionAtlas);
PermutationVector.Set<FGenerateLightSamplesCS::FTexturedRectLights>(CVarManyLightsTexturedRectLights.GetValueOnRenderThread() != 0);
PermutationVector.Set<FGenerateLightSamplesCS::FNumSamplesPerPixel1d>(NumSamplesPerPixel2d.X * NumSamplesPerPixel2d.Y);
PermutationVector.Set<FGenerateLightSamplesCS::FDebugMode>(bDebug);
auto ComputeShader = View.ShaderMap->GetShader<FGenerateLightSamplesCS>(PermutationVector);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/ManyLights/ManyLights.cpp:1070
Scope (from outer to inner):
file
function void FDeferredShadingSceneRenderer::RenderManyLights
Source code excerpt:
FShadeLightSamplesCS::FPermutationDomain PermutationVector;
PermutationVector.Set<FShadeLightSamplesCS::FTileType>(TileType);
PermutationVector.Set<FShadeLightSamplesCS::FIESProfile>(CVarManyLightsIESProfiles.GetValueOnRenderThread() != 0);
PermutationVector.Set<FShadeLightSamplesCS::FLightFunctionAtlas>(bUseLightFunctionAtlas);
PermutationVector.Set<FShadeLightSamplesCS::FTexturedRectLights>(CVarManyLightsTexturedRectLights.GetValueOnRenderThread() != 0);
PermutationVector.Set<FShadeLightSamplesCS::FDebugMode>(bDebug);
auto ComputeShader = View.ShaderMap->GetShader<FShadeLightSamplesCS>(PermutationVector);
FComputeShaderUtils::AddPass(