bVisualizeVolumeLightInterpolation
bVisualizeVolumeLightInterpolation
#Overview
name: bVisualizeVolumeLightInterpolation
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 10
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of bVisualizeVolumeLightInterpolation is to enable visualization of volume light interpolation in the Unreal Engine’s lighting system. This setting is primarily used for debugging and development purposes within the precomputed dynamic object lighting subsystem.
This setting variable is primarily relied upon by the Lightmass module, which is responsible for global illumination and precomputed lighting in Unreal Engine. It is used in both the editor (UnrealEd) and the Unreal Lightmass program.
The value of this variable is set in the Lightmass configuration file (GLightmassIni) under the “DevOptions.PrecomputedDynamicObjectLighting” section.
This variable interacts with several other lighting-related settings, such as bVisualizeVolumeLightSamples, NumHemisphereSamplesScale, and various volume sampling parameters.
Developers must be aware that enabling this variable will disable irradiance caching, as noted in the ValidateSettings function. This is to prevent double interpolation of lighting results.
Best practices when using this variable include:
- Use it only for debugging and development purposes, not in production builds.
- Be aware of its impact on performance, as it may increase computation time and memory usage.
- Use it in conjunction with other visualization tools to get a comprehensive understanding of the lighting system’s behavior.
- Remember to disable it when not actively debugging to ensure optimal performance and accurate lighting calculations.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseLightmass.ini:77, 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:2253
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));
VERIFYLIGHTMASSINI(GConfig->GetInt(TEXT("DevOptions.PrecomputedDynamicObjectLighting"), TEXT("NumSurfaceSampleLayers"), Scene.DynamicObjectSettings.NumSurfaceSampleLayers, GLightmassIni));
VERIFYLIGHTMASSINI(GConfig->GetFloat(TEXT("DevOptions.PrecomputedDynamicObjectLighting"), TEXT("DetailVolumeSampleSpacing"), Scene.DynamicObjectSettings.DetailVolumeSampleSpacing, GLightmassIni));
#Loc: <Workspace>/Engine/Source/Programs/UnrealLightmass/Private/Lighting/FinalGather.cpp:1534
Scope (from outer to inner):
file
namespace Lightmass
function FFinalGatherSample FStaticLightingSystem::CachePointIncomingRadiance
Source code excerpt:
}
}
else if (DynamicObjectSettings.bVisualizeVolumeLightInterpolation
&& GeneralSettings.NumIndirectLightingBounces > 0)
{
const FGatheredLightSample VolumeLighting = InterpolatePrecomputedVolumeIncidentRadiance(Vertex, SampleRadius, MappingContext.RayCache, bDebugThisTexel);
IndirectLighting.AddWeighted(VolumeLighting, 1.0f);
}
else
#Loc: <Workspace>/Engine/Source/Programs/UnrealLightmass/Private/Lighting/LightingSystem.cpp:624
Scope (from outer to inner):
file
namespace Lightmass
function void FStaticLightingSystem::MultithreadProcess
Source code excerpt:
FinalizeSurfaceCache();
if (DynamicObjectSettings.bVisualizeVolumeLightInterpolation)
{
// Calculate volume samples now if they will be needed by the lighting threads for shading,
// Otherwise the volume samples will be calculated when the task is received from swarm.
BeginCalculateVolumeSamples();
}
#Loc: <Workspace>/Engine/Source/Programs/UnrealLightmass/Private/Lighting/LightingSystem.cpp:749
Scope (from outer to inner):
file
namespace Lightmass
function void FStaticLightingSystem::ExportNonMappingTasks
Source code excerpt:
// Release volume lighting samples unless they are being used by the lighting threads for shading
if (!DynamicObjectSettings.bVisualizeVolumeLightInterpolation)
{
VolumeLightingSamples.Empty();
}
// Tell Swarm the task is complete (if we're not in debugging mode).
if ( !IsDebugMode() )
#Loc: <Workspace>/Engine/Source/Programs/UnrealLightmass/Private/Lighting/LightingSystem.cpp:940
Scope (from outer to inner):
file
namespace Lightmass
function void FStaticLightingSystem::ValidateSettings
Source code excerpt:
}
if (InScene.DynamicObjectSettings.bVisualizeVolumeLightInterpolation)
{
// Disable irradiance caching if we are visualizing volume light interpolation, otherwise we will be getting a twice interpolated result.
InScene.IrradianceCachingSettings.bAllowIrradianceCaching = false;
}
// Round up to nearest odd number
#Loc: <Workspace>/Engine/Source/Programs/UnrealLightmass/Private/Lighting/LightingSystem.h:2596
Scope (from outer to inner):
file
namespace Lightmass
class class FStaticLightingSystem
Source code excerpt:
/** Bounds that VolumeLightingSamples were generated in. */
FBoxSphereBounds3f VolumeBounds;
/** Octree used for interpolating the volume lighting samples if DynamicObjectSettings.bVisualizeVolumeLightInterpolation is true. */
FVolumeLightingInterpolationOctree VolumeLightingInterpolationOctree;
/** Map from Level Guid to array of volume lighting samples generated. */
TMap<FGuid,TArray<FVolumeLightingSample> > VolumeLightingSamples;
/** All precomputed visibility cells in the scene. Some of these may be processed on other agents. */
TArray<FPrecomputedVisibilityCell> AllPrecomputedVisibilityCells;
#Loc: <Workspace>/Engine/Source/Programs/UnrealLightmass/Private/Lighting/SampleVolume.cpp:222
Scope (from outer to inner):
file
namespace Lightmass
function void FVolumeSamplePlacementRasterPolicy::ProcessPixel
Source code excerpt:
// Add the sample to the proximity octree so we can avoid placing any more samples nearby
ProximityOctree.AddElement(FVolumeSampleProximityElement(VolumeLightingSamples->Num() - 1, *VolumeLightingSamples));
if (System.DynamicObjectSettings.bVisualizeVolumeLightInterpolation)
{
System.VolumeLightingInterpolationOctree.AddElement(FVolumeSampleInterpolationElement(VolumeLightingSamples->Num() - 1, *VolumeLightingSamples));
}
}
}
}
#Loc: <Workspace>/Engine/Source/Programs/UnrealLightmass/Private/Lighting/SampleVolume.cpp:431
Scope (from outer to inner):
file
namespace Lightmass
function void FStaticLightingSystem::BeginCalculateVolumeSamples
Source code excerpt:
VolumeLightingSampleArray->Add(FVolumeLightingSample(FVector4f(SamplePosition, DetailVolumeSpacing * FMath::Sqrt(3.0f))));
VolumeLightingOctree.AddElement(FVolumeSampleProximityElement(VolumeLightingSampleArray->Num() - 1, *VolumeLightingSampleArray));
if (DynamicObjectSettings.bVisualizeVolumeLightInterpolation)
{
VolumeLightingInterpolationOctree.AddElement(FVolumeSampleInterpolationElement(VolumeLightingSampleArray->Num() - 1, *VolumeLightingSampleArray));
}
}
}
}
#Loc: <Workspace>/Engine/Source/Programs/UnrealLightmass/Private/Lighting/SampleVolume.cpp:483
Scope (from outer to inner):
file
namespace Lightmass
function void FStaticLightingSystem::BeginCalculateVolumeSamples
Source code excerpt:
UniformVolumeSamples->Add(FVolumeLightingSample(FVector4f(SamplePosition, EffectiveVolumeSpacing * FMath::Sqrt(3.0f))));
VolumeLightingOctree.AddElement(FVolumeSampleProximityElement(UniformVolumeSamples->Num() - 1, *UniformVolumeSamples));
if (DynamicObjectSettings.bVisualizeVolumeLightInterpolation)
{
VolumeLightingInterpolationOctree.AddElement(FVolumeSampleInterpolationElement(UniformVolumeSamples->Num() - 1, *UniformVolumeSamples));
}
}
}
}
#Loc: <Workspace>/Engine/Source/Programs/UnrealLightmass/Public/SceneExport.h:307
Scope (from outer to inner):
file
namespace Lightmass
class class FDynamicObjectSettings
Source code excerpt:
/** 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;
/** World space distance between samples placed on upward facing surfaces. */
float SurfaceLightSampleSpacing;
/** Height of the first sample layer above the surface. */