bVisualizeMeshAreaLightPrimitives
bVisualizeMeshAreaLightPrimitives
#Overview
name: bVisualizeMeshAreaLightPrimitives
The value of this variable can be defined or overridden in .ini config files. 1
.ini config file referencing this setting variable.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of bVisualizeMeshAreaLightPrimitives is to enable debug visualization of mesh area light primitives in Unreal Engine 5’s lighting system. This setting is specifically related to the Lightmass subsystem, which handles global illumination and static lighting calculations.
This setting variable is primarily used in the Lightmass module of Unreal Engine 5. It’s referenced in both the editor (UnrealEd) and the standalone Lightmass program, indicating its importance in the lighting build process.
The value of this variable is set from the Lightmass configuration file (GLightmassIni). It’s read using the GConfig->GetBool function, which suggests that it’s a boolean value that can be toggled on or off in the configuration.
This variable interacts with other Mesh Area Light settings, such as EmissiveIntensityThreshold, MeshAreaLightGridSize, and MeshAreaLightSimplifyNormalAngleThreshold. These settings collectively control how mesh area lights are processed and visualized.
Developers should be aware that enabling this visualization might have performance implications, especially in complex scenes with many mesh area lights. It’s primarily intended for debugging and development purposes, not for use in final builds.
Best practices when using this variable include:
- Only enable it when actively debugging mesh area light issues.
- Use it in conjunction with other Mesh Area Light settings for comprehensive debugging.
- Remember to disable it before final builds or performance-critical operations.
- Be cautious when enabling this in large scenes, as it may significantly increase the visual complexity.
Developers should also note that this visualization is tied to texel selection, suggesting it’s most useful when examining specific areas of a scene in detail during the lighting build process.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseLightmass.ini:66, section: [DevOptions.MeshAreaLights]
- INI Section:
DevOptions.MeshAreaLights
- Raw value:
False
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Lightmass/Lightmass.cpp:2229
Scope (from outer to inner):
file
function void FLightmassExporter::WriteSceneSettings
Source code excerpt:
}
{
VERIFYLIGHTMASSINI(GConfig->GetBool(TEXT("DevOptions.MeshAreaLights"), TEXT("bVisualizeMeshAreaLightPrimitives"), bConfigBool, GLightmassIni));
Scene.MeshAreaLightSettings.bVisualizeMeshAreaLightPrimitives = bConfigBool;
VERIFYLIGHTMASSINI(GConfig->GetFloat(TEXT("DevOptions.MeshAreaLights"), TEXT("EmissiveIntensityThreshold"), Scene.MeshAreaLightSettings.EmissiveIntensityThreshold, GLightmassIni));
VERIFYLIGHTMASSINI(GConfig->GetInt(TEXT("DevOptions.MeshAreaLights"), TEXT("MeshAreaLightGridSize"), Scene.MeshAreaLightSettings.MeshAreaLightGridSize, GLightmassIni));
float MeshAreaLightSimplifyNormalAngleThreshold;
VERIFYLIGHTMASSINI(GConfig->GetFloat(TEXT("DevOptions.MeshAreaLights"), TEXT("MeshAreaLightSimplifyNormalAngleThreshold"), MeshAreaLightSimplifyNormalAngleThreshold, GLightmassIni));
Scene.MeshAreaLightSettings.MeshAreaLightSimplifyNormalCosAngleThreshold = FMath::Cos(FMath::Clamp(MeshAreaLightSimplifyNormalAngleThreshold, 0.0f, 90.0f) * (float)PI / 180.0f);
VERIFYLIGHTMASSINI(GConfig->GetFloat(TEXT("DevOptions.MeshAreaLights"), TEXT("MeshAreaLightSimplifyCornerDistanceThreshold"), Scene.MeshAreaLightSettings.MeshAreaLightSimplifyCornerDistanceThreshold, GLightmassIni));
#Loc: <Workspace>/Engine/Source/Programs/UnrealLightmass/Private/Lighting/LightingMesh.cpp:462
Scope (from outer to inner):
file
namespace Lightmass
function void FStaticLightingMesh::CreateMeshAreaLights
Source code excerpt:
TrimmedEmissivePrimitives[LightIndex].Last().Finalize();
if (Scene.MeshAreaLightSettings.bVisualizeMeshAreaLightPrimitives)
{
// Draw 4 lines between the primitive corners for debugging
// Currently hijacking ShadowRays
//LightingSystem.DebugOutput.ShadowRays.Add(FDebugStaticLightingRay(EmissivePrimitives[LightIndex][PrimitiveIndex].Corners[0].WorldPosition - FVector4f(0,0,.1f), EmissivePrimitives[LightIndex][PrimitiveIndex].Corners[1].WorldPosition - FVector4f(0,0,.1f), true, false));
//LightingSystem.DebugOutput.ShadowRays.Add(FDebugStaticLightingRay(EmissivePrimitives[LightIndex][PrimitiveIndex].Corners[1].WorldPosition - FVector4f(0,0,.1f), EmissivePrimitives[LightIndex][PrimitiveIndex].Corners[3].WorldPosition - FVector4f(0,0,.1f), true, true));
//LightingSystem.DebugOutput.ShadowRays.Add(FDebugStaticLightingRay(EmissivePrimitives[LightIndex][PrimitiveIndex].Corners[3].WorldPosition - FVector4f(0,0,.1f), EmissivePrimitives[LightIndex][PrimitiveIndex].Corners[2].WorldPosition - FVector4f(0,0,.1f), true, false));
#Loc: <Workspace>/Engine/Source/Programs/UnrealLightmass/Public/SceneExport.h:226
Scope (from outer to inner):
file
namespace Lightmass
Source code excerpt:
{
/** Whether to draw debug lines showing the corners of mesh area light primitives when a texel has been selected. */
bool bVisualizeMeshAreaLightPrimitives;
/** Emissive intensities must be larger than this to contribute toward scene lighting. */
float EmissiveIntensityThreshold;
/**
* Size of the grid that each mesh area light will use to cache information.