VoxelizationCellExpansionForVolumeGeometry
VoxelizationCellExpansionForVolumeGeometry
#Overview
name: VoxelizationCellExpansionForVolumeGeometry
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 VoxelizationCellExpansionForVolumeGeometry is to control the expansion of voxel cells when processing volume geometry in Unreal Engine’s volumetric lightmap system. This setting is part of the lighting and rendering subsystem, specifically related to the volumetric lightmap generation process.
This setting variable is primarily used in the Lightmass module, which is responsible for global illumination and lightmap generation in Unreal Engine. It’s referenced in both the editor-side code (UnrealEd) and the Lightmass program itself.
The value of this variable is set through the engine’s configuration system. It’s read from the “DevOptions.VolumetricLightmaps” section of the Lightmass configuration file (GLightmassIni) using the GConfig->GetFloat() function.
VoxelizationCellExpansionForVolumeGeometry interacts with other similar variables, such as VoxelizationCellExpansionForSurfaceGeometry and VoxelizationCellExpansionForLights. These variables together control how voxel cells are expanded for different types of geometry and lighting elements.
Developers should be aware that this variable directly affects the precision and performance of volumetric lightmap generation. A larger value will expand the voxel cells more, potentially capturing more geometry but at the cost of increased computation time and memory usage.
Best practices when using this variable include:
- Keep the value as low as possible while still achieving desired quality to optimize performance.
- Test different values to find the right balance between quality and performance for your specific scene.
- Consider the scale of your scene when adjusting this value, as larger scenes might require different settings compared to smaller ones.
- Always ensure the value is non-negative, as the engine clamps it to a minimum of 0.0f.
- Adjust this value in conjunction with related settings like VoxelizationCellExpansionForSurfaceGeometry for consistent results.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseLightmass.ini:96, section: [DevOptions.VolumetricLightmaps]
- INI Section:
DevOptions.VolumetricLightmaps
- Raw value:
.25
- 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:2056
Scope (from outer to inner):
file
function void FLightmassExporter::SetVolumetricLightmapSettings
Source code excerpt:
VERIFYLIGHTMASSINI(GConfig->GetInt(TEXT("DevOptions.VolumetricLightmaps"), TEXT("MaxRefinementLevels"), OutSettings.MaxRefinementLevels, GLightmassIni));
VERIFYLIGHTMASSINI(GConfig->GetFloat(TEXT("DevOptions.VolumetricLightmaps"), TEXT("VoxelizationCellExpansionForSurfaceGeometry"), OutSettings.VoxelizationCellExpansionForSurfaceGeometry, GLightmassIni));
VERIFYLIGHTMASSINI(GConfig->GetFloat(TEXT("DevOptions.VolumetricLightmaps"), TEXT("VoxelizationCellExpansionForVolumeGeometry"), OutSettings.VoxelizationCellExpansionForVolumeGeometry, GLightmassIni));
VERIFYLIGHTMASSINI(GConfig->GetFloat(TEXT("DevOptions.VolumetricLightmaps"), TEXT("VoxelizationCellExpansionForLights"), OutSettings.VoxelizationCellExpansionForLights, GLightmassIni));
VERIFYLIGHTMASSINI(GConfig->GetFloat(TEXT("DevOptions.VolumetricLightmaps"), TEXT("MinBrickError"), OutSettings.MinBrickError, GLightmassIni));
VERIFYLIGHTMASSINI(GConfig->GetFloat(TEXT("DevOptions.VolumetricLightmaps"), TEXT("SurfaceLightmapMinTexelsPerVoxelAxis"), OutSettings.SurfaceLightmapMinTexelsPerVoxelAxis, GLightmassIni));
VERIFYLIGHTMASSINI(GConfig->GetBool(TEXT("DevOptions.VolumetricLightmaps"), TEXT("bCullBricksBelowLandscape"), OutSettings.bCullBricksBelowLandscape, GLightmassIni));
VERIFYLIGHTMASSINI(GConfig->GetFloat(TEXT("DevOptions.VolumetricLightmaps"), TEXT("LightBrightnessSubdivideThreshold"), OutSettings.LightBrightnessSubdivideThreshold, GLightmassIni));
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Lightmass/Lightmass.cpp:2071
Scope (from outer to inner):
file
function void FLightmassExporter::SetVolumetricLightmapSettings
Source code excerpt:
OutSettings.MaxRefinementLevels = FMath::Clamp(OutSettings.MaxRefinementLevels, 1, 6);
OutSettings.VoxelizationCellExpansionForSurfaceGeometry = FMath::Max(OutSettings.VoxelizationCellExpansionForSurfaceGeometry, 0.0f);
OutSettings.VoxelizationCellExpansionForVolumeGeometry = FMath::Max(OutSettings.VoxelizationCellExpansionForVolumeGeometry, 0.0f);
OutSettings.VoxelizationCellExpansionForLights = FMath::Max(OutSettings.VoxelizationCellExpansionForLights, 0.0f);
const float TargetDetailCellSize = WorldInfoSettings.VolumetricLightmapDetailCellSize;
FIntVector FullGridSize(
FMath::TruncToInt(2 * ImportanceExtent.X / TargetDetailCellSize) + 1,
#Loc: <Workspace>/Engine/Source/Programs/UnrealLightmass/Private/Lighting/AdaptiveVolumetricLightmap.cpp:133
Scope (from outer to inner):
file
namespace Lightmass
function bool FStaticLightingSystem::DoesVoxelIntersectSceneGeometry
Source code excerpt:
const FBox3f ExpandedCellBoundsSurfaceGeometry = CellBounds.ExpandBy(CellBounds.GetSize() * VolumetricLightmapSettings.VoxelizationCellExpansionForSurfaceGeometry);
const FBox3f ExpandedCellBoundsVolumeGeometry = CellBounds.ExpandBy(CellBounds.GetSize() * VolumetricLightmapSettings.VoxelizationCellExpansionForVolumeGeometry);
if (Scene.GeneralSettings.bUseFastVoxelization)
{
const FStaticLightingMesh* Mesh = nullptr;
Mesh = VoxelizationSurfaceAggregateMesh->IntersectBox(ExpandedCellBoundsSurfaceGeometry);
if (Mesh != nullptr)
#Loc: <Workspace>/Engine/Source/Programs/UnrealLightmass/Public/SceneExport.h:357
Scope (from outer to inner):
file
namespace Lightmass
class class FVolumetricLightmapSettings
Source code excerpt:
*/
float VoxelizationCellExpansionForSurfaceGeometry;
float VoxelizationCellExpansionForVolumeGeometry;
float VoxelizationCellExpansionForLights;
/** Bricks with RMSE below this value are culled. */
float MinBrickError;
/** Triangles with fewer lightmap texels than this don't cause refinement. */