InterpolateTaskSize

InterpolateTaskSize

#Overview

name: InterpolateTaskSize

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 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of InterpolateTaskSize is to control the size of tasks for irradiance cache interpolation in Unreal Engine’s lightmass system. This setting is primarily used for the lighting and rendering system, specifically for the global illumination calculations.

This setting variable is relied upon by the Unreal Engine’s lightmass subsystem, which is responsible for pre-computing global illumination for static lighting. It’s used in both the editor (UnrealEd) and the standalone Unreal Lightmass program.

The value of this variable is set in the Lightmass configuration file (GLightmassIni). It’s read from the “DevOptions.IrradianceCache” section with the key “InterpolateTaskSize”.

InterpolateTaskSize interacts with other irradiance caching settings, such as CacheTaskSize and MaxRecordRadius. It’s used in conjunction with these to control the balance between performance and quality in the lightmass calculations.

Developers must be aware that this variable directly affects the parallelization of irradiance cache interpolation. A smaller value will result in more parallel tasks, potentially improving performance on multi-core systems, while a larger value will reduce parallelism.

Best practices when using this variable include:

  1. Adjusting it based on the available hardware. Systems with more cores may benefit from smaller values to increase parallelism.
  2. Balancing it with other irradiance cache settings for optimal performance and quality.
  3. Using larger values (like 4096) for debugging purposes, as it effectively makes the interpolation single-threaded for a given mapping.
  4. Considering the size of the textures being processed. The variable should be set to a value that divides the texture dimensions evenly for best results.
  5. Experimenting with different values to find the optimal balance between performance and quality for specific scenes and hardware configurations.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseLightmass.ini:222, section: [DevOptions.IrradianceCache]

#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:2413

Scope (from outer to inner):

file
function     void FLightmassExporter::WriteSceneSettings

Source code excerpt:

		VERIFYLIGHTMASSINI(GConfig->GetFloat(TEXT("DevOptions.IrradianceCache"), TEXT("MaxRecordRadius"), Scene.IrradianceCachingSettings.MaxRecordRadius, GLightmassIni));
		VERIFYLIGHTMASSINI(GConfig->GetInt(TEXT("DevOptions.IrradianceCache"), TEXT("CacheTaskSize"), Scene.IrradianceCachingSettings.CacheTaskSize, GLightmassIni));
		VERIFYLIGHTMASSINI(GConfig->GetInt(TEXT("DevOptions.IrradianceCache"), TEXT("InterpolateTaskSize"), Scene.IrradianceCachingSettings.InterpolateTaskSize, GLightmassIni));
	}

	// Modify settings based on the quality level required
	// Preview is assumed to have a scale of 1 for all settings and therefore is not in the ini
	if (QualityLevel != Quality_Preview)
	{

#Loc: <Workspace>/Engine/Source/Programs/UnrealLightmass/Private/Lighting/TextureMapping.cpp:3138

Scope (from outer to inner):

file
namespace    Lightmass
function     void FStaticLightingSystem::CalculateIndirectLightingTextureMapping

Source code excerpt:

		if (IrradianceCachingSettings.bAllowIrradianceCaching)
		{
			const int32 InterpolationTaskSize = IrradianceCachingSettings.InterpolateTaskSize;
			int32 NumIILTasksSubmitted = 0;

			// Break this mapping into multiple interpolation tasks in texture space blocks
			for (int32 TaskY = 0; TaskY < TextureMapping->CachedSizeY; TaskY += InterpolationTaskSize)
			{
				for (int32 TaskX = 0; TaskX < TextureMapping->CachedSizeX; TaskX += InterpolationTaskSize)

#Loc: <Workspace>/Engine/Source/Programs/UnrealLightmass/Public/SceneExport.h:773

Scope (from outer to inner):

file
namespace    Lightmass
class        class FIrradianceCachingSettings

Source code excerpt:

	 * Setting this to a large value like 4096 will effectively make the irradiance cache interpolation single threaded for a given mapping, which is useful for debugging.
	 */
	int32 InterpolateTaskSize;
};

struct FDebugLightingInputData
{
	/** Whether the solver should send stats back to Unreal */
	bool bRelaySolverStats;