bVisualizeVolumeLightSamples
bVisualizeVolumeLightSamples
#Overview
name: bVisualizeVolumeLightSamples
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 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of bVisualizeVolumeLightSamples is to enable debugging visualization of volume lighting samples in the Unreal Engine editor. This setting is primarily used for the lighting system, specifically for precomputed dynamic object lighting.
This setting variable is relied upon by the Lightmass subsystem, which is responsible for global illumination and precomputed lighting in Unreal Engine. It is used in both the main engine code and the UnrealLightmass program, which is a separate application that handles the heavy-duty lighting calculations.
The value of this variable is set through the Lightmass configuration file (GLightmassIni). It is read from the “DevOptions.PrecomputedDynamicObjectLighting” section of the configuration file.
This variable interacts with other lighting-related variables, such as bVisualizeVolumeLightInterpolation and NumHemisphereSamplesScale, which are part of the FDynamicObjectSettings struct.
Developers must be aware that this is a debugging feature. Enabling it will cause the engine to generate and store additional debug data, which may impact performance. It should only be used during development and debugging phases, not in production builds.
Best practices when using this variable include:
- Only enable it when actively debugging volume lighting issues.
- Use it in conjunction with other visualization tools to get a comprehensive understanding of the lighting system.
- Remember to disable it before creating production builds to avoid unnecessary performance overhead.
- When enabled, look for visual anomalies in the editor that might indicate issues with volume lighting samples.
- Use this in combination with bVisualizeVolumeLightInterpolation to get a more complete picture of how dynamic object lighting is being calculated and applied.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseLightmass.ini:76, section: [DevOptions.PrecomputedDynamicObjectLighting]
- INI Section:
DevOptions.PrecomputedDynamicObjectLighting
- 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:2251
Scope (from outer to inner):
file
function void FLightmassExporter::WriteSceneSettings
Source code excerpt:
}
{
VERIFYLIGHTMASSINI(GConfig->GetBool(TEXT("DevOptions.PrecomputedDynamicObjectLighting"), TEXT("bVisualizeVolumeLightSamples"), bConfigBool, GLightmassIni));
Scene.DynamicObjectSettings.bVisualizeVolumeLightSamples = bConfigBool;
VERIFYLIGHTMASSINI(GConfig->GetBool(TEXT("DevOptions.PrecomputedDynamicObjectLighting"), TEXT("bVisualizeVolumeLightInterpolation"), bConfigBool, GLightmassIni));
Scene.DynamicObjectSettings.bVisualizeVolumeLightInterpolation = bConfigBool;
VERIFYLIGHTMASSINI(GConfig->GetFloat(TEXT("DevOptions.PrecomputedDynamicObjectLighting"), TEXT("NumHemisphereSamplesScale"), Scene.DynamicObjectSettings.NumHemisphereSamplesScale, GLightmassIni));
VERIFYLIGHTMASSINI(GConfig->GetFloat(TEXT("DevOptions.PrecomputedDynamicObjectLighting"), TEXT("SurfaceLightSampleSpacing"), Scene.DynamicObjectSettings.SurfaceLightSampleSpacing, GLightmassIni));
VERIFYLIGHTMASSINI(GConfig->GetFloat(TEXT("DevOptions.PrecomputedDynamicObjectLighting"), TEXT("FirstSurfaceSampleLayerHeight"), Scene.DynamicObjectSettings.FirstSurfaceSampleLayerHeight, GLightmassIni));
VERIFYLIGHTMASSINI(GConfig->GetFloat(TEXT("DevOptions.PrecomputedDynamicObjectLighting"), TEXT("SurfaceSampleLayerHeightSpacing"), Scene.DynamicObjectSettings.SurfaceSampleLayerHeightSpacing, GLightmassIni));
#Loc: <Workspace>/Engine/Source/Programs/UnrealLightmass/Private/Lighting/LightingSystem.cpp:742
Scope (from outer to inner):
file
namespace Lightmass
function void FStaticLightingSystem::ExportNonMappingTasks
Source code excerpt:
Exporter.ExportVolumeLightingSamples(
DynamicObjectSettings.bVisualizeVolumeLightSamples,
VolumeLightingDebugOutput,
VolumeBounds.Origin,
VolumeBounds.BoxExtent,
VolumeLightingSamples);
// Release volume lighting samples unless they are being used by the lighting threads for shading
#Loc: <Workspace>/Engine/Source/Programs/UnrealLightmass/Private/Lighting/SampleVolume.cpp:567
Scope (from outer to inner):
file
namespace Lightmass
function void FStaticLightingSystem::ProcessVolumeSamplesTask
Source code excerpt:
}
#if ALLOW_LIGHTMAP_SAMPLE_DEBUGGING
if (Scene.DebugMapping && DynamicObjectSettings.bVisualizeVolumeLightSamples)
{
FSHVectorRGB3 IncidentRadiance;
CurrentSample.ToSHVector(IncidentRadiance);
VolumeLightingDebugOutput.VolumeLightingSamples.Add(FDebugVolumeLightingSample(CurrentSample.PositionAndRadius, IncidentRadiance.CalcIntegral() / FSHVector2::ConstantBasisIntegral));
}
#endif
#Loc: <Workspace>/Engine/Source/Programs/UnrealLightmass/Public/SceneExport.h:304
Scope (from outer to inner):
file
namespace Lightmass
class class FDynamicObjectSettings
Source code excerpt:
public:
/** Debugging - Whether to draw points in the editor to visualize volume lighting samples. */
bool bVisualizeVolumeLightSamples;
/** Debugging - Whether to interpolate indirect lighting for surfaces from the precomputed light volume. */
bool bVisualizeVolumeLightInterpolation;
/** Scales the number of hemisphere samples that should be used for lighting volume samples. */
float NumHemisphereSamplesScale;