ShowFlag.DirectLighting

ShowFlag.DirectLighting

#Overview

name: ShowFlag.DirectLighting

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

It is referenced in 24 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of ShowFlag.DirectLighting is to control the rendering of direct lighting in Unreal Engine 5. This setting variable is part of the rendering system and is used to enable or disable the visualization of direct lighting in the scene.

ShowFlag.DirectLighting is primarily used by the rendering subsystem of Unreal Engine. It is referenced in various modules, including the Engine, Renderer, and Lightmass modules.

The value of this variable is typically set through engine show flags, which can be controlled via the engine’s UI or programmatically. It’s often used in conjunction with other lighting-related show flags to fine-tune the visualization of different lighting components.

This variable interacts with several other lighting-related variables and systems, including:

  1. Other lighting show flags (e.g., ShowFlag.Lighting, ShowFlag.DirectionalLights, ShowFlag.PointLights, ShowFlag.SpotLights)
  2. Lumen global illumination system
  3. Path tracing system
  4. Light grid injection
  5. Deferred shading renderer

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

  1. Disabling direct lighting will affect the visual appearance of the scene significantly.
  2. It may impact performance, as enabling or disabling direct lighting can change the number of lighting calculations performed.
  3. This flag affects both real-time and baked lighting visualization.

Best practices for using this variable include:

  1. Use it for debugging lighting issues or isolating lighting components.
  2. Be cautious when disabling it in shipping builds, as it can dramatically change the visual quality of the game.
  3. Consider the interaction with other lighting systems (e.g., Lumen) when modifying this flag.

Regarding the associated variable DirectLighting:

The purpose of DirectLighting is to store and represent direct lighting data in various lighting calculations and systems within Unreal Engine. It is used in multiple contexts, including lightmapping, radiosity calculations, and real-time lighting computations.

DirectLighting is used across several subsystems, including Lightmass (for global illumination calculations) and the main rendering pipeline.

The value of DirectLighting is typically calculated based on the scene’s light sources and their interaction with surfaces in the scene. It’s often computed as part of larger lighting calculations.

This variable interacts closely with other lighting-related variables and systems, such as indirect lighting calculations, surface caches, and various lighting visualization tools.

Developers should be aware that DirectLighting represents an important component of the overall lighting solution and can significantly impact the visual quality and performance of the rendering system.

Best practices for working with DirectLighting include:

  1. Ensure proper calibration of light sources to achieve realistic direct lighting results.
  2. Consider the balance between direct and indirect lighting for a natural appearance.
  3. Be mindful of performance implications when calculating detailed direct lighting, especially for real-time applications.

#References in C++ code

#Callsites

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

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

Scope: file

Source code excerpt:

SHOWFLAG_ALWAYS_ACCESSIBLE(VisualizeVirtualShadowMap, SFG_Hidden, NSLOCTEXT("UnrealEd", "VisualizeVirtualShadowMapSF", "Virtual Shadow Map Visualization"))
/** Allows to disable all direct lighting (does not affect indirect light) */
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"))

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Programs/UnrealLightmass/Private/Lighting/AdaptiveVolumetricLightmap.cpp:331

Scope (from outer to inner):

file
namespace    Lightmass
function     bool FStaticLightingSystem::ShouldRefineVoxel

Source code excerpt:

					{
						FVector3f SamplePosition = ExpandedCellBounds.Min + VoxelTestPositions[SampleIndex] * ExpandedCellBounds.GetSize();
						FLinearColor DirectLighting = Light->GetDirectIntensity(SamplePosition, false);

						if (DirectLighting.GetLuminance() > VolumetricLightmapSettings.LightBrightnessSubdivideThreshold)
						{
							// Only subdivide if the light has a significant effect on this voxel
							bVoxelIntersectsScene = true;
							break;
						}
					}

#Loc: <Workspace>/Engine/Source/Programs/UnrealLightmass/Private/Lighting/Radiosity.cpp:417

Scope (from outer to inner):

file
namespace    Lightmass
function     void FStaticLightingSystem::RadiositySetupTextureMapping

Source code excerpt:

				if (ImportanceTracingSettings.bUseRadiositySolverForLightMultibounce)
				{
					FGatheredLightSample DirectLighting;
					float Unused2;
					TArray<FVector3f, TInlineAllocator<1>> VertexOffsets;
					VertexOffsets.Add(FVector3f(0, 0, 0));

					CalculateApproximateDirectLighting(CurrentVertex, TexelToVertex.TexelRadius, VertexOffsets, .1f, true, true, bDebugThisTexel, MappingContext, DirectLighting, Unused2);

					IncidentLightingForRadiosity += DirectLighting.IncidentLighting;
				}
				
				TextureMapping->SurfaceCacheLighting[SurfaceCacheIndex] = IncidentLighting;
				TextureMapping->RadiositySurfaceCache[0][SurfaceCacheIndex] = IncidentLightingForRadiosity;
			}
		}

#Loc: <Workspace>/Engine/Source/Programs/UnrealLightmass/Private/Lighting/TextureMapping.cpp:664

Scope (from outer to inner):

file
namespace    Lightmass
function     void FStaticLightingSystem::FinalizeSurfaceCacheTextureMapping

Source code excerpt:

				if (GeneralSettings.ViewSingleBounceNumber < 0 || GeneralSettings.ViewSingleBounceNumber == 1)
				{
					FGatheredLightSample DirectLighting;
					float Unused2;
					TArray<FVector3f, TInlineAllocator<1>> VertexOffsets;
					VertexOffsets.Add(FVector3f(0, 0, 0));

					CalculateApproximateDirectLighting(CurrentVertex, TexelToVertex.TexelRadius, VertexOffsets, .1f, true, true, bDebugThisTexel && PhotonMappingSettings.bVisualizeCachedApproximateDirectLighting, MappingContext, DirectLighting, Unused2);
					FinalIncidentLighting += DirectLighting.IncidentLighting;
				}

				const bool bTranslucent = TextureMapping->Mesh->IsTranslucent(TexelToVertex.ElementIndex);
				const FLinearColor Reflectance = (bTranslucent ? FLinearColor::Black : TextureMapping->Mesh->EvaluateTotalReflectance(CurrentVertex, TexelToVertex.ElementIndex)) * (float)INV_PI;
				// Combine all the lighting and surface reflectance so the final gather ray only needs one memory fetch
				TextureMapping->SurfaceCacheLighting[SurfaceCacheIndex] = FinalIncidentLighting * Reflectance;

#Loc: <Workspace>/Engine/Source/Programs/UnrealLightmass/Private/Lighting/TextureMapping.cpp:1353

Scope (from outer to inner):

file
namespace    Lightmass
function     void FStaticLightingSystem::CalculateDirectLightingTextureMappingFiltered

Source code excerpt:

							const FStaticLightingVertex CurrentVertex = TexelToVertex.GetVertex();
							const FLinearColor LightIntensity = Light->GetDirectIntensity(CurrentVertex.WorldPosition, false);
							const FGatheredLightSample DirectLighting = CalculatePointLighting(TextureMapping, CurrentVertex, TexelToVertex.ElementIndex, Light, LightIntensity, FLinearColor::White);
							if (GeneralSettings.ViewSingleBounceNumber < 1)
							{
								LightMapData(X,Y).AddWeighted(DirectLighting, ShadowFactor);
							}
						}
					}
				}
			}

#Loc: <Workspace>/Engine/Source/Programs/UnrealLightmass/Private/Lighting/TextureMapping.cpp:1715

Scope (from outer to inner):

file
namespace    Lightmass
function     void FStaticLightingSystem::CalculateDirectAreaLightingTextureMapping

Source code excerpt:

							const FLinearColor LightIntensity = LightIntensityCache[(Y * TextureMapping->CachedSizeX) + X];
							const FLinearColor Transmission = TransmissionCache[(Y * TextureMapping->CachedSizeX) + X];
							const FGatheredLightSample DirectLighting = CalculatePointLighting(TextureMapping, CurrentVertex, TexelToVertex.ElementIndex, Light, LightIntensity, Transmission);

							FGatheredLightMapSample& CurrentLightSample = LightMapData(X,Y);
							CurrentLightSample.AddWeighted(DirectLighting, AdjustedShadowFactor);
						}
					}
				}
			}
		}
	}

#Loc: <Workspace>/Engine/Source/Programs/UnrealLightmass/Private/Lighting/TextureMapping.cpp:2773

Scope (from outer to inner):

file
namespace    Lightmass
function     void FStaticLightingSystem::CalculateDirectLightingTextureMappingPhotonMap

Source code excerpt:

				if (PhotonMappingSettings.bUseIrradiancePhotons)
				{
					FLinearColor DirectLighting;

					const FIrradiancePhoton* NearestPhoton = NULL;
					if (PhotonMappingSettings.bCacheIrradiancePhotonsOnSurfaces)
					{
						// Trace a ray into the current texel to get a good representation of what the final gather will see.
						// Speed does not matter here since bVisualizeCachedApproximateDirectLighting is only used for debugging.

#Loc: <Workspace>/Engine/Source/Programs/UnrealLightmass/Private/Lighting/TextureMapping.cpp:2816

Scope (from outer to inner):

file
namespace    Lightmass
function     void FStaticLightingSystem::CalculateDirectLightingTextureMappingPhotonMap

Source code excerpt:

						CalculateApproximateDirectLighting(CurrentVertex, TexelToVertex.TexelRadius, VertexOffsets, .1f, true, true, bDebugThisTexel, MappingContext, DirectLightingSample, Unused2);

						DirectLighting = DirectLightingSample.IncidentLighting;
					}
					const FLinearColor& PhotonIrradiance = NearestPhoton ? NearestPhoton->GetIrradiance() : FLinearColor::Black;
					if (GeneralSettings.ViewSingleBounceNumber < 1)
					{
						FLinearColor FinalLighting = PhotonIrradiance;

						if (!PhotonMappingSettings.bUsePhotonDirectLightingInFinalGather)
						{
							FinalLighting += DirectLighting;
						}

						//@todo - can't visualize accurately using AmbientLight with directional lightmaps
						//CurrentLightSample.AddWeighted(FGatheredLightSampleUtil::AmbientLight<2>(FinalLighting), 1.0f);
						CurrentLightSample.AddWeighted(FGatheredLightSampleUtil::PointLightWorldSpace<2>(FinalLighting, FVector4f(0, 0, 1), CurrentVertex.WorldTangentZ), 1.0f);
					}

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/ShowFlags.cpp:649

Scope (from outer to inner):

file
function     void EngineShowFlagOverride

Source code excerpt:

			 DISABLE_ENGINE_SHOWFLAG(AmbientCubemap)
			 DISABLE_ENGINE_SHOWFLAG(MotionBlur)
			 DISABLE_ENGINE_SHOWFLAG(DirectLighting)
			 DISABLE_ENGINE_SHOWFLAG(Lighting)
			 DISABLE_ENGINE_SHOWFLAG(Translucency)
			 DISABLE_ENGINE_SHOWFLAG(TextRender)
			 DISABLE_ENGINE_SHOWFLAG(Particles)
			 DISABLE_ENGINE_SHOWFLAG(SkeletalMeshes)
			 DISABLE_ENGINE_SHOWFLAG(StaticMeshes)

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

Scope: file

Source code excerpt:

SHOWFLAG_ALWAYS_ACCESSIBLE(VisualizeVirtualShadowMap, SFG_Hidden, NSLOCTEXT("UnrealEd", "VisualizeVirtualShadowMapSF", "Virtual Shadow Map Visualization"))
/** Allows to disable all direct lighting (does not affect indirect light) */
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"))

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

Scope: file

Source code excerpt:

		ForwardLightData->ClusteredDeferredSupportedEndIndex = ClusteredSupportedEnd;
		ForwardLightData->ManyLightsSupportedStartIndex = FMath::Min<int32>(ManyLightsSupportedStart, NumLocalLightsFinal);
		ForwardLightData->DirectLightingShowFlag = ViewFamily.EngineShowFlags.DirectLighting ? 1 : 0;

		// Clamp far plane to something reasonable
		const float KilometersToCentimeters = 100000.0f;
		const float LightCullingMaxDistance = GLightCullingMaxDistanceOverrideKilometers <= 0.0f ? (float)UE_OLD_HALF_WORLD_MAX / 5.0f : GLightCullingMaxDistanceOverrideKilometers * KilometersToCentimeters;
		float FarPlane = FMath::Min(FMath::Max(FurthestLight, View.FurthestReflectionCaptureDistance), LightCullingMaxDistance);
		FVector ZParams = GetLightGridZParams(View.NearClippingDistance, FarPlane + 10.f);

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/LightRendering.cpp:1362

Scope (from outer to inner):

file
function     void FDeferredShadingSceneRenderer::RenderLights

Source code excerpt:


		// SUBSTRATE_TODO move right after stencil clear so that it is also common with EnvLight pass
		if (ViewFamily.EngineShowFlags.DirectLighting && Substrate::IsSubstrateEnabled())
		{
			// Update the stencil buffer, marking simple/complex Substrate material only once for all the following passes.
			Substrate::AddSubstrateStencilPass(GraphBuilder, Views, SceneTextures);
		}

		if (ViewFamily.EngineShowFlags.DirectLighting && GUseTranslucentLightingVolumes && GSupportsVolumeTextureRendering)
		{
			RDG_EVENT_SCOPE(GraphBuilder, "InjectTranslucencyLightingVolume");

			if (SimpleLights.InstanceData.Num() > 0)
			{
				auto& SimpleLightsByView = *GraphBuilder.AllocObject<TArray<FSimpleLightArray, SceneRenderingAllocator>>();

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/LightRendering.cpp:1424

Scope (from outer to inner):

file
function     void FDeferredShadingSceneRenderer::RenderLights

Source code excerpt:

		}

		if(ViewFamily.EngineShowFlags.DirectLighting)
		{
			ShadowSceneRenderer->RenderVirtualShadowMapProjectionMaskBits(GraphBuilder, SceneTextures);

			RDG_EVENT_SCOPE(GraphBuilder, "BatchedLights");
			INC_DWORD_STAT_BY(STAT_NumBatchedLights, UnbatchedLightStart);

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/LightRendering.cpp:1538

Scope (from outer to inner):

file
function     void FDeferredShadingSceneRenderer::RenderLights

Source code excerpt:

			}

			const bool bDirectLighting = ViewFamily.EngineShowFlags.DirectLighting;

			FRDGTextureRef SharedScreenShadowMaskTexture = nullptr;
			FRDGTextureRef SharedScreenShadowMaskSubPixelTexture = nullptr;

			// Draw shadowed and light function lights
			for (int32 LightIndex = UnbatchedLightStart; LightIndex < ManyLightsLightStart; LightIndex++)

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/LightRendering.cpp:2874

Scope: file

Source code excerpt:

	const int32 SimpleLightsEnd = SortedLightSet.SimpleLightsEnd;

	if (ViewFamily.EngineShowFlags.DirectLighting)
	{
		RDG_EVENT_SCOPE(GraphBuilder, "DirectLighting");

		for (int32 ViewIndex = 0, ViewCount = Views.Num(); ViewIndex < ViewCount; ++ViewIndex)
		{
			FViewInfo& View = Views[ViewIndex];

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenDiffuseIndirect.cpp:24

Scope (from outer to inner):

file
function     FLumenGatherCvarState::FLumenGatherCvarState

Source code excerpt:

	SurfaceBias = 5.0f;
	VoxelTracingMode = 0;
	DirectLighting = 0;
}

static TAutoConsoleVariable<int> CVarLumenGlobalIllumination(
	TEXT("r.Lumen.DiffuseIndirect.Allow"),
	1,
	TEXT("Whether to allow Lumen Global Illumination.  Lumen GI is enabled in the project settings, this cvar can only disable it."), 

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenDiffuseIndirect.cpp:283

Scope (from outer to inner):

file
function     bool ShouldRenderLumenDirectLighting

Source code excerpt:

{
	return ShouldRenderLumenDiffuseGI(Scene, View)
		&& GLumenGatherCvars.DirectLighting
		&& !GLumenIrradianceFieldGather;
}

bool ShouldRenderAOWithLumenGI()
{
	extern int32 GLumenShortRangeAmbientOcclusion;

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenSceneCardCapture.h:24

Scope: file

Source code excerpt:

{
	FIntPoint Size;
	FRDGTextureRef DirectLighting = nullptr;
	FRDGTextureRef IndirectLighting = nullptr;
	FRDGTextureRef NumFramesAccumulated = nullptr;
};

class FCardPageRenderData
{

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

Scope (from outer to inner):

file
function     void AllocateResampledCardCaptureAtlas

Source code excerpt:

	CardCaptureAtlas.Size = CardCaptureAtlasSize;

	CardCaptureAtlas.DirectLighting = GraphBuilder.CreateTexture(
		FRDGTextureDesc::Create2D(
			CardCaptureAtlasSize,
			Lumen::GetDirectLightingAtlasFormat(),
			FClearValueBinding::Green,
			TexCreate_ShaderResource | TexCreate_RenderTargetable | TexCreate_NoFastClear),
		TEXT("Lumen.ResampledCardCaptureDirectLighting"));

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

Scope: file

Source code excerpt:

			FResampleLightingHistoryToCardCaptureParameters* PassParameters = GraphBuilder.AllocParameters<FResampleLightingHistoryToCardCaptureParameters>();

			PassParameters->RenderTargets[0] = FRenderTargetBinding(CardCaptureAtlas.DirectLighting, ERenderTargetLoadAction::ENoAction);
			PassParameters->RenderTargets[1] = FRenderTargetBinding(CardCaptureAtlas.IndirectLighting, ERenderTargetLoadAction::ENoAction);
			PassParameters->RenderTargets[2] = FRenderTargetBinding(CardCaptureAtlas.NumFramesAccumulated, ERenderTargetLoadAction::ENoAction);

			PassParameters->PS.View = View.ViewUniformBuffer;
			PassParameters->PS.LumenCardScene = FrameTemporaries.LumenCardSceneUniformBuffer;
			PassParameters->PS.DirectLightingAtlas = FrameTemporaries.DirectLightingAtlas;

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenSurfaceCache.cpp:420

Scope: file

Source code excerpt:


		extern int32 GLumenSceneSurfaceCacheResampleLighting;
		const bool bResample = GLumenSceneSurfaceCacheResampleLighting != 0 && ResampledCardCaptureAtlas.DirectLighting != nullptr;
		const bool bRadiosityEnabled = LumenRadiosity::IsEnabled(ViewFamily);

		FCopyCardCaptureLightingToAtlasParameters* PassParameters = GraphBuilder.AllocParameters<FCopyCardCaptureLightingToAtlasParameters>();

		PassParameters->RenderTargets[0] = FRenderTargetBinding(FrameTemporaries.DirectLightingAtlas, ERenderTargetLoadAction::ELoad, 0);
		PassParameters->RenderTargets[1] = FRenderTargetBinding(FrameTemporaries.FinalLightingAtlas, ERenderTargetLoadAction::ELoad, 0);

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenSurfaceCache.cpp:434

Scope: file

Source code excerpt:

		PassParameters->PS.AlbedoCardCaptureAtlas = CardCaptureAtlas.Albedo;
		PassParameters->PS.EmissiveCardCaptureAtlas = CardCaptureAtlas.Emissive;
		PassParameters->PS.DirectLightingCardCaptureAtlas = ResampledCardCaptureAtlas.DirectLighting;
		PassParameters->PS.RadiosityCardCaptureAtlas = ResampledCardCaptureAtlas.IndirectLighting;
		PassParameters->PS.RadiosityNumFramesAccumulatedCardCaptureAtlas = ResampledCardCaptureAtlas.NumFramesAccumulated;

		FCopyCardCaptureLightingToAtlasPS::FPermutationDomain PermutationVector;
		PermutationVector.Set<FCopyCardCaptureLightingToAtlasPS::FIndirectLighting>(bRadiosityEnabled);
		PermutationVector.Set<FCopyCardCaptureLightingToAtlasPS::FResample>(bResample);

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenViewState.h:23

Scope (from outer to inner):

file
class        class FLumenGatherCvarState

Source code excerpt:

	float SurfaceBias;
	int32 VoxelTracingMode;
	int32 DirectLighting;

	inline bool operator==(const FLumenGatherCvarState& Rhs) const
	{
		return TraceMeshSDFs == Rhs.TraceMeshSDFs &&
			MeshSDFTraceDistance == Rhs.MeshSDFTraceDistance &&
			SurfaceBias == Rhs.SurfaceBias &&
			VoxelTracingMode == Rhs.VoxelTracingMode &&
			DirectLighting == Rhs.DirectLighting;
	}
};

class FScreenProbeGatherTemporalState
{
public:

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

Scope (from outer to inner):

file
function     static void PreparePathTracingData

Source code excerpt:


	PathTracingData.EnabledDirectLightingContributions = 0;
	if (ShowFlags.DirectLighting != 0)
	{
		PathTracingData.EnabledDirectLightingContributions |= (PPV.PathTracingIncludeEmissive != 0                           ) ? PATHTRACER_CONTRIBUTION_EMISSIVE : 0;
		PathTracingData.EnabledDirectLightingContributions |= (PPV.PathTracingIncludeDiffuse  != 0 && ShowFlags.Diffuse  != 0) ? PATHTRACER_CONTRIBUTION_DIFFUSE  : 0;
		PathTracingData.EnabledDirectLightingContributions |= (PPV.PathTracingIncludeSpecular != 0 && ShowFlags.Specular != 0) ? PATHTRACER_CONTRIBUTION_SPECULAR : 0;
		PathTracingData.EnabledDirectLightingContributions |= (PPV.PathTracingIncludeVolume   != 0                           ) ? PATHTRACER_CONTRIBUTION_VOLUME   : 0;
	}