r.IESAtlas.Resolution

r.IESAtlas.Resolution

#Overview

name: r.IESAtlas.Resolution

This variable is created as a Console Variable (cvar).

It is referenced in 4 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of r.IESAtlas.Resolution is to set the resolution for storing IES (Illuminating Engineering Society) textures in Unreal Engine 5. This setting variable is primarily used in the rendering system, specifically for managing IES textures.

The Unreal Engine subsystem that relies on this setting variable is the Renderer module, as evidenced by its usage in the IESTextureManager.cpp file within the Runtime/Renderer/Private directory.

The value of this variable is set through a console variable (CVarIESTextureResolution) with a default value of 256. It can be modified at runtime using console commands or through configuration files.

This variable interacts closely with another variable called CVarIESTextureMaxProfileCount, which sets the maximum number of IES profiles that can be stored in the atlas texture.

Developers must be aware that changing this variable affects the resolution of IES textures stored in the atlas. A higher resolution will provide more detailed lighting profiles but may consume more memory and potentially impact performance.

Best practices when using this variable include:

  1. Balancing quality and performance by choosing an appropriate resolution.
  2. Considering the target hardware capabilities when setting this value.
  3. Testing different resolutions to find the optimal balance between visual quality and performance for your specific use case.

Regarding the associated variable CVarIESTextureResolution:

The purpose of CVarIESTextureResolution is to provide a programmatic way to access and modify the r.IESAtlas.Resolution setting. It is implemented as a console variable that can be accessed and modified at runtime.

This variable is used within the IESAtlas namespace to determine when the atlas texture needs to be updated or recreated. It’s compared against a cached value to detect changes in the resolution setting.

The value of CVarIESTextureResolution is typically set when the engine initializes, but it can be modified at runtime using console commands.

Developers should be aware that changes to CVarIESTextureResolution will trigger a recreation of the IES texture atlas, which could have performance implications if done frequently.

Best practices for using CVarIESTextureResolution include:

  1. Avoiding frequent changes during gameplay to prevent performance hitches.
  2. Using it in conjunction with CVarIESTextureMaxProfileCount to optimize the IES texture atlas for your specific needs.
  3. Considering the impact on memory usage and rendering performance when modifying this value.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/IESTextureManager.cpp:26

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarIESTextureResolution(
	TEXT("r.IESAtlas.Resolution"),
	256,
	TEXT("Resolution for storing IES textures.\n"),
	ECVF_RenderThreadSafe);

static TAutoConsoleVariable<int32> CVarIESTextureMaxProfileCount(
	TEXT("r.IESAtlas.MaxProfileCount"),

#Associated Variable and Callsites

This variable is associated with another variable named CVarIESTextureResolution. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/IESTextureManager.cpp:25

Scope: file

Source code excerpt:

// Config

static TAutoConsoleVariable<int32> CVarIESTextureResolution(
	TEXT("r.IESAtlas.Resolution"),
	256,
	TEXT("Resolution for storing IES textures.\n"),
	ECVF_RenderThreadSafe);

static TAutoConsoleVariable<int32> CVarIESTextureMaxProfileCount(

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/IESTextureManager.cpp:491

Scope (from outer to inner):

file
namespace    IESAtlas
function     void UpdateAtlasTexture

Source code excerpt:

{
	// Force update by resetting the atlas layout
	static uint32 CachedAtlasResolution = CVarIESTextureResolution.GetValueOnRenderThread();
	static uint32 CachedAtlasMaxSlice = CVarIESTextureMaxProfileCount.GetValueOnRenderThread();
	const bool bHasSettingChanged = CachedAtlasResolution != CVarIESTextureResolution.GetValueOnRenderThread() || CachedAtlasMaxSlice != CVarIESTextureMaxProfileCount.GetValueOnRenderThread();

	// 1. Determine if a new atlas texture allocation is needed: If there are new entries, ensure it can fit into the atlas
	bool bForceRecreate = false;
	uint32 RequestedSliceCount = 0;
	if (GIESTextureManager.bHasPendingAdds)
	{

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/IESTextureManager.cpp:511

Scope (from outer to inner):

file
namespace    IESAtlas
function     void UpdateAtlasTexture

Source code excerpt:

	if (bForceUpdate)
	{
		CachedAtlasResolution = CVarIESTextureResolution.GetValueOnRenderThread();
		CachedAtlasMaxSlice = CVarIESTextureMaxProfileCount.GetValueOnRenderThread();
		InvalidateSlots(GIESTextureManager, RequestedSliceCount);
	}
	else 
	{
		// Force update if among the existing valid slot a streamed a higher resolution than the existing one