RenderLightMapDensityGrayscaleScale
RenderLightMapDensityGrayscaleScale
#Overview
name: RenderLightMapDensityGrayscaleScale
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 RenderLightMapDensityGrayscaleScale is to control the scale factor when rendering lightmap density in grayscale mode within Unreal Engine’s rendering system.
This setting variable is primarily used by the rendering system, specifically in the context of lightmap density visualization. It is utilized by the Level Editor and the Renderer module of Unreal Engine.
The value of this variable is set in the Engine configuration (as indicated by the UPROPERTY(globalconfig) attribute) and can be modified through the Level Editor actions. The SetLightingDensityGrayscaleScale function in LevelEditorActions.cpp demonstrates how this value can be updated at runtime.
RenderLightMapDensityGrayscaleScale interacts with other variables, notably:
- RenderLightMapDensityColorScale, which is used when rendering lightmap density in color mode.
- bRenderLightMapDensityGrayscale, a boolean that determines whether to use grayscale or color mode.
Developers should be aware that:
- This variable directly affects the visual representation of lightmap density in the editor.
- Changes to this value will trigger a redraw of all viewports (as seen in the SetLightingDensityGrayscaleScale function).
- The value is used in shader calculations, so performance impact should be considered when modifying it frequently.
Best practices when using this variable include:
- Adjust the value carefully to achieve the desired visual clarity in lightmap density visualization.
- Consider the interplay between grayscale and color modes when fine-tuning lightmap density display.
- Use this in conjunction with other lightmap density settings for comprehensive lightmap quality assessment.
- Remember that extreme values might make the visualization less useful, so maintain a balance for optimal utility.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEngine.ini:291, section: [/Script/Engine.Engine]
- INI Section:
/Script/Engine.Engine
- Raw value:
1.0
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Editor/LevelEditor/Private/LevelEditorActions.cpp:1011
Scope (from outer to inner):
file
function float FLevelEditorActionCallbacks::GetLightingDensityGrayscaleScale
Source code excerpt:
float FLevelEditorActionCallbacks::GetLightingDensityGrayscaleScale()
{
return ( GEngine->RenderLightMapDensityGrayscaleScale );
}
void FLevelEditorActionCallbacks::SetLightingDensityGrayscaleScale( float Value )
{
GEngine->RenderLightMapDensityGrayscaleScale = Value;
FEditorSupportDelegates::RedrawAllViewports.Broadcast();
}
void FLevelEditorActionCallbacks::SetLightingDensityRenderGrayscale()
{
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Classes/Engine/Engine.h:1276
Scope (from outer to inner):
file
class class UEngine : public UObject , public FExec
Source code excerpt:
/** The scale factor when rendering gray scale density. */
UPROPERTY(globalconfig)
float RenderLightMapDensityGrayscaleScale;
/** The scale factor when rendering color density. */
UPROPERTY(globalconfig)
float RenderLightMapDensityColorScale;
/** The color to render vertex mapped objects in for LightMap Density view mode. */
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/LightMapDensityRendering.h:145
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);
}