AdaptiveSkyVarianceThreshold
AdaptiveSkyVarianceThreshold
#Overview
name: AdaptiveSkyVarianceThreshold
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 AdaptiveSkyVarianceThreshold is to control the adaptive refinement process for sky lighting in Unreal Engine’s global illumination system. It is specifically used in the importance tracing settings for Lightmass, which is Unreal Engine’s offline global illumination and static lighting solution.
This setting variable is primarily used by the Lightmass subsystem, which is responsible for calculating static lighting in Unreal Engine. It’s part of the editor’s UnrealEd module and the UnrealLightmass program.
The value of this variable is set in the Lightmass configuration file (GLightmassIni). It’s read from the “[DevOptions.ImportanceTracing]” section of this file using the GConfig system.
AdaptiveSkyVarianceThreshold interacts with other importance tracing settings, particularly AdaptiveBrightnessThreshold and AdaptiveFirstBouncePhotonConeAngle. It’s also scaled by AdaptiveSkyVarianceThresholdScale, which is read from a quality-specific section of the configuration file.
Developers should be aware that this variable affects the refinement of incoming radiance calculations, particularly for scenes with skylights. A lower threshold will result in more detailed (but potentially slower) sky lighting calculations.
Best practices when using this variable include:
- Adjusting it in conjunction with other adaptive settings for balanced performance and quality.
- Testing different values to find the right balance between lighting quality and build times for your specific scene.
- Considering the presence and importance of skylights in your scene when tweaking this value.
- Being mindful of how changes to this value might affect lighting build times, especially for large or complex scenes.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseLightmass.ini:160, section: [DevOptions.ImportanceTracing]
- INI Section:
DevOptions.ImportanceTracing
- Raw value:
.5
- 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:2334
Scope (from outer to inner):
file
function void FLightmassExporter::WriteSceneSettings
Source code excerpt:
VERIFYLIGHTMASSINI(GConfig->GetFloat(TEXT("DevOptions.ImportanceTracing"), TEXT("AdaptiveBrightnessThreshold"), Scene.ImportanceTracingSettings.AdaptiveBrightnessThreshold, GLightmassIni));
VERIFYLIGHTMASSINI(GConfig->GetFloat(TEXT("DevOptions.ImportanceTracing"), TEXT("AdaptiveFirstBouncePhotonConeAngle"), Scene.ImportanceTracingSettings.AdaptiveFirstBouncePhotonConeAngle, GLightmassIni));
VERIFYLIGHTMASSINI(GConfig->GetFloat(TEXT("DevOptions.ImportanceTracing"), TEXT("AdaptiveSkyVarianceThreshold"), Scene.ImportanceTracingSettings.AdaptiveSkyVarianceThreshold, GLightmassIni));
float AdaptiveFirstBouncePhotonConeAngle;
VERIFYLIGHTMASSINI(GConfig->GetFloat(TEXT("DevOptions.ImportanceTracing"), TEXT("AdaptiveFirstBouncePhotonConeAngle"), AdaptiveFirstBouncePhotonConeAngle, GLightmassIni));
Scene.ImportanceTracingSettings.AdaptiveFirstBouncePhotonConeAngle = FMath::Clamp(AdaptiveFirstBouncePhotonConeAngle, 0.0f, 90.0f) * (float)PI / 180.0f;
VERIFYLIGHTMASSINI(GConfig->GetBool(TEXT("DevOptions.ImportanceTracing"), TEXT("bUseRadiositySolverForSkylightMultibounce"), Scene.ImportanceTracingSettings.bUseRadiositySolverForSkylightMultibounce, GLightmassIni));
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Lightmass/Lightmass.cpp:2494
Scope (from outer to inner):
file
function void FLightmassExporter::WriteSceneSettings
Source code excerpt:
float AdaptiveSkyVarianceThresholdScale;
VERIFYLIGHTMASSINI(GConfig->GetFloat(QualitySectionNames[QualityLevel], TEXT("AdaptiveSkyVarianceThresholdScale"), AdaptiveSkyVarianceThresholdScale, GLightmassIni));
Scene.ImportanceTracingSettings.AdaptiveSkyVarianceThreshold = Scene.ImportanceTracingSettings.AdaptiveSkyVarianceThreshold * AdaptiveSkyVarianceThresholdScale;
}
}
/** Fills InputData with debug information */
void FLightmassExporter::WriteDebugInput( Lightmass::FDebugLightingInputData& InputData, FGuid& DebugMappingGuid )
{
#Loc: <Workspace>/Engine/Source/Programs/UnrealLightmass/Private/Lighting/FinalGather.cpp:662
Scope (from outer to inner):
file
namespace Lightmass
class class FUniformHemisphereRefinementGrid
function void RefineIncomingRadiance
Source code excerpt:
float SkyOcclusionThreshold = LightingSystem.ImportanceTracingSettings.AdaptiveBrightnessThreshold * BrightnessThresholdScale;
bool bRefineForSkyOcclusion = LightingSystem.SkyLights.Num() > 0;
float SkyVarianceThreshold = LightingSystem.ImportanceTracingSettings.AdaptiveSkyVarianceThreshold;
// This is basically disabled, causes too much noise in worst case scenarios (all GI coming from small bright spot)
float ConeWeightThreshold = .006f;
// Operate on all cells at a refinement depth before going deeper
// This is necessary for the neighbor comparisons to work right
#Loc: <Workspace>/Engine/Source/Programs/UnrealLightmass/Public/SceneExport.h:534
Scope (from outer to inner):
file
namespace Lightmass
class class FImportanceTracingSettings
Source code excerpt:
float AdaptiveFirstBouncePhotonConeAngle;
float AdaptiveSkyVarianceThreshold;
/**
* Whether to use radiosity iterations for solving skylight 2nd bounce and up, plus emissive 1st bounce and up.
* These light sources are not represented by photons so they need to be handled separately to have multiple bounces.
*/
bool bUseRadiositySolverForSkylightMultibounce;