bVisualizePrecomputedVisibility
bVisualizePrecomputedVisibility
#Overview
name: bVisualizePrecomputedVisibility
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 bVisualizePrecomputedVisibility is to enable visualization of precomputed visibility data in Unreal Engine 5. This setting is primarily used for debugging and development purposes within the precomputed visibility system, which is part of the lighting and performance optimization features of the engine.
This setting variable is mainly relied upon by the Lightmass subsystem, which is responsible for global illumination and precomputed lighting calculations in Unreal Engine. It is used in both the editor-side code (UnrealEd module) and the Lightmass standalone program.
The value of this variable is set in the Lightmass configuration file (GLightmassIni). It is read from the “DevOptions.PrecomputedVisibility” section of this configuration file.
bVisualizePrecomputedVisibility interacts with other precomputed visibility settings, such as bPlaceCellsOnOpaqueOnly and bPlaceCellsOnlyAlongCameraTracks. It also works in conjunction with the VisibilityCellSize setting from the World Settings.
Developers must be aware that this variable is primarily for development and debugging purposes. Enabling it may have performance implications and should not be used in release builds or final game configurations.
Best practices when using this variable include:
- Only enable it when actively debugging or analyzing precomputed visibility issues.
- Use it in conjunction with other visibility debugging tools and settings for a comprehensive understanding of the visibility system.
- Remember to disable it before finalizing a build or creating release configurations.
- Be cautious when modifying related settings, as they can impact the effectiveness and accuracy of the precomputed visibility system.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseLightmass.ini:105, section: [DevOptions.PrecomputedVisibility]
- INI Section:
DevOptions.PrecomputedVisibility
- 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:2275
Scope (from outer to inner):
file
function void FLightmassExporter::WriteSceneSettings
Source code excerpt:
}
{
VERIFYLIGHTMASSINI(GConfig->GetBool(TEXT("DevOptions.PrecomputedVisibility"), TEXT("bVisualizePrecomputedVisibility"), bConfigBool, GLightmassIni));
Scene.PrecomputedVisibilitySettings.bVisualizePrecomputedVisibility = bConfigBool;
VERIFYLIGHTMASSINI(GConfig->GetBool(TEXT("DevOptions.PrecomputedVisibility"), TEXT("bPlaceCellsOnOpaqueOnly"), bConfigBool, GLightmassIni));
Scene.PrecomputedVisibilitySettings.bPlaceCellsOnOpaqueOnly = bConfigBool;
Scene.PrecomputedVisibilitySettings.bPlaceCellsOnlyAlongCameraTracks = World->GetWorldSettings()->bPlaceCellsOnlyAlongCameraTracks;
Scene.PrecomputedVisibilitySettings.CellSize = World->GetWorldSettings()->VisibilityCellSize;
VERIFYLIGHTMASSINI(GConfig->GetInt(TEXT("DevOptions.PrecomputedVisibility"), TEXT("NumCellDistributionBuckets"), Scene.PrecomputedVisibilitySettings.NumCellDistributionBuckets, GLightmassIni));
VERIFYLIGHTMASSINI(GConfig->GetFloat(TEXT("DevOptions.PrecomputedVisibility"), TEXT("PlayAreaHeight"), Scene.PrecomputedVisibilitySettings.PlayAreaHeight, GLightmassIni));
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Lightmass/Lightmass.cpp:2525
Scope (from outer to inner):
file
function void FLightmassExporter::WriteDebugInput
Source code excerpt:
InputData.CameraPosition = (FVector4f)ViewPosition;
int32 DebugVisibilityId = INDEX_NONE;
bool bVisualizePrecomputedVisibility = false;
VERIFYLIGHTMASSINI(GConfig->GetBool(TEXT("DevOptions.PrecomputedVisibility"), TEXT("bVisualizePrecomputedVisibility"), bVisualizePrecomputedVisibility, GLightmassIni));
if (bVisualizePrecomputedVisibility)
{
for (FSelectedActorIterator It(World); It; ++It)
{
for (UActorComponent* Comp : It->GetComponents())
{
if (UPrimitiveComponent* Component = Cast<UPrimitiveComponent>(Comp))
#Loc: <Workspace>/Engine/Source/Programs/UnrealLightmass/Private/Lighting/PrecomputedVisibility.cpp:1075
Scope (from outer to inner):
file
namespace Lightmass
function void FStaticLightingSystem::CalculatePrecomputedVisibility
Source code excerpt:
FPrecomputedVisibilityCell& CurrentCell = DataLink->Element.PrecomputedVisibilityCells.Last();
const bool bDebugThisCell = CurrentCell.Bounds.IsInside(Scene.DebugInput.CameraPosition) && PrecomputedVisibilitySettings.bVisualizePrecomputedVisibility;
AffectingOverrideVolumes.Reset();
for (int32 VolumeIndex = 0; VolumeIndex < Scene.PrecomputedVisibilityOverrideVolumes.Num(); VolumeIndex++)
{
if (Scene.PrecomputedVisibilityOverrideVolumes[VolumeIndex].Bounds.Intersect(CurrentCell.Bounds))
{
#Loc: <Workspace>/Engine/Source/Programs/UnrealLightmass/Public/SceneExport.h:382
Scope (from outer to inner):
file
namespace Lightmass
class class FPrecomputedVisibilitySettings
Source code excerpt:
/** Whether to export debug lines for visibility. */
bool bVisualizePrecomputedVisibility;
/** Whether to only place visibility cells on opaque surfaces. */
bool bPlaceCellsOnOpaqueOnly;
/** Whether to place visibility cells only along camera tracks or to also include shadow casting surfaces. */
bool bPlaceCellsOnlyAlongCameraTracks;