RenderLightMapDensityColorScale

RenderLightMapDensityColorScale

#Overview

name: RenderLightMapDensityColorScale

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 RenderLightMapDensityColorScale is to control the color scale factor when rendering lightmap density in Unreal Engine 5. This variable is primarily used in the rendering system, specifically for visualizing lightmap density in the editor.

The Unreal Engine subsystems that rely on this setting variable are:

  1. The Level Editor module, as seen in the LevelEditorActions.cpp file.
  2. The Engine core, as it’s defined in the Engine.h file.
  3. The Renderer module, where it’s used in lightmap density rendering calculations.

The value of this variable is set in two ways:

  1. It can be set through the engine configuration files, as indicated by the UPROPERTY(globalconfig) attribute in the Engine.h file.
  2. It can be dynamically modified at runtime through the SetLightingDensityColorScale function in the LevelEditorActions.cpp file.

This variable interacts with other related variables, such as:

  1. RenderLightMapDensityGrayscaleScale
  2. bRenderLightMapDensityGrayscale

Developers should be aware of the following when using this variable:

  1. It directly affects the visual representation of lightmap density in the editor.
  2. Changes to this value will trigger a redraw of all viewports, as seen in the SetLightingDensityColorScale function.
  3. It’s used in combination with other lightmap density rendering options to determine the final visual output.

Best practices when using this variable include:

  1. Adjusting it in conjunction with other lightmap density settings to achieve the desired visualization.
  2. Being mindful of performance impacts when frequently changing this value, as it triggers viewport redraws.
  3. Using it as a tool for optimizing lightmap usage and quality in your levels.
  4. Documenting any custom values used in your project for consistency across the development team.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEngine.ini:292, section: [/Script/Engine.Engine]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Editor/LevelEditor/Private/LevelEditorActions.cpp:999

Scope (from outer to inner):

file
function     float FLevelEditorActionCallbacks::GetLightingDensityColorScale

Source code excerpt:

float FLevelEditorActionCallbacks::GetLightingDensityColorScale()
{
	return ( GEngine->RenderLightMapDensityColorScale );
}

void FLevelEditorActionCallbacks::SetLightingDensityColorScale( float Value )
{
	GEngine->RenderLightMapDensityColorScale = Value;

	FEditorSupportDelegates::RedrawAllViewports.Broadcast();
}

float FLevelEditorActionCallbacks::GetLightingDensityGrayscaleScale()
{

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/Engine/Engine.h:1280

Scope (from outer to inner):

file
class        class UEngine : public UObject , public FExec

Source code excerpt:

	/** The scale factor when rendering color density. */
	UPROPERTY(globalconfig)
	float RenderLightMapDensityColorScale;

	/** The color to render vertex mapped objects in for LightMap Density view mode. */
	UPROPERTY(globalconfig)
	FLinearColor LightMapDensityVertexMappedColor;

	/** The color to render selected objects in for LightMap Density view mode. */

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/LightMapDensityRendering.h:146

Scope (from outer to inner):

file
class        class TLightMapDensityPS : public FMeshMaterialShader, public LightMapPolicyType::PixelParametersType
function     void GetShaderBindings

Source code excerpt:

		FVector4f OptionsParameter(
			GEngine->bRenderLightMapDensityGrayscale ? GEngine->RenderLightMapDensityGrayscaleScale : 0.0f,
			GEngine->bRenderLightMapDensityGrayscale ? 0.0f : GEngine->RenderLightMapDensityColorScale,
			(ShaderElementData.bTextureMapped == true) ? 1.0f : 0.0f,
			(ShaderElementData.bTextureMapped == false) ? 1.0f : 0.0f
			);
		ShaderBindings.Add(LightMapDensityDisplayOptions, OptionsParameter);
	}