ShowFlag.DirectionalLights

ShowFlag.DirectionalLights

#Overview

name: ShowFlag.DirectionalLights

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

It is referenced in 46 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of ShowFlag.DirectionalLights is to control the visibility of directional lights in the rendering system. Here’s a breakdown of its usage and implications:

  1. Purpose: It allows enabling or disabling the rendering of directional lights in the scene.

  2. Subsystems: This setting primarily affects the rendering system, particularly the lighting and shadow components.

  3. Value setting: The value is typically set through the engine’s show flags system, which allows toggling various rendering features.

  4. Interactions: It interacts with other lighting-related variables and systems, such as shadow rendering and light culling.

  5. Developer awareness:

    • This flag directly impacts the visibility of directional lights, which can significantly affect the overall lighting of a scene.
    • Disabling this flag will prevent directional lights from being rendered, which can be useful for debugging or performance optimization.
  6. Best practices:

    • Use this flag judiciously, as directional lights often represent important light sources like the sun.
    • When debugging lighting issues, toggling this flag can help isolate problems related to directional lights.

Regarding the associated variable DirectionalLights:

  1. Purpose: This is typically an array or collection that stores references to directional light components or their associated data in the scene.

  2. Usage: It’s used to keep track of all directional lights in the scene for various rendering and lighting calculations.

  3. Interactions: This collection is often iterated over during rendering passes to apply directional light effects.

  4. Developer awareness:

    • The order of lights in this collection may affect rendering priority or performance.
    • Adding or removing lights from this collection should be done carefully, as it can impact rendering and potentially cause visual artifacts.
  5. Best practices:

    • Maintain this collection efficiently, adding and removing lights as needed.
    • Consider the performance implications of having many directional lights, as they can be computationally expensive.

Both ShowFlag.DirectionalLights and the DirectionalLights collection are crucial for managing the rendering of directional lights in Unreal Engine, affecting both visual quality and performance.

#References in C++ code

#Callsites

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

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

Scope: file

Source code excerpt:

SHOWFLAG_FIXED_IN_SHIPPING(1, DirectLighting, SFG_LightingComponents, NSLOCTEXT("UnrealEd", "DirectLightingSF", "Direct Lighting"))
/** Allows to disable lighting from Directional Lights */
SHOWFLAG_FIXED_IN_SHIPPING(1, DirectionalLights, SFG_LightTypes, NSLOCTEXT("UnrealEd", "DirectionalLightsSF", "Directional Lights"))
/** Allows to disable lighting from Point Lights, for now SHOWFLAG_ALWAYS_ACCESSIBLE because it's exposed in SceneCapture */
SHOWFLAG_ALWAYS_ACCESSIBLE(PointLights, SFG_LightTypes, NSLOCTEXT("UnrealEd", "PointLightsSF", "Point Lights"))
/** Allows to disable lighting from Spot Lights, for now SHOWFLAG_ALWAYS_ACCESSIBLE because it's exposed in SceneCapture */
SHOWFLAG_ALWAYS_ACCESSIBLE(SpotLights, SFG_LightTypes, NSLOCTEXT("UnrealEd", "SpotLightsSF", "Spot Lights"))
/** Allows to disable lighting from Rect Lights, for now SHOWFLAG_ALWAYS_ACCESSIBLE because it's exposed in SceneCapture */
SHOWFLAG_ALWAYS_ACCESSIBLE(RectLights, SFG_LightTypes, NSLOCTEXT("UnrealEd", "RectLightsSF", "Rect Lights"))

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Plugins/Experimental/GPULightmass/Source/GPULightmass/Private/LightmapRenderer.cpp:2179

Scope (from outer to inner):

file
namespace    GPULightmass
function     void FLightmapRenderer::Finalize

Source code excerpt:

					Tile.RenderState->RetrieveTileRelevantLightSampleState(Tile.VirtualCoordinates).RelevantRectLightSampleCount.Empty();

					for (FDirectionalLightRenderState& DirectionalLight : Scene->LightSceneRenderState.DirectionalLights.Elements)
					{
						if (DirectionalLight.bStationary)
						{
							Tile.RenderState->RetrieveTileRelevantLightSampleState(Tile.VirtualCoordinates).RelevantDirectionalLightSampleCount.Add(FDirectionalLightRenderStateRef(DirectionalLight, Scene->LightSceneRenderState.DirectionalLights), 0);
						}
					}

					for (FPointLightRenderStateRef& PointLight : Tile.RenderState->RelevantPointLights)
					{
						check(PointLight->bStationary);

#Loc: <Workspace>/Engine/Plugins/Experimental/GPULightmass/Source/GPULightmass/Private/PathTracingLightParameters.inl:52

Scope (from outer to inner):

file
function     void SetupPathTracingLightParameters

Source code excerpt:



	for (auto Light : LightScene.DirectionalLights.Elements)
	{
		FPathTracingLight& DestLight = Lights.AddDefaulted_GetRef();

		DestLight.Normal = (FVector3f)-Light.Direction;
		DestLight.Color = FVector3f(Light.Color);
		DestLight.Dimensions = FVector2f(

#Loc: <Workspace>/Engine/Plugins/Experimental/GPULightmass/Source/GPULightmass/Private/Scene/Lights.h:380

Scope (from outer to inner):

file
namespace    GPULightmass

Source code excerpt:

{
	TOptional<FSkyLightBuildInfo> SkyLight;
	TLightArray<FDirectionalLightBuildInfo> DirectionalLights;
	TLightArray<FPointLightBuildInfo> PointLights;
	TLightArray<FSpotLightBuildInfo> SpotLights;
	TLightArray<FRectLightBuildInfo> RectLights;

	TMap<UDirectionalLightComponent*, FDirectionalLightRef> RegisteredDirectionalLightComponentUObjects;
	TMap<UPointLightComponent*, FPointLightRef> RegisteredPointLightComponentUObjects;

#Loc: <Workspace>/Engine/Plugins/Experimental/GPULightmass/Source/GPULightmass/Private/Scene/Lights.h:394

Scope (from outer to inner):

file
namespace    GPULightmass

Source code excerpt:

{
	TOptional<FSkyLightRenderState> SkyLight;
	TLightRenderStateArray<FDirectionalLightRenderState> DirectionalLights;
	TLightRenderStateArray<FPointLightRenderState> PointLights;
	TLightRenderStateArray<FSpotLightRenderState> SpotLights;
	TLightRenderStateArray<FRectLightRenderState> RectLights;
};

}

#Loc: <Workspace>/Engine/Plugins/Experimental/GPULightmass/Source/GPULightmass/Private/Scene/Scene.cpp:275

Scope (from outer to inner):

file
namespace    GPULightmass
function     inline static LightArrayType& GetLightArray

Source code excerpt:

	inline static LightArrayType& GetLightArray(FLightScene& LightScene)
	{
		return LightScene.DirectionalLights;
	}

	using LightRenderStateArrayType = TLightRenderStateArray<RenderStateType>;
	inline static LightRenderStateArrayType& GetLightRenderStateArray(FLightSceneRenderState& LightSceneRenderState)
	{
		return LightSceneRenderState.DirectionalLights;
	}
};

template<>
struct LightTypeInfo<UPointLightComponent>
{

#Loc: <Workspace>/Engine/Plugins/Experimental/GPULightmass/Source/GPULightmass/Private/Scene/Scene.cpp:789

Scope (from outer to inner):

file
namespace    GPULightmass
function     void FScene::AddGeometryInstanceFromComponent

Source code excerpt:

			Lightmap->CreateGameThreadResources();

			for (FDirectionalLightBuildInfo& DirectionalLight : LightScene.DirectionalLights.Elements)
			{
				AddLightToLightmap(Lightmap.GetReference_Unsafe(), DirectionalLight);
			}

			// Ownership will be transferred to render thread, can be nullptr if not created
			FLightmapResourceCluster* ResourceCluster = Lightmap->ResourceCluster.Release();

#Loc: <Workspace>/Engine/Plugins/Experimental/GPULightmass/Source/GPULightmass/Private/Scene/Scene.cpp:989

Scope (from outer to inner):

file
namespace    GPULightmass
function     void FScene::AddGeometryInstanceFromComponent

Source code excerpt:

			}

			for (FDirectionalLightBuildInfo& DirectionalLight : LightScene.DirectionalLights.Elements)
			{
				AddLightToLightmap(Lightmap.GetReference_Unsafe(), DirectionalLight);
			}

			// Ownership will be transferred to render thread, can be nullptr if not created
			FLightmapResourceCluster* ResourceCluster = Lightmap->ResourceCluster.Release();

#Loc: <Workspace>/Engine/Plugins/Experimental/GPULightmass/Source/GPULightmass/Private/Scene/Scene.cpp:1181

Scope (from outer to inner):

file
namespace    GPULightmass
function     void FScene::AddGeometryInstanceFromComponent

Source code excerpt:

			Lightmap->LightmapObject->CoordinateBias = FVector2D(0, 0);

			for (FDirectionalLightBuildInfo& DirectionalLight : LightScene.DirectionalLights.Elements)
			{
				AddLightToLightmap(Lightmap.GetReference_Unsafe(), DirectionalLight);
			}

			// Ownership will be transferred to render thread, can be nullptr if not created
			FLightmapResourceCluster* ResourceCluster = Lightmap->ResourceCluster.Release();

#Loc: <Workspace>/Engine/Plugins/Experimental/GPULightmass/Source/GPULightmass/Private/Scene/Scene.cpp:1824

Scope (from outer to inner):

file
namespace    GPULightmass
function     void FScene::AddRelevantStaticLightGUIDs

Source code excerpt:

{
	// Add static lights to lightmap data
	for (FDirectionalLightBuildInfo& DirectionalLight : LightScene.DirectionalLights.Elements)
	{
		if (!DirectionalLight.bStationary)
		{
			UDirectionalLightComponent* Light = DirectionalLight.ComponentUObject;
			QuantizedLightmapData->LightGuids.Add(Light->LightGuid);
		}

#Loc: <Workspace>/Engine/Plugins/Experimental/GPULightmass/Source/GPULightmass/Private/Scene/Scene.cpp:1927

Scope (from outer to inner):

file
namespace    GPULightmass
function     void FScene::ApplyFinishedLightmapsToWorld

Source code excerpt:

		}

		for (FDirectionalLightBuildInfo& DirectionalLight : LightScene.DirectionalLights.Elements)
		{
			DirectionalLight.AllocateMapBuildData(LightingScenario ? LightingScenario : DirectionalLight.ComponentUObject->GetOwner()->GetLevel());
		}

		for (FPointLightBuildInfo& PointLight : LightScene.PointLights.Elements)
		{

#Loc: <Workspace>/Engine/Plugins/Experimental/GPULightmass/Source/GPULightmass/Private/Scene/Scene.cpp:2281

Scope (from outer to inner):

file
namespace    GPULightmass
function     void FScene::ApplyFinishedLightmapsToWorld

Source code excerpt:

							// For all relevant lights
							// Directional lights are always relevant
							for (FDirectionalLightBuildInfo& DirectionalLight : LightScene.DirectionalLights.Elements)
							{
								if (!DirectionalLight.CastsStationaryShadow())
								{
									continue;
								}

								int32 ElementId = &DirectionalLight - LightScene.DirectionalLights.Elements.GetData();
								TransencodeShadowMap(DirectionalLight, RenderState.LightSceneRenderState.DirectionalLights.Elements[ElementId]);
							}

							for (FPointLightRenderStateRef& PointLight : Lightmap.RelevantPointLights)
							{
								int32 ElementId = PointLight.GetElementIdChecked();
								TransencodeShadowMap(LightScene.PointLights.Elements[ElementId], PointLight);

#Loc: <Workspace>/Engine/Plugins/Experimental/GPULightmass/Source/GPULightmass/Private/Scene/Scene.cpp:2555

Scope (from outer to inner):

file
namespace    GPULightmass
function     void FScene::ApplyFinishedLightmapsToWorld

Source code excerpt:

								// For all relevant lights
								// Directional lights are always relevant
								for (FDirectionalLightBuildInfo& DirectionalLight : LightScene.DirectionalLights.Elements)
								{
									if (!DirectionalLight.CastsStationaryShadow())
									{
										continue;
									}

#Loc: <Workspace>/Engine/Plugins/Experimental/GPULightmass/Source/GPULightmass/Private/Scene/Scene.cpp:2900

Scope (from outer to inner):

file
namespace    GPULightmass
function     void FScene::ApplyFinishedLightmapsToWorld

Source code excerpt:

							// For all relevant lights
							// Directional lights are always relevant
							for (FDirectionalLightBuildInfo& DirectionalLight : LightScene.DirectionalLights.Elements)
							{
								if (!DirectionalLight.CastsStationaryShadow())
								{
									continue;
								}

								int32 ElementId = &DirectionalLight - LightScene.DirectionalLights.Elements.GetData();
								TransencodeShadowMap(DirectionalLight, RenderState.LightSceneRenderState.DirectionalLights.Elements[ElementId]);
							}

							for (FPointLightRenderStateRef& PointLight : Lightmap.RelevantPointLights)
							{
								int32 ElementId = PointLight.GetElementIdChecked();
								TransencodeShadowMap(LightScene.PointLights.Elements[ElementId], PointLight);

#Loc: <Workspace>/Engine/Plugins/Experimental/GPULightmass/Source/GPULightmass/Private/VolumetricLightmap.cpp:817

Scope (from outer to inner):

file
function     void FVolumetricLightmapRenderer::BackgroundTick

Source code excerpt:


			TArray<FLightShaderConstants> OptionalStationaryDirectionalLightShadowing;
			for (FDirectionalLightRenderState& DirectionalLight : Scene->LightSceneRenderState.DirectionalLights.Elements)
			{
				if (DirectionalLight.bStationary)
				{
					OptionalStationaryDirectionalLightShadowing.Add(DirectionalLight.GetLightShaderParameters());
					break;
				}

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Lightmass/Lightmass.cpp:610

Scope: file

Source code excerpt:


			TotalProgress = 
				DirectionalLights.Num() + PointLights.Num() + SpotLights.Num() + RectLights.Num() + SkyLights.Num() + 
				StaticMeshes.Num() + StaticMeshLightingMeshes.Num() + StaticMeshTextureMappings.Num() + 
				BSPSurfaceMappings.Num() + VolumeMappings.Num() + Materials.Num() + 
				+ LandscapeLightingMeshes.Num() + LandscapeTextureMappings.Num();

			CurrentProgress = 0;

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Lightmass/Lightmass.cpp:639

Scope (from outer to inner):

file
function     void FLightmassExporter::WriteToChannel

Source code excerpt:

			Scene.NumVolumetricLightmapDensityVolumes = VolumetricLightmapDensityVolumes.Num();
			Scene.NumPortals = Portals.Num();
			Scene.NumDirectionalLights = DirectionalLights.Num();
			Scene.NumPointLights = PointLights.Num();
			Scene.NumSpotLights = SpotLights.Num();
			Scene.NumRectLights = RectLights.Num();
			Scene.NumSkyLights = SkyLights.Num();
			Scene.NumStaticMeshes = StaticMeshes.Num();
			Scene.NumStaticMeshInstances = StaticMeshLightingMeshes.Num();

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Lightmass/Lightmass.cpp:996

Scope (from outer to inner):

file
function     void FLightmassExporter::WriteLights

Source code excerpt:

	if (SkyAtmosphereComponent)
	{
		for (int32 LightIndex = 0; LightIndex < DirectionalLights.Num(); ++LightIndex)
		{
			const UDirectionalLightComponent* Light = DirectionalLights[LightIndex];
			if (Light->IsUsedAsAtmosphereSunLight() && Light->GetColoredLightBrightness().GetLuminance() > AtmosphereLightsBrightness[Light->GetAtmosphereSunLightIndex()])
			{
				AtmosphereLights[Light->GetAtmosphereSunLightIndex()] = Light;
				AtmosphereLightsBrightness[Light->GetAtmosphereSunLightIndex()] = Light->GetColoredLightBrightness().GetLuminance();
			}
		}

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Lightmass/Lightmass.cpp:1023

Scope (from outer to inner):

file
function     void FLightmassExporter::WriteLights

Source code excerpt:


	// Export directional lights.
	for ( int32 LightIndex = 0; LightIndex < DirectionalLights.Num(); ++LightIndex )
	{
		const UDirectionalLightComponent* Light = DirectionalLights[LightIndex];
		Lightmass::FLightData LightData;
		Lightmass::FDirectionalLightData DirectionalData;
		Copy( Light, LightData );
		LightData.IndirectLightingSaturation = Light->LightmassSettings.IndirectLightingSaturation;
		LightData.ShadowExponent = Light->LightmassSettings.ShadowExponent;
		LightData.ShadowResolutionScale = Light->ShadowResolutionScale;

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Lightmass/Lightmass.cpp:2602

Scope (from outer to inner):

file
function     void FLightmassExporter::AddLight

Source code excerpt:

	if( DirectionalLight )
	{
		DirectionalLights.AddUnique(DirectionalLight);
	}
	else if( SpotLight )
	{
		SpotLights.AddUnique(SpotLight);
	}
	else if( PointLight )

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Lightmass/Lightmass.cpp:3189

Scope (from outer to inner):

file
function     bool FLightmassProcessor::BeginRun

Source code excerpt:


		{
			for (int32 LightIndex = 0; LightIndex < Exporter->DirectionalLights.Num(); LightIndex++)
			{
				const ULightComponent* Light = Exporter->DirectionalLights[LightIndex];
				IssueStaticShadowDepthMapTask(Light, INT_MAX);
			}
			
			for (int32 LightIndex = 0; LightIndex < Exporter->SpotLights.Num(); LightIndex++)
			{
				const ULightComponent* Light = Exporter->SpotLights[LightIndex];

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Lightmass/Lightmass.cpp:4385

Scope (from outer to inner):

file
function     ULightComponent* FLightmassProcessor::FindLight

Source code excerpt:

	{
		int32 LightIndex;
		for (LightIndex = 0; LightIndex < Exporter->DirectionalLights.Num(); LightIndex++)
		{
			const UDirectionalLightComponent* Light = Exporter->DirectionalLights[LightIndex];
			if (Light)
			{
				if (Light->LightGuid == LightGuid)
				{
					return (ULightComponent*)Light;
				}

#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/Lightmass/Lightmass.h:235

Scope (from outer to inner):

file
class        class FLightmassExporter

Source code excerpt:


	// lights objects
	TArray<const class UDirectionalLightComponent*> DirectionalLights;
	TArray<const class UPointLightComponent*> PointLights;
	TArray<const class USpotLightComponent*> SpotLights;
	TArray<const class URectLightComponent*> RectLights;
	TArray<const class USkyLightComponent*> SkyLights;

	// BSP mappings

#Loc: <Workspace>/Engine/Source/Programs/UnrealLightmass/Private/ImportExport/LightmassScene.cpp:197

Scope (from outer to inner):

file
namespace    Lightmass
function     void FScene::Import

Source code excerpt:

	Importer.ImportArray(VolumetricLightmapTaskGuids, NumVolumetricLightmapTasks);

	Importer.ImportObjectArray( DirectionalLights, NumDirectionalLights, Importer.GetLights() );
	Importer.ImportObjectArray( PointLights, NumPointLights, Importer.GetLights() );
	Importer.ImportObjectArray( SpotLights, NumSpotLights, Importer.GetLights() );
	Importer.ImportObjectArray( RectLights, NumRectLights, Importer.GetLights() );
	Importer.ImportObjectArray( SkyLights, NumSkyLights, Importer.GetLights() );

	Importer.ImportObjectArray( StaticMeshInstances, NumStaticMeshInstances, Importer.GetStaticMeshInstances() );

#Loc: <Workspace>/Engine/Source/Programs/UnrealLightmass/Private/ImportExport/LightmassScene.cpp:306

Scope (from outer to inner):

file
namespace    Lightmass
function     const FLight* FScene::FindLightByGuid

Source code excerpt:

const FLight* FScene::FindLightByGuid(const FGuid& InGuid) const
{
	for (int32 i = 0; i < DirectionalLights.Num(); i++)
	{
		if (DirectionalLights[i].Guid == InGuid)
		{
			return &DirectionalLights[i];
		}
	}
	for (int32 i = 0; i < PointLights.Num(); i++)
	{
		if (PointLights[i].Guid == InGuid)
		{

#Loc: <Workspace>/Engine/Source/Programs/UnrealLightmass/Private/ImportExport/LightmassScene.h:760

Scope (from outer to inner):

file
namespace    Lightmass
class        class FScene : public FSceneFileHeader

Source code excerpt:

	TArray<FVector4f> CameraTrackPositions;

	TArray<FDirectionalLight>	DirectionalLights;
	TArray<FPointLight>			PointLights;
	TArray<FSpotLight>			SpotLights;
	TArray<FRectLight>			RectLights;
	TArray<FSkyLight>			SkyLights;

	TArray<FStaticMeshStaticLightingMesh>				StaticMeshInstances;

#Loc: <Workspace>/Engine/Source/Programs/UnrealLightmass/Private/Lighting/LightingSystem.cpp:478

Scope (from outer to inner):

file
namespace    Lightmass
function     FStaticLightingSystem::FStaticLightingSystem

Source code excerpt:

	MaxRayDistance = ImportanceBounds.SphereRadius > 0.0f ? ImportanceBounds.SphereRadius * 2.0f : SceneBounds.SphereRadius * 2.0f;

	Stats.NumLights = InScene.DirectionalLights.Num() + InScene.PointLights.Num() + InScene.SpotLights.Num() + InScene.RectLights.Num() + MeshAreaLights.Num();
	Stats.NumMeshAreaLights = MeshAreaLights.Num();
	for (int32 i = 0; i < MeshAreaLights.Num(); i++)
	{
		Stats.NumMeshAreaLightPrimitives += MeshAreaLights[i].GetNumPrimitives();
		Stats.NumSimplifiedMeshAreaLightPrimitives += MeshAreaLights[i].GetNumSimplifiedPrimitives();
	}

#Loc: <Workspace>/Engine/Source/Programs/UnrealLightmass/Private/Lighting/LightingSystem.cpp:488

Scope (from outer to inner):

file
namespace    Lightmass
function     FStaticLightingSystem::FStaticLightingSystem

Source code excerpt:

	// Add all light types except sky lights to the system's Lights array
	Lights.Reserve(Stats.NumLights);
	for (int32 LightIndex = 0; LightIndex < InScene.DirectionalLights.Num(); LightIndex++)
	{
		InScene.DirectionalLights[LightIndex].Initialize(
			SceneBounds, 
			PhotonMappingSettings.bEmitPhotonsOutsideImportanceVolume,
			ImportanceBounds,
			Scene.PhotonMappingSettings.IndirectPhotonEmitDiskRadius,
			Scene.SceneConstants.LightGridSize,
			Scene.PhotonMappingSettings.DirectPhotonDensity,
			Scene.PhotonMappingSettings.DirectPhotonDensity * Scene.PhotonMappingSettings.OutsideImportanceVolumeDensityScale);

		Lights.Add(&InScene.DirectionalLights[LightIndex]);
	}
	
	// Initialize lights and add them to the solver's Lights array
	for (int32 LightIndex = 0; LightIndex < InScene.PointLights.Num(); LightIndex++)
	{
		InScene.PointLights[LightIndex].Initialize(Scene.PhotonMappingSettings.IndirectPhotonEmitConeAngle);

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

Scope: file

Source code excerpt:

SHOWFLAG_FIXED_IN_SHIPPING(1, DirectLighting, SFG_LightingComponents, NSLOCTEXT("UnrealEd", "DirectLightingSF", "Direct Lighting"))
/** Allows to disable lighting from Directional Lights */
SHOWFLAG_FIXED_IN_SHIPPING(1, DirectionalLights, SFG_LightTypes, NSLOCTEXT("UnrealEd", "DirectionalLightsSF", "Directional Lights"))
/** Allows to disable lighting from Point Lights, for now SHOWFLAG_ALWAYS_ACCESSIBLE because it's exposed in SceneCapture */
SHOWFLAG_ALWAYS_ACCESSIBLE(PointLights, SFG_LightTypes, NSLOCTEXT("UnrealEd", "PointLightsSF", "Point Lights"))
/** Allows to disable lighting from Spot Lights, for now SHOWFLAG_ALWAYS_ACCESSIBLE because it's exposed in SceneCapture */
SHOWFLAG_ALWAYS_ACCESSIBLE(SpotLights, SFG_LightTypes, NSLOCTEXT("UnrealEd", "SpotLightsSF", "Spot Lights"))
/** Allows to disable lighting from Rect Lights, for now SHOWFLAG_ALWAYS_ACCESSIBLE because it's exposed in SceneCapture */
SHOWFLAG_ALWAYS_ACCESSIBLE(RectLights, SFG_LightTypes, NSLOCTEXT("UnrealEd", "RectLightsSF", "Rect Lights"))

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HairStrands/HairStrandsData.h:421

Scope (from outer to inner):

file
function     BEGIN_SHADER_PARAMETER_STRUCT

Source code excerpt:


		bool bIsValid = false;
		TArray<FLight> DirectionalLights;
		FConvexVolume ViewFrustum;
	} CullData;

	struct FCommon
	{
		FRDGTextureRef SceneDepthTextureBeforeCompsition = nullptr;

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HairStrands/HairStrandsDebug.cpp:381

Scope (from outer to inner):

file
function     static void AddDebugHairShadowCullingPass

Source code excerpt:

	}

	const uint32 LightCount = View->HairStrandsViewData.DebugData.CullData.DirectionalLights.Num();
	uint32 InstanceCount = 0;
	for (auto It : View->HairStrandsViewData.DebugData.CullData.DirectionalLights)
	{
		InstanceCount += It.InstanceBoundInLightSpace.Num();
	}

	if (LightCount == 0 || InstanceCount == 0)
	{

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HairStrands/HairStrandsDebug.cpp:414

Scope (from outer to inner):

file
function     static void AddDebugHairShadowCullingPass

Source code excerpt:


	uint32 LightIndex = 0;
	for (auto It : View->HairStrandsViewData.DebugData.CullData.DirectionalLights)
	{
		FRDGBufferRef InstanceBoundInLightSpaceBuffer = CreateBoundBuffer(It.InstanceBoundInLightSpace);
		FRDGBufferRef InstanceBoundInWorldSpaceBuffer = CreateBoundBuffer(It.InstanceBoundInWorldSpace);
		FRDGBufferRef InstanceIntersectionBuffer = CreateVertexBuffer(GraphBuilder, TEXT("Hair.Debug.InstanceIntersection"), FRDGBufferDesc::CreateBufferDesc(4, It.InstanceIntersection.Num()), It.InstanceIntersection.GetData(), 4u * It.InstanceIntersection.Num());

		FHairDebugShadowCullingCS::FParameters* Parameters = GraphBuilder.AllocParameters<FHairDebugShadowCullingCS::FParameters>();

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HairStrands/HairStrandsInterface.cpp:283

Scope (from outer to inner):

file
function     bool IsHairStrandsVisibleInShadows

Source code excerpt:

					if (bDebugEnable)
					{
						FHairStrandsDebugData::FCullData::FLight& LightData = CullingData->DirectionalLights.AddDefaulted_GetRef();
						LightData.WorldToLight = WorldToLight;
						LightData.LightToWorld = CullData.LightInfo->Proxy->GetLightToWorld();
						LightData.Center = FVector3f(CullData.LightInfo->Proxy->GetBoundingSphere().Center);
						LightData.Extent = FVector3f(CullData.LightInfo->Proxy->GetBoundingSphere().W);
						LightData.ViewFrustumInLightSpace = CullData.ViewFrustumInLightSpace;
						LightData.InstanceBoundInLightSpace.Add({FVector3f(BoundsInLightSpace.GetBox().Min), FVector3f(BoundsInLightSpace.GetBox().Max)});

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/LightGridInjection.cpp:618

Scope: file

Source code excerpt:

					}
					// On mobile there is a separate FMobileDirectionalLightShaderParameters UB which holds all directional light data.
					else if (SortedLightInfo.SortKey.Fields.LightType == LightType_Directional && ViewFamily.EngineShowFlags.DirectionalLights && !IsMobilePlatform(View.GetShaderPlatform()))
					{
						// The selected forward directional light is also used for volumetric lighting using ForwardLightData UB.
						// Also some people noticed that depending on the order a two directional lights are made visible in a level, the selected light for volumetric fog lighting will be different.
						// So to be clear and avoid such issue, we select the most intense directional light for forward shading and volumetric lighting.
						const float LightIntensitySq = FVector3f(LightParameters.Color).SizeSquared();
						const int32 LightForwardShadingPriority = LightProxy->GetDirectionalLightForwardShadingPriority();

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/LightSceneInfo.cpp:184

Scope (from outer to inner):

file
function     bool FLightSceneInfo::ShouldRenderLight

Source code excerpt:

	{
		case LightType_Directional:
			if(!View.Family->EngineShowFlags.DirectionalLights) 
			{
				bLocalVisible = false;
			}
			break;
		case LightType_Point:
			if(!View.Family->EngineShowFlags.PointLights) 

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenSceneRendering.cpp:1820

Scope (from outer to inner):

file
function     bool UpdateGlobalLightingState

Source code excerpt:

	const FLightSceneInfo* DirectionalLightSceneInfo = nullptr;

	for (const FLightSceneInfo* LightSceneInfo : Scene->DirectionalLights)
	{
		if (LightSceneInfo->ShouldRenderLightViewIndependent()
			&& LightSceneInfo->ShouldRenderLight(View, true)
			&& LightSceneInfo->Proxy->GetIndirectLightingScale() > 0.0f)
		{
			DirectionalLightSceneInfo = LightSceneInfo;

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PathTracing.cpp:2078

Scope (from outer to inner):

file
function     void SetLightParameters

Source code excerpt:


	// Add directional lights next (all lights with infinite bounds should come first)
	if (View.Family->EngineShowFlags.DirectionalLights)
	{
		for (const FLightSceneInfoCompact& Light : Scene->Lights)
		{
			ELightComponentType LightComponentType = (ELightComponentType)Light.LightSceneInfo->Proxy->GetLightType();

			if (LightComponentType != LightType_Directional)

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PathTracing.cpp:2486

Scope: file

Source code excerpt:

	Config.LightShowFlags = 0;
	Config.LightShowFlags |= View.Family->EngineShowFlags.SkyLighting           ? 1 << 0 : 0;
	Config.LightShowFlags |= View.Family->EngineShowFlags.DirectionalLights     ? 1 << 1 : 0;
	Config.LightShowFlags |= View.Family->EngineShowFlags.RectLights            ? 1 << 2 : 0;
	Config.LightShowFlags |= View.Family->EngineShowFlags.SpotLights            ? 1 << 3 : 0;
	Config.LightShowFlags |= View.Family->EngineShowFlags.PointLights           ? 1 << 4 : 0;
	Config.LightShowFlags |= View.Family->EngineShowFlags.TexturedLightProfiles ? 1 << 5 : 0;
	Config.LightShowFlags |= View.Family->EngineShowFlags.LightFunctions        ? 1 << 6 : 0;
	Config.LightShowFlags |= CVarPathTracingLightFunctionColor.GetValueOnRenderThread() ? 1 << 7 : 0;

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/RendererScene.cpp:2660

Scope (from outer to inner):

file
function     void FScene::AddLightSceneInfo_RenderThread

Source code excerpt:

	if (bDirectionalLight)
	{
		DirectionalLights.Add(LightSceneInfo);
	}

	if (bDirectionalLight &&
		// Only use a stationary or movable light
		!(LightSceneInfo->Proxy->HasStaticLighting() 
		// if it is a Static DirectionalLight and the light has not been built, add it to MobileDirectionalLights for mobile preview.

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/RendererScene.cpp:3958

Scope (from outer to inner):

file
function     void FScene::RemoveLightSceneInfo_RenderThread

Source code excerpt:

	if (bDirectionalLight)
	{
		DirectionalLights.Remove(LightSceneInfo);
	}

	// check SimpleDirectionalLight
	if (LightSceneInfo == SimpleDirectionalLight)
	{
		SimpleDirectionalLight = nullptr;

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/RendererScene.cpp:7241

Scope (from outer to inner):

file
function     void FScene::UpdateCachedShadowState

Source code excerpt:

void FScene::UpdateCachedShadowState(const FScenePreUpdateChangeSet &ScenePreUpdateChangeSet, const FScenePostUpdateChangeSet &ScenePostUpdateChangeSet)
{
	for (const FLightSceneInfo* LightSceneInfo : DirectionalLights)
	{
		TArray<FCachedShadowMapData>* CachedShadowMapDatas = GetCachedShadowMapDatas(LightSceneInfo->Id);

		if (CachedShadowMapDatas)
		{
			for (auto& CachedShadowMapData : *CachedShadowMapDatas)

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/ScenePrivate.h:3056

Scope (from outer to inner):

file
class        class FScene : public FSceneInterface

Source code excerpt:

	FLightSceneInfo* AtmosphereLights[NUM_ATMOSPHERE_LIGHTS];

	TArray<FLightSceneInfo*, TInlineAllocator<4>> DirectionalLights;

	/** The decals in the scene. */
	TArray<FDeferredDecalProxy*> Decals;

	/** Potential capsule shadow casters registered to the scene. */
	TArray<FPrimitiveSceneInfo*> DynamicIndirectCasterPrimitives; 

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Shadows/ShadowSceneRenderer.cpp:278

Scope (from outer to inner):

file
function     void FShadowSceneRenderer::AddDirectionalLightShadow

Source code excerpt:

void FShadowSceneRenderer::AddDirectionalLightShadow(FProjectedShadowInfo* ProjectedShadowInfo)
{
	FDirectionalLightShadowFrameSetup& DirectionalLightShadowFrameSetup = DirectionalLights.AddDefaulted_GetRef();
	DirectionalLightShadowFrameSetup.ProjectedShadowInfo = ProjectedShadowInfo;
}

void FShadowSceneRenderer::PostInitDynamicShadowsSetup()
{
	// Dispatch async Nanite culling job if appropriate

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Shadows/ShadowSceneRenderer.cpp:291

Scope (from outer to inner):

file
function     void FShadowSceneRenderer::PostInitDynamicShadowsSetup

Source code excerpt:

		bool bUnboundedClipmap = false;
		
		for (const FDirectionalLightShadowFrameSetup& DirectionalLightShadowFrameSetup : DirectionalLights)
		{
			FProjectedShadowInfo* ProjectedShadowInfo = DirectionalLightShadowFrameSetup.ProjectedShadowInfo;
			if (!bUnboundedClipmap && ProjectedShadowInfo->bShouldRenderVSM)
			{
				const bool bIsCached = VirtualShadowMapArray.CacheManager->IsCacheEnabled() && GForceInvalidateDirectionalVSM == 0;

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Shadows/ShadowSceneRenderer.h:124

Scope (from outer to inner):

file
class        class FShadowSceneRenderer

Source code excerpt:

		FProjectedShadowInfo* ProjectedShadowInfo = nullptr;
	};
	TArray<FDirectionalLightShadowFrameSetup, SceneRenderingAllocator> DirectionalLights;

	// One pass projection stuff. Set up in RenderVitualShadowMapProjectionMaskBits
	bool bShouldUseVirtualShadowMapOnePassProjection = false;

	// Links to other systems etc.
	FDeferredShadingSceneRenderer& SceneRenderer;

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/VolumetricFog.cpp:460

Scope (from outer to inner):

file
function     static void RenderRaytracedDirectionalShadowVolume

Source code excerpt:


	const FLightSceneInfo* DirectionalLightSceneInfo = nullptr;
	for (const FLightSceneInfo* LightSceneInfo : Scene.DirectionalLights)
	{
		if (LightSceneInfo->ShouldRenderLightViewIndependent()
			&& LightSceneInfo->ShouldRenderLight(View, true)
			&& LightHasRayTracedShadows(LightSceneInfo)
			&& LightSceneInfo->Proxy == SelectedForwardDirectionalLightProxy)
		{