bUseUnlitScene

bUseUnlitScene

#Overview

name: bUseUnlitScene

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 bUseUnlitScene is to control the lighting conditions when rendering world thumbnails in Unreal Engine 5. It is specifically used in the thumbnail rendering system for world assets.

This setting variable is primarily used by the UnrealEd module, specifically within the WorldThumbnailRenderer class. This class is responsible for generating thumbnail previews of world assets in the Unreal Editor.

The value of this variable is set in the constructor of the UWorldThumbnailRenderer class, where it is initialized to false. However, being marked with the UPROPERTY(config) macro, it can also be configured through the engine’s configuration files.

bUseUnlitScene interacts closely with another variable, bAllowWorldThumbnails. While bAllowWorldThumbnails determines whether world thumbnails are rendered at all, bUseUnlitScene affects the lighting conditions of these thumbnails when they are rendered.

Developers must be aware that when bUseUnlitScene is set to true, all world thumbnails will be rendered without lighting calculations. This can be particularly useful in games that have shared lighting in a common map, as it provides a consistent appearance for world thumbnails regardless of the lighting conditions in the individual worlds.

Best practices when using this variable include:

  1. Consider setting bUseUnlitScene to true if your game uses shared lighting across multiple maps, to ensure consistent thumbnail appearances.
  2. Be aware that setting this to true will result in thumbnails that may not accurately represent the final lit appearance of the world.
  3. Use in conjunction with bAllowWorldThumbnails to control both the presence and appearance of world thumbnails.
  4. Remember that changes to this variable will affect all world thumbnails in the project, so consider the impact on the entire asset library before modifying it.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEditor.ini:138, section: [/Script/UnrealEd.WorldThumbnailRenderer]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Classes/ThumbnailRendering/WorldThumbnailRenderer.h:41

Scope (from outer to inner):

file
class        class UWorldThumbnailRenderer : public UDefaultSizedThumbnailRenderer

Source code excerpt:

	/** If true, all world thumbnails will be rendered unlit. This is useful in games that have shared lighting in a common map */
	UPROPERTY(config)
	bool bUseUnlitScene;

	/** If false, all world thumbnails rendering will be disabled */
	UPROPERTY(config)
	bool bAllowWorldThumbnails;
};

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/ThumbnailRendering/WorldThumbnailRenderer.cpp:18

Scope (from outer to inner):

file
function     UWorldThumbnailRenderer::UWorldThumbnailRenderer

Source code excerpt:

	GlobalOrbitPitchOffset = 0.f;
	GlobalOrbitYawOffset = 0.f;
	bUseUnlitScene = false;
	bAllowWorldThumbnails = false;
}

bool UWorldThumbnailRenderer::CanVisualizeAsset(UObject* Object)
{
	if (bAllowWorldThumbnails)

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/ThumbnailRendering/WorldThumbnailRenderer.cpp:63

Scope (from outer to inner):

file
function     void UWorldThumbnailRenderer::Draw

Source code excerpt:

		ViewFamily.EngineShowFlags.SetDistanceCulledPrimitives(true);

		if ( !bUseUnlitScene )
		{
			ViewFamily.EngineShowFlags.SetSpecular(true);
			ViewFamily.EngineShowFlags.SetLighting(true);
			ViewFamily.EngineShowFlags.SetDirectLighting(true);
			ViewFamily.EngineShowFlags.SetIndirectLightingCache(true);
			ViewFamily.EngineShowFlags.SetDeferredLighting(true);