ShowFlag.Cloud

ShowFlag.Cloud

#Overview

name: ShowFlag.Cloud

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

It is referenced in 5 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of ShowFlag.Cloud is to control the rendering of volumetric clouds in Unreal Engine’s rendering system. This setting variable is part of the engine’s show flags, which are used to toggle various rendering features on and off.

The Unreal Engine subsystem that primarily relies on this setting variable is the rendering system, specifically the volumetric cloud rendering module. This can be seen in the callsite located in the VolumetricCloudRendering.cpp file.

The value of this variable is set through the engine’s show flags system. It is defined as a fixed show flag in shipping builds with a default value of 1 (enabled) in the ShowFlagsValues.inl file.

This variable interacts with other show flags, particularly the Atmosphere show flag. In the ShouldRenderVolumetricCloud function, both ShowFlag.Atmosphere and ShowFlag.Cloud must be true for volumetric clouds to be rendered.

Developers must be aware that this flag controls the visibility of volumetric clouds in the scene. Disabling this flag will prevent volumetric clouds from rendering, which can be useful for performance optimization or debugging purposes.

Best practices when using this variable include:

  1. Use it in conjunction with the Atmosphere show flag for a complete sky rendering.
  2. Consider its performance impact, as volumetric cloud rendering can be resource-intensive.
  3. Use it for debugging or isolating rendering issues related to volumetric clouds.

Regarding the associated variable ‘Cloud’:

The purpose of the Cloud variable appears to be related to file system operations, particularly in the context of the HTTP Chunk Installer and Build Patch Services. It is used to define directory paths for cloud-related content and operations.

This variable is used in the HTTPChunkInstaller and BuildPatchServices modules. It’s primarily used for defining file paths and directories for cloud-related operations, such as content staging, installation, and caching.

The value of this variable is typically set during the initialization of these systems, often reading from configuration files or using default paths based on the project structure.

Developers should be aware that this variable is crucial for proper file management in cloud-related operations, particularly for content delivery and patching systems.

Best practices include:

  1. Ensure proper configuration of cloud directories in the relevant config files.
  2. Be mindful of storage requirements and permissions for these directories.
  3. Consider platform-specific needs when setting up these paths.

It’s important to note that while these two variables share the same name, they are used in different contexts within the engine and should not be confused with each other.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:299

Scope: file

Source code excerpt:

SHOWFLAG_ALWAYS_ACCESSIBLE(Atmosphere, SFG_Normal, NSLOCTEXT("UnrealEd", "AtmosphereSF", "Atmosphere"))
/** Render Cloud */
SHOWFLAG_FIXED_IN_SHIPPING(1, Cloud, SFG_Normal, NSLOCTEXT("UnrealEd", "CloudSF", "Cloud"))
/** Render safe frames bars*/
SHOWFLAG_FIXED_IN_SHIPPING(0, CameraAspectRatioBars, SFG_Advanced, NSLOCTEXT("UnrealEd", "CameraAspectRatioBarsSF", "Camera Aspect Ratio Bars"))
/** Render safe frames */
SHOWFLAG_FIXED_IN_SHIPPING(1, CameraSafeFrames, SFG_Advanced, NSLOCTEXT("UnrealEd", "CameraSafeFramesSF", "Camera Safe Frames"))
/** Render TextRenderComponents (3D text), for now SHOWFLAG_ALWAYS_ACCESSIBLE because it's exposed in SceneCapture */
SHOWFLAG_ALWAYS_ACCESSIBLE(TextRender, SFG_Advanced, NSLOCTEXT("UnrealEd", "TextRenderSF", "Render (3D) Text"))

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Plugins/Runtime/HTTPChunkInstaller/Source/Private/HTTPChunkInstaller.cpp:1624

Scope (from outer to inner):

file
function     void FHTTPChunkInstall::InitialiseSystem

Source code excerpt:

#if !UE_BUILD_SHIPPING
		bDebugNoInstalledRequired = !bGetConfigDir;
#endif
	}
	CloudDirectory = TEXT("");
	CloudDir = FPaths::Combine(*FPaths::ProjectContentDir(), TEXT("Cloud"));
	StageDir = FPaths::Combine(*FPaths::ProjectSavedDir(), TEXT("Chunks"), TEXT("Staged"));
	InstallDir = FPaths::Combine(*FPaths::ProjectSavedDir(), TEXT("Chunks"), TEXT("Installed")); // By default this should match ContentDir
	BackupDir = FPaths::Combine(*FPaths::ProjectSavedDir(), TEXT("Chunks"), TEXT("Backup"));
	CacheDir = FPaths::Combine(*FPaths::ProjectSavedDir(), TEXT("Chunks"), TEXT("Cache"));
	HoldingDir = FPaths::Combine(*FPaths::ProjectSavedDir(), TEXT("Chunks"), TEXT("Hold"));
	ContentDir = FPaths::Combine(*FPaths::ProjectSavedDir(), TEXT("Chunks"), TEXT("Installed")); // By default this should match InstallDir

	FString TmpString1;
	FString TmpString2;
	if (GConfig->GetString(TEXT("HTTPChunkInstall"), TEXT("CloudDirectory"), TmpString1, GEngineIni))
	{

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:296

Scope: file

Source code excerpt:

/** Render the PostProcess Material */
SHOWFLAG_FIXED_IN_SHIPPING(1, PostProcessMaterial, SFG_PostProcess, NSLOCTEXT("UnrealEd", "PostProcessMaterialSF", "Post Process Material"))
/** Render Sky and Atmospheric lighting, for now SHOWFLAG_ALWAYS_ACCESSIBLE because it's exposed in SceneCapture */
SHOWFLAG_ALWAYS_ACCESSIBLE(Atmosphere, SFG_Normal, NSLOCTEXT("UnrealEd", "AtmosphereSF", "Atmosphere"))
/** Render Cloud */
SHOWFLAG_FIXED_IN_SHIPPING(1, Cloud, SFG_Normal, NSLOCTEXT("UnrealEd", "CloudSF", "Cloud"))
/** Render safe frames bars*/
SHOWFLAG_FIXED_IN_SHIPPING(0, CameraAspectRatioBars, SFG_Advanced, NSLOCTEXT("UnrealEd", "CameraAspectRatioBarsSF", "Camera Aspect Ratio Bars"))
/** Render safe frames */
SHOWFLAG_FIXED_IN_SHIPPING(1, CameraSafeFrames, SFG_Advanced, NSLOCTEXT("UnrealEd", "CameraSafeFramesSF", "Camera Safe Frames"))
/** Render TextRenderComponents (3D text), for now SHOWFLAG_ALWAYS_ACCESSIBLE because it's exposed in SceneCapture */
SHOWFLAG_ALWAYS_ACCESSIBLE(TextRender, SFG_Advanced, NSLOCTEXT("UnrealEd", "TextRenderSF", "Render (3D) Text"))
/** Any rendering/buffer clearing  (good for benchmarking and for pausing rendering while the app is not in focus to save cycles). */
SHOWFLAG_ALWAYS_ACCESSIBLE(Rendering, SFG_Hidden, NSLOCTEXT("UnrealEd", "RenderingSF", "Any Rendering")) // do not make it FIXED_IN_SHIPPING, used by Oculus plugin.
/** Show the current mask being used by the highres screenshot capture */
SHOWFLAG_FIXED_IN_SHIPPING(0, HighResScreenshotMask, SFG_Transient, NSLOCTEXT("UnrealEd", "HighResScreenshotMaskSF", "High Res Screenshot Mask"))
/** Distortion of output for HMD devices, SHOWFLAG_ALWAYS_ACCESSIBLE for now because USceneCaptureComponent needs that */

#Loc: <Workspace>/Engine/Source/Runtime/Online/BuildPatchServices/Private/BuildPatchInstaller.cpp:415

Scope (from outer to inner):

file
namespace    BuildPatchServices

Source code excerpt:

	};

	enum class EMemoryStore : int32
	{
		Install = 0,
		Cloud
	};

	/* FBuildPatchInstaller implementation
	*****************************************************************************/
	FBuildPatchInstaller::FBuildPatchInstaller(FBuildInstallerConfiguration InConfiguration, TMultiMap<FString, FBuildPatchAppManifestRef> InInstallationInfo, const FString& InLocalMachineConfigFile, TSharedPtr<IAnalyticsProvider> InAnalytics, FBuildPatchInstallerDelegate InStartDelegate, FBuildPatchInstallerDelegate InCompleteDelegate)
		: SessionId(FGuid::NewGuid())
		, Thread(nullptr)
		, StartDelegate(InStartDelegate)
		, CompleteDelegate(InCompleteDelegate)
		, Configuration(MoveTemp(InConfiguration))
		, DataStagingDir(Configuration.StagingDirectory / TEXT("PatchData"))

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VolumetricCloudRendering.cpp:247

Scope (from outer to inner):

file
function     bool ShouldRenderVolumetricCloud

Source code excerpt:

	return !CVarVolumetricCloudDisableCompute.GetValueOnRenderThread() && RHIIsTypedUAVLoadSupported(PF_R16F) && CVarVolumetricCloudEmptySpaceSkipping.GetValueOnRenderThread() > 0;
}

bool ShouldRenderVolumetricCloud(const FScene* Scene, const FEngineShowFlags& EngineShowFlags)
{
	if (Scene && Scene->HasVolumetricCloud() && EngineShowFlags.Atmosphere && EngineShowFlags.Cloud)
	{
		const FVolumetricCloudRenderSceneInfo* VolumetricCloud = Scene->GetVolumetricCloudSceneInfo();
		check(VolumetricCloud);

		bool bCloudMaterialValid = false;
		if (VolumetricCloud->GetVolumetricCloudSceneProxy().GetCloudVolumeMaterial())
		{
			FMaterialRenderProxy* CloudVolumeMaterialProxy = VolumetricCloud->GetVolumetricCloudSceneProxy().GetCloudVolumeMaterial()->GetRenderProxy();
			const FMaterialRenderProxy* FallbackMaterialRenderProxyPtr = nullptr;
			const FMaterial& MaterialTest = CloudVolumeMaterialProxy->GetMaterialWithFallback(Scene->GetFeatureLevel(), FallbackMaterialRenderProxyPtr);
			bCloudMaterialValid = MaterialTest.GetMaterialDomain() == MD_Volume;