UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ShadowRendering.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3/*=============================================================================
4 ShadowRendering.h: Shadow rendering definitions.
5=============================================================================*/
6
7#pragma once
8
9#include "CoreMinimal.h"
10#include "HAL/IConsoleManager.h"
12#include "RHI.h"
14#include "LightSceneProxy.h"
15#include "RenderResource.h"
16#include "UniformBuffer.h"
17#include "SceneInterface.h"
18#include "ShaderParameters.h"
19#include "Shader.h"
20#include "HitProxies.h"
21#include "ConvexVolume.h"
22#include "RHIStaticStates.h"
23#include "RendererInterface.h"
24#include "SceneManagement.h"
25#include "ScenePrivateBase.h"
26#include "SceneCore.h"
27#include "GlobalShader.h"
28#include "SystemTextures.h"
32#include "LightRendering.h"
34#include "Substrate/Substrate.h"
37
41class FScene;
42class FSceneRenderer;
43class FViewInfo;
48
50{
51 // Use Shadow stencil mask is set to 0x07u instead of 0xFF so that that highest bit can be used for Substrate classification without clearing the stencil bit for pre-shadow/per-object static shadow mask
52 constexpr uint32 ShadowStencilMask = 0x07u;
53};
54
56
58extern void DrawStencilingCone(const FMatrix& ConeToWorld, float ConeAngle, float SphereRadius, const FVector& PreViewTranslation);
59
61
71 );
72
84
86{
87 None = 0,
88 VSM = 1 << 0,
89 Directional = 1 << 1,
90 Point = 1 << 2,
91 OnePassPoint = 1 << 3
92};
93
95
97
98extern bool UseCachedMeshDrawCommands(EShadowDepthType ShadowDepthType);
99
106{
107 SM = 1U << 0U,
108 VSM = 1U << 1U, // declared if GPU-Scene instace culling is supported.
109 All = SM | VSM,
110};
111
113
114
116{
117public:
118
120 const FScene* Scene,
123 EShadowDepthType ShadowDepthType,
125
126 virtual void AddMeshBatch(const FMeshBatch& RESTRICT MeshBatch, uint64 BatchElementMask, const FPrimitiveSceneProxy* RESTRICT PrimitiveSceneProxy, int32 StaticMeshId = -1) override final;
127 virtual void CollectPSOInitializers(const FSceneTexturesConfig& SceneTexturesConfig, const FMaterial& Material, const FPSOPrecacheVertexFactoryData& VertexFactoryData, const FPSOPrecacheParams& PreCacheParams, TArray<FPSOPrecacheData>& PSOInitializers) override final;
128
130
131private:
132 bool TryAddMeshBatch(const FMeshBatch& RESTRICT MeshBatch,
134 const FPrimitiveSceneProxy* RESTRICT PrimitiveSceneProxy,
136 const FMaterialRenderProxy& MaterialRenderProxy,
137 const FMaterial& Material);
138
139 bool Process(
143 const FPrimitiveSceneProxy* RESTRICT PrimitiveSceneProxy,
144 const FMaterialRenderProxy& RESTRICT MaterialRenderProxy,
145 const FMaterial& RESTRICT MaterialResource,
146 ERasterizerFillMode MeshFillMode,
147 ERasterizerCullMode MeshCullMode);
148
149 void CollectPSOInitializersForEachShadowDepthType(
150 const FPSOPrecacheVertexFactoryData& VertexFactoryData,
151 const FMaterial& RESTRICT MaterialResource,
152 ERasterizerFillMode MeshFillMode,
153 ERasterizerCullMode MeshCullMode,
154 bool bCastShadowAsTwoSided,
156
157 void CollectPSOInitializersForEachStreamSetup(
158 const FPSOPrecacheVertexFactoryData& VertexFactoryData,
159 const FMaterial& RESTRICT MaterialResource,
161 ERasterizerFillMode MeshFillMode,
162 ERasterizerCullMode MeshCullMode,
163 bool bRequired,
165
166 void CollectPSOInitializersInternal(
167 const FPSOPrecacheVertexFactoryData& VertexFactoryData,
168 const FMaterial& RESTRICT MaterialResource,
170 ERasterizerFillMode MeshFillMode,
171 ERasterizerCullMode MeshCullMode,
173 bool bRequired,
175
176 EShadowDepthType ShadowDepthType;
178};
179
187
189{
190 // SDCM_StaticPrimitivesOnly shadowmaps are emitted randomly as the cache needs to be updated,
191 // And therefore not appropriate for occlusion queries which are latent and therefore need to be stable.
192 // Only one the cache modes from ComputeWholeSceneShadowCacheModes should be queryable
194}
195
208
210{
211public:
214
216 DepthTarget(nullptr)
217 {}
218
220 {
221 if (DepthTarget)
222 {
223 return DepthTarget->GetDesc().Extent;
224 }
225 else
226 {
227 check(ColorTargets.Num() > 0);
228 return ColorTargets[0]->GetDesc().Extent;
229 }
230 }
231
233 {
234 int32 ColorTargetsCount = SourceTargets.ColorTargets.Num();
236 ColorTargets.AddDefaulted(ColorTargetsCount);
237 for (int32 TargetIndex = 0; TargetIndex < ColorTargetsCount; TargetIndex++)
238 {
239 ColorTargets[TargetIndex] = SourceTargets.ColorTargets[TargetIndex].GetReference();
240 }
241
242 DepthTarget = SourceTargets.DepthTarget.GetReference();
243 }
244};
245
248
251 SHADER_PARAMETER(FMatrix44f, ProjectionMatrix)
252 SHADER_PARAMETER(FMatrix44f, ViewMatrix)
256 SHADER_PARAMETER_ARRAY(FMatrix44f, ShadowViewMatrices, [6])
258
261 SHADER_PARAMETER_RDG_BUFFER_SRV(StructuredBuffer< uint4 >, AllocatedPageRectBounds)
262 SHADER_PARAMETER_RDG_BUFFER_SRV(StructuredBuffer< uint4 >, UncachedPageRectBounds)
265
268 SHADER_PARAMETER(FMatrix44f, ProjectionMatrix)
269 SHADER_PARAMETER(FMatrix44f, ViewMatrix)
274
279{
280public:
282
293
296
298
301
304
307
312
315
318
325
327
329
336
339
342
344
346
348
355
362
365
368
370 void ComputeScissorRectOptim();
371
374
377
380
383
386
389
390 // redundant to LightSceneInfo->Proxy->GetLightType() == LightType_Directional, could be made ELightComponentType LightType
392
395
398
401
404
407
410
413
416
419
422
425
428
432
435
437
440
443
446
449
453
456
459
462
464 int32 ProjectionIndex = 0;
465
467 int32 SubjectPrimitiveComponentIndex = -1;
468
469 int32 ExplicitNaniteInstanceChunkStartOffset = INDEX_NONE;
470 int32 ExplicitNaniteInstanceChunkEndOffset = INDEX_NONE;
471 int32 ExplicitNaniteInstanceLastChunkSize = 0;
472
474
475public:
476
477 // default constructor
479
481
487 bool SetupPerObjectProjection(
491 bool bInPreShadow,
495 float InMaxScreenPercent,
497 );
498
500 void SetupWholeSceneProjection(
509 );
510
512 void SetupClipmapProjection(
515 const TSharedPtr<FVirtualShadowMapClipmap> &VirtualShadowMapClipmap,
517 );
518
524 FViewMatrices GetShadowDepthRenderingViewMatrices(int32 CubeFaceIndex = -1, bool bUseForVSMCubeFaceWorkaround = false) const;
525
526 float GetShaderDepthBias() const { return ShaderDepthBias; }
527 float GetShaderSlopeDepthBias() const { return ShaderSlopeDepthBias; }
528 float GetShaderMaxSlopeDepthBias() const { return ShaderMaxSlopeDepthBias; }
529 float GetShaderReceiverDepthBias() const;
530
531 void SetStateForView(FRHICommandList& RHICmdList, bool bRequiresBorderClamp = false) const;
532
535 {
536 return {
537 int32(X + BorderSize),
538 int32(Y + BorderSize),
539 int32(X + BorderSize + ResolutionX),
540 int32(Y + BorderSize + ResolutionY),
541 };
542 }
543
546 {
547 return {
548 int32(X),
549 int32(Y),
550 int32(X + 2 * BorderSize + ResolutionX),
551 int32(Y + 2 * BorderSize + ResolutionY),
552 };
553 }
554
557
558 void ClearDepth(FRHICommandList& RHICmdList) const;
559
561 void RenderTranslucencyDepths(FRDGBuilder& GraphBuilder, class FSceneRenderer* SceneRenderer, const FRenderTargetBindingSlots& RenderTargets, FInstanceCullingManager& InstanceCullingManager);
562
563 static bool SupportsShadowStencilCulling(FStaticShaderPlatform ShaderPlatform);
564
565 bool UseShadowStencilCulling(const FViewInfo& View) const;
566
567 static FRHIBlendState* GetBlendStateForProjection(
568 int32 ShadowMapChannel,
570 bool bUseFadePlane,
573
574 FRHIBlendState* GetBlendStateForProjection(bool bProjectingForForwardShading, bool bMobileModulatedProjections) const;
575
579 void RenderProjection(
580 FRDGBuilder& GraphBuilder,
582 int32 ViewIndex,
583 const FViewInfo* View,
587 bool bSubPixelShadow) const;
588
589 void RenderProjectionInternal(
590 FRHICommandList& RHICmdList,
591 int32 ViewIndex,
592 const FViewInfo* View,
599
603 void RenderMobileModulatedShadowProjection(
604 FRHICommandList& RHICmdList,
605 int32 ViewIndex,
606 const FViewInfo* View,
608 const FSceneRenderer* SceneRender) const;
609
613 void RenderDepth(
614 FRDGBuilder& GraphBuilder,
615 const FSceneRenderer* SceneRenderer,
618 bool bDoCrossGPUCopy);
619
622 {
623 DistanceFieldShadowViewGPUData& SDFShadowViewGPUData = CachedDistanceFieldShadowViewGPUData.FindOrAdd(View);
624 SDFShadowViewGPUData.RayTracedShadowsTexture = nullptr;
625 }
626
632 FScreenPassTexture RenderRayTracedDistanceFieldProjection(
633 FRDGBuilder& GraphBuilder,
634 bool bAsyncCompute,
635 const FMinimalSceneTextures& SceneTextures,
636 const FViewInfo& View,
637 const FIntRect& ScissorRect);
638
643 void RenderRayTracedDistanceFieldProjection(
644 FRDGBuilder& GraphBuilder,
645 const FMinimalSceneTextures& SceneTextures,
647 const FViewInfo& View,
648 FIntRect ScissorRect,
650 bool bForceRGBModulation = false,
652
654 void RenderOnePassPointLightProjection(
655 FRDGBuilder& GraphBuilder,
657 int32 ViewIndex,
658 const FViewInfo& View,
661 bool bSubPixelShadow) const;
662
666 void RenderFrustumWireframe(FPrimitiveDrawInterface* PDI) const;
667
671 bool AddSubjectPrimitive(FPrimitiveSceneInfo* PrimitiveSceneInfo, TArrayView<FViewInfo> ViewArray, bool bRecordShadowSubjectForMobileShading, bool bInvertViewShadowRelevance = false);
672
673 uint64 AddSubjectPrimitive_AnyThread(
676 ERHIFeatureLevel::Type FeatureLevel,
679
680 void PresizeSubjectPrimitiveArrays(struct FAddSubjectPrimitiveStats const& Stats);
681
682 void FinalizeAddSubjectPrimitive(
683 FDynamicShadowsTaskData& TaskData,
684 struct FAddSubjectPrimitiveOp const& Op,
687
691 bool HasSubjectPrims() const;
692
696 void AddReceiverPrimitive(FPrimitiveSceneInfo* PrimitiveSceneInfo);
697
699 {
700 // Processes all operations in a single pass.
701 All,
702
703 // Parallel pass runs first and processes elements in parallel with other shadows.
704 Parallel,
705
706 // Serial pass runs second and processes elements serially other shadows.
707 Serial,
708 };
709
711 bool GatherDynamicMeshElements(FMeshElementCollector& MeshCollector, FSceneRenderer& Renderer, class FVisibleLightInfo& VisibleLightInfo, TArray<const FSceneView*>& ReusedViewsArray, EGatherDynamicMeshElementsPass Pass);
712
713 void SetupMeshDrawCommandsForShadowDepth(FSceneRenderer& Renderer, FInstanceCullingManager& InstanceCullingManager);
714
715 void SetupMeshDrawCommandsForProjectionStenciling(FSceneRenderer& Renderer, FInstanceCullingManager& InstanceCullingManager);
716
721 bool SubjectsVisible(const FViewInfo& View) const;
722
724 void ClearTransientArrays();
725
727 friend uint32 GetTypeHash(const FProjectedShadowInfo* ProjectedShadowInfo)
728 {
729 return PointerHash(ProjectedShadowInfo);
730 }
731
734 {
735 return GetScreenToShadowMatrix(View, X, Y, ResolutionX, ResolutionY);
736 }
737
738 FVector4f GetClipToShadowBufferUvScaleBias() const;
739
744 FMatrix GetScreenToShadowMatrix(const FSceneView& View, uint32 TileOffsetX, uint32 TileOffsetY, uint32 TileResolutionX, uint32 TileResolutionY) const;
745
747 FMatrix GetWorldToShadowMatrix(FVector4f& ShadowmapMinMax, const FIntPoint* ShadowBufferResolutionOverride = nullptr) const;
748
751 {
752 if (HasVirtualShadowMap())
753 {
755 }
756 return RenderTargets.GetSize();
757 }
758
760 void UpdateShaderDepthBias();
761
763 float ComputeTransitionSize() const;
764
765 bool IsWholeSceneDirectionalShadow() const;
766 bool IsWholeScenePointLightShadow() const;
767
769 {
770 return IsWholeSceneDirectionalShadow() || (bPreShadow && bDirectionalLight);
771 }
772
773 // 0 if Setup...() wasn't called yet
774 FLightSceneInfo& GetLightSceneInfo() const { return *LightSceneInfo; }
775 const FLightSceneInfoCompact& GetLightSceneInfoCompact() const { return LightSceneInfoCompact; }
780 const FPrimitiveSceneInfo* GetParentSceneInfo() const { return ParentSceneInfo; }
781
783 void SetupShadowDepthView(FSceneRenderer* SceneRenderer);
784
786 {
788
789 if (bDirectionalLight)
790 {
791 ShadowDepthType |= EShadowDepthType::Directional;
792 }
793 else if (bOnePassPointLightShadow)
794 {
795 ShadowDepthType |= EShadowDepthType::OnePassPoint;
796 }
797 else
798 {
799 ShadowDepthType |= EShadowDepthType::Point;
800 }
801
802 return ShadowDepthType;
803 }
804
806 {
807 return ::GetShadowMeshPassType(GetShadowDepthType());
808 }
809
810 bool HasVirtualShadowMap() const { return VirtualShadowMapPerLightCacheEntry.IsValid(); }
811
813
814 float GetMaxNonFarCascadeDistance() const { return MaxNonFarCascadeDistance; }
815
817 FRDGBuilder& GraphBuilder,
818 FGPUScene& GPUScene,
820 {
821 ShadowDepthView->DynamicPrimitiveCollector.Commit();
822 return ShadowDepthPass.BuildRenderingCommands(GraphBuilder, GPUScene, InstanceCullingDrawParams);
823 }
824
826 bool ShouldUseCSMScissorOptim() const;
827
828 const TArray<FMeshBatchAndRelevance, SceneRenderingAllocator>& GetDynamicSubjectHeterogeneousVolumeMeshElements() const { return DynamicSubjectHeterogeneousVolumeMeshElements; }
829
830private:
831 // 0 if Setup...() wasn't called yet
832 FLightSceneInfo* LightSceneInfo;
833 FLightSceneInfoCompact LightSceneInfoCompact;
834
839 const FPrimitiveSceneInfo* ParentSceneInfo;
840
842 PrimitiveArrayType DynamicSubjectPrimitives;
844 PrimitiveArrayType ReceiverPrimitives;
846 PrimitiveArrayType SubjectTranslucentPrimitives;
848 PrimitiveArrayType SubjectHeterogeneousVolumePrimitives;
849
853 TArray<FMeshBatchAndRelevance,SceneRenderingAllocator> DynamicSubjectTranslucentMeshElements;
855 TArray<FMeshBatchAndRelevance, SceneRenderingAllocator> DynamicSubjectHeterogeneousVolumeMeshElements;
856
857 TArray<const FStaticMeshBatch*, SceneRenderingAllocator> SubjectMeshCommandBuildRequests;
859
861 int32 NumDynamicSubjectMeshElements;
862
864 int32 NumSubjectMeshCommandBuildRequestElements;
865
866 FMeshCommandOneFrameArray ShadowDepthPassVisibleCommands;
867 FParallelMeshDrawCommandPass ShadowDepthPass;
868
870
871 FDynamicMeshDrawCommandStorage DynamicMeshDrawCommandStorage;
872 FGraphicsMinimalPipelineStateSet GraphicsMinimalPipelineStateSet;
873 bool NeedsShaderInitialisation;
874 // If >= 0.0f then this records the cascade distance to the farthest non-'far' shadow cascade. Only used for clipmaps at the moment.
875 float MaxNonFarCascadeDistance = -1.0f;
876
881 float ShaderDepthBias;
882 float ShaderSlopeDepthBias;
883 float ShaderMaxSlopeDepthBias;
884
886 struct DistanceFieldShadowViewGPUData
887 {
889 FRDGTextureRef RayTracedShadowsTexture = nullptr;
890
891 FLightTileIntersectionParameters* SDFLightTileIntersectionParameters = nullptr;
892 FDistanceFieldCulledObjectBufferParameters* SDFCulledObjectBufferParameters = nullptr;
893 FLightTileIntersectionParameters* HeightFieldLightTileIntersectionParameters = nullptr;
894 FDistanceFieldCulledObjectBufferParameters* HeightFieldCulledObjectBufferParameters = nullptr;
895 };
896 TMap<const FViewInfo*, DistanceFieldShadowViewGPUData> CachedDistanceFieldShadowViewGPUData;
897
898 void CopyCachedShadowMap(
899 FRDGBuilder& GraphBuilder,
900 const FViewInfo& View,
901 const FSceneRenderer* SceneRenderer,
902 const FRenderTargetBindingSlots& RenderTargets,
903 const FMeshPassProcessorRenderState& DrawRenderState);
904
905 float GetLODDistanceFactor() const;
906
910 void ModifyViewForShadow(FViewInfo* FoundView) const;
911
913 void BeginRenderView(FRDGBuilder& GraphBuilder, FScene* Scene);
914
918 FViewInfo* FindViewForShadow(FSceneRenderer* SceneRenderer) const;
919
920 void AddCachedMeshDrawCommandsForPass(
921 const FMeshDrawCommandPrimitiveIdInfo &PrimitiveIdInfo,
925 EMeshDrawCommandCullingPayloadFlags CullingPayloadFlags,
926 const FScene* Scene,
927 EMeshPass::Type PassType,
928 FMeshCommandOneFrameArray& VisibleMeshCommands,
932
933 void AddCachedMeshDrawCommands_AnyThread(
934 const FScene* Scene,
941
942
943 /*
944 * Helper to calculate the LOD such that we do not repeat this in threaded & non threaded versions
945 * NOTE: Reads and modifies the CurrentView.PrimitivesLODMask for the given primitive.
946 * Storing it is an optimization for the case where a primitive is not visible in the main view but in several shadow views (e.g., cascades).
947 * This also creates a potential data race if we ever process multiple shadows infos for the same view and primitive in parallel (e.g., cascades).
948 */
949 FORCEINLINE_DEBUGGABLE FLODMask CalcAndUpdateLODToRender(FViewInfo& CurrentView, const FBoxSphereBounds& Bounds, const FPrimitiveSceneInfo* PrimitiveSceneInfo, int32 ForcedLOD) const;
950
956
958 bool ShouldDrawStaticMeshes(FViewInfo& InCurrentView, FPrimitiveSceneInfo* InPrimitiveSceneInfo);
959
960 bool ShouldDrawStaticMeshes_AnyThread(
963 bool bMayBeFading,
967
968 void GetShadowTypeNameForDrawEvent(FString& TypeName) const;
969
971 int32 UpdateShadowCastingObjectBuffers() const;
972
974 bool GatherDynamicMeshElementsArray(
975 FMeshElementCollector& Collector,
977 const TArray<const FSceneView*>& Views,
978 const FSceneViewFamily& ViewFamily,
982
983 bool GatherDynamicHeterogeneousVolumeMeshElementsArray(
985 FMeshElementCollector& Collector,
987 const TArray<const FSceneView*>& Views,
988 const FSceneViewFamily& ViewFamily,
992
993 void SetupFrustumForProjection(const FViewInfo* View, TArray<FVector4f, TInlineAllocator<8>>& OutFrustumVertices, bool& bOutCameraInsideShadowFrustum, FPlane* OutPlanes) const;
994
995 void SetupProjectionStencilMask(
996 FRHICommandList& RHICmdList,
997 const FViewInfo* View,
998 int32 ViewIndex,
999 const class FSceneRenderer* SceneRender,
1004
1005 void SetupProjectionStencilMaskForHair(FRHICommandList& RHICmdList, const FViewInfo* View) const;
1006
1007 FORCEINLINE bool TestPrimitiveFarCascadeConditions(bool bPrimitiveCastsFarShadow, const FBoxSphereBounds& Bounds) const;
1008
1009 friend class FShadowDepthVS;
1012 friend class FShadowProjectionPS;
1013};
1014
1016{
1017 None,
1018 DrawingFrustum = 0x01
1019};
1021
1022
1026{
1028public:
1029
1033 {
1034 const FShaderParameterMap& ParameterMap = Initializer.ParameterMap;
1035
1036 StencilingGeometryParameters.Bind(ParameterMap);
1037 InvReceiverInnerMatrix.Bind(ParameterMap, TEXT("InvReceiverInnerMatrix"));
1038 PreShadowToPreViewTranslation.Bind(ParameterMap, TEXT("PreShadowToPreViewTranslation"));
1039 }
1040
1042
1043private:
1045 LAYOUT_FIELD(FShaderParameter, InvReceiverInnerMatrix);
1047};
1048
1061
1083
1086{
1088public:
1090 {
1091 const FShaderParameterMap& ParameterMap = Initializer.ParameterMap;
1092 ScreenToShadowMatrix.Bind(ParameterMap,TEXT("ScreenToShadowMatrix"));
1093 SoftTransitionScale.Bind(ParameterMap,TEXT("SoftTransitionScale"));
1094 ShadowBufferSize.Bind(ParameterMap,TEXT("ShadowBufferSize"));
1095 ShadowDepthTexture.Bind(ParameterMap,TEXT("ShadowDepthTexture"));
1096 ShadowDepthTextureSampler.Bind(ParameterMap,TEXT("ShadowDepthTextureSampler"));
1097 ProjectionDepthBias.Bind(ParameterMap,TEXT("ProjectionDepthBiasParameters"));
1098 FadePlaneOffset.Bind(ParameterMap,TEXT("FadePlaneOffset"));
1099 InvFadePlaneLength.Bind(ParameterMap,TEXT("InvFadePlaneLength"));
1100 ShadowTileOffsetAndSizeParam.Bind(ParameterMap, TEXT("ShadowTileOffsetAndSize"));
1101 LightPositionOrDirection.Bind(ParameterMap, TEXT("LightPositionOrDirection"));
1102 PerObjectShadowFadeStart.Bind(ParameterMap, TEXT("PerObjectShadowFadeStart"));
1103 InvPerObjectShadowFadeLength.Bind(ParameterMap, TEXT("InvPerObjectShadowFadeLength"));
1104 ShadowNearAndFarDepth.Bind(ParameterMap, TEXT("ShadowNearAndFarDepth"));
1105 bCascadeUseFadePlane.Bind(ParameterMap, TEXT("bCascadeUseFadePlane"));
1106 }
1107
1109 {
1110 const FVector PreViewTranslation = View.ViewMatrices.GetPreViewTranslation();
1111 const FIntPoint ShadowBufferResolution = ShadowInfo->GetShadowBufferResolution();
1112
1113 if (ShadowTileOffsetAndSizeParam.IsBound())
1114 {
1115 FVector2D InverseShadowBufferResolution(1.0f / ShadowBufferResolution.X, 1.0f / ShadowBufferResolution.Y);
1117 (ShadowInfo->BorderSize + ShadowInfo->X) * InverseShadowBufferResolution.X,
1118 (ShadowInfo->BorderSize + ShadowInfo->Y) * InverseShadowBufferResolution.Y,
1122 }
1123
1124 // Set the transform from screen coordinates to shadow depth texture coordinates.
1126 {
1127 // UE-29083 : work around precision issues with ScreenToShadowMatrix on low end devices.
1128 const FMatrix44f ScreenToShadow = FMatrix44f(ShadowInfo->GetScreenToShadowMatrix(View, 0, 0, ShadowBufferResolution.X, ShadowBufferResolution.Y)); // LWC_TODO: Precision loss
1130 }
1131 else
1132 {
1133 const FMatrix44f ScreenToShadow = FMatrix44f(ShadowInfo->GetScreenToShadowMatrix(View)); // LWC_TODO: Precision loss
1135 }
1136
1137 if (SoftTransitionScale.IsBound())
1138 {
1139 const float TransitionSize = ShadowInfo->ComputeTransitionSize();
1140
1142 }
1143
1144 if (ShadowBufferSize.IsBound())
1145 {
1146 FVector2D ShadowBufferSizeValue(ShadowBufferResolution.X, ShadowBufferResolution.Y);
1147
1148 SetShaderValue(BatchedParameters, ShadowBufferSize,
1150 }
1151
1153
1154 // Translucency shadow projection has no depth target
1155 if (ShadowInfo->RenderTargets.DepthTarget)
1156 {
1158 }
1159 else
1160 {
1161 ShadowDepthTextureValue = GSystemTextures.BlackDummy->GetRHI();
1162 }
1163
1165
1167
1168 if (ShadowDepthTextureSampler.IsBound())
1169 {
1171 }
1172
1174 SetShaderValue(BatchedParameters, FadePlaneOffset, ShadowInfo->CascadeSettings.FadePlaneOffset);
1175
1176 if(InvFadePlaneLength.IsBound() && bUseFadePlane)
1177 {
1178 check(ShadowInfo->CascadeSettings.FadePlaneLength > 0);
1180 }
1181
1182 if (LightPositionOrDirection.IsBound())
1183 {
1184 const FVector LightDirection = ShadowInfo->GetLightSceneInfo().Proxy->GetDirection();
1185 const FVector LightPosition = ShadowInfo->GetLightSceneInfo().Proxy->GetPosition() + PreViewTranslation;
1186 const bool bIsDirectional = ShadowInfo->GetLightSceneInfo().Proxy->GetLightType() == LightType_Directional;
1188 }
1189
1190 if (SubPixelShadow)
1191 {
1192 float DeviceZNear = 1;
1193 float DeviceZFar = 0;
1194 const bool bIsCascadedShadow = ShadowInfo->bDirectionalLight && !(ShadowInfo->bPerObjectOpaqueShadow || ShadowInfo->bPreShadow);
1196 {
1199 // LWC_TODO: precision loss?
1200 DeviceZNear = (float)(Near.Z / Near.W);
1201 DeviceZFar = (float)(Far.Z / Far.W);
1202 }
1203
1209 }
1210
1211 SetShaderValue(BatchedParameters, PerObjectShadowFadeStart, ShadowInfo->PerObjectShadowFadeStart);
1212 SetShaderValue(BatchedParameters, InvPerObjectShadowFadeLength, ShadowInfo->InvPerObjectShadowFadeLength);
1213 }
1214
1215private:
1218 LAYOUT_FIELD(FShaderParameter, ShadowBufferSize);
1222 LAYOUT_FIELD(FShaderParameter, FadePlaneOffset);
1226 LAYOUT_FIELD(FShaderParameter, PerObjectShadowFadeStart);
1227 LAYOUT_FIELD(FShaderParameter, InvPerObjectShadowFadeLength);
1230};
1231
1236template<uint32 Quality, bool bUseFadePlane = false, bool bModulatedShadows = false, bool bUseTransmission = false, bool SubPixelShadow = false>
1238{
1240public:
1241
1246
1253 {
1255 ShadowFadeFraction.Bind(Initializer.ParameterMap,TEXT("ShadowFadeFraction"));
1256 ShadowSharpen.Bind(Initializer.ParameterMap,TEXT("ShadowSharpen"));
1257 LightPosition.Bind(Initializer.ParameterMap, TEXT("LightPositionAndInvRadius"));
1258
1259 }
1260
1262 {
1264 || (bUseTransmission == 0 && SubPixelShadow == 0); // Mobile uses only those
1265 }
1266
1272 {
1274 OutEnvironment.SetDefine(TEXT("SHADOW_QUALITY"), Quality);
1275 OutEnvironment.SetDefine(TEXT("SUBPIXEL_SHADOW"), (uint32)(SubPixelShadow ? 1 : 0));
1276 OutEnvironment.SetDefine(TEXT("USE_FADE_PLANE"), (uint32)(bUseFadePlane ? 1 : 0));
1277 OutEnvironment.SetDefine(TEXT("USE_TRANSMISSION"), (uint32)(bUseTransmission ? 1 : 0));
1278
1280 OutEnvironment.SetDefine(TEXT("FORCE_DEPTH_TEXTURE_READS"), (uint32)(bMobileForceDepthRead ? 1 : 0));
1281 }
1282
1290 int32 ViewIndex,
1291 const FSceneView& View,
1292 const FProjectedShadowInfo* ShadowInfo,
1293 bool bUseLightFunctionAtlas)
1294 {
1295 const FVector PreViewTranslation = View.ViewMatrices.GetPreViewTranslation();
1296 const bool bUseFadePlaneEnable = ShadowInfo->CascadeSettings.FadePlaneLength > 0;
1297
1299 const FLightSceneProxy& LightProxy = *(ShadowInfo->GetLightSceneInfo().Proxy);
1300
1302 SetShaderValue(BatchedParameters, ShadowSharpen, LightProxy.GetShadowSharpen() * 7.0f + 1.0f );
1303 SetShaderValue(BatchedParameters, LightPosition, FVector4f(FVector3f((FVector)LightProxy.GetPosition() + PreViewTranslation), 1.0f / LightProxy.GetRadius()));
1304
1306
1307 if (DeferredLightParameter.IsBound())
1308 {
1309 SetDeferredLightParameters(BatchedParameters, DeferredLightParameter, &ShadowInfo->GetLightSceneInfo(), View, bUseLightFunctionAtlas);
1310 }
1311
1312
1313 FScene* Scene = nullptr;
1314
1315 if (View.Family->Scene)
1316 {
1317 Scene = View.Family->Scene->GetRenderScene();
1318 }
1319 }
1320
1321protected:
1326};
1327
1329template<uint32 Quality>
1330class TModulatedShadowProjection : public TShadowProjectionPS<Quality, false, true>
1331{
1333public:
1334
1336 {
1338 OutEnvironment.SetDefine(TEXT("MODULATED_SHADOWS"), 1);
1340 OutEnvironment.SetDefine(TEXT("IS_MOBILE_DEPTHREAD_SUBPASS"), bMobileForceDepthRead ? 0u : 1u);
1341 }
1342
1344 {
1345 return IsMobilePlatform(Parameters.Platform);
1346 }
1347
1349
1351
1354 int32 ViewIndex,
1355 const FSceneView& View,
1356 const FProjectedShadowInfo* ShadowInfo,
1357 bool bUseLightFunctionAtlas)
1358 {
1359 TShadowProjectionPS<Quality, false, true>::SetParameters(BatchedParameters, ViewIndex, View, ShadowInfo, bUseLightFunctionAtlas);
1361 }
1362
1363protected:
1366};
1367
1373 SHADER_PARAMETER(FVector4f, DirectionalLightColor)
1379
1381
1391
1394
1396template<uint32 Quality>
1398{
1400public:
1401
1407
1412
1414
1419
1422 int32 ViewIndex,
1423 const FSceneView& View,
1424 const FProjectedShadowInfo* ShadowInfo,
1425 bool bUseLightFunctionAtlas)
1426 {
1427 TShadowProjectionPS<Quality>::SetParameters(BatchedParameters, ViewIndex, View, ShadowInfo, bUseLightFunctionAtlas);
1428
1432 }
1433};
1434
1435
1443
1445
1446
1449{
1451public:
1452
1453 void Bind(const FShaderParameterMap& ParameterMap)
1454 {
1455 ShadowDepthTexture.Bind(ParameterMap,TEXT("ShadowDepthCubeTexture"));
1456 ShadowDepthTexture2.Bind(ParameterMap, TEXT("ShadowDepthCubeTexture2"));
1457 ShadowDepthCubeComparisonSampler.Bind(ParameterMap,TEXT("ShadowDepthCubeTextureSampler"));
1458 ShadowViewProjectionMatrices.Bind(ParameterMap, TEXT("ShadowViewProjectionMatrices"));
1459 InvShadowmapResolution.Bind(ParameterMap, TEXT("InvShadowmapResolution"));
1460 LightPositionOrDirection.Bind(ParameterMap, TEXT("LightPositionOrDirection"));
1461 }
1462
1463 inline void Set(FRHIBatchedShaderParameters& BatchedParameters, const FSceneView& View, const FProjectedShadowInfo* ShadowInfo) const
1464 {
1465 const FVector PreViewTranslation = View.ViewMatrices.GetPreViewTranslation();
1466
1468
1469 if (ShadowInfo)
1470 {
1471 if (FRHITexture* Texture = ShadowInfo->RenderTargets.DepthTarget->GetRHI())
1472 {
1474 }
1475 }
1476
1479
1480 if (LightPositionOrDirection.IsBound())
1481 {
1482 const FVector LightPosition = ShadowInfo ? FVector(ShadowInfo->GetLightSceneInfo().Proxy->GetPosition()) : FVector::ZeroVector;
1484 }
1485
1487 {
1488 // Use a comparison sampler to do hardware PCF
1490 }
1491
1492 const int32 NumShaderMatrices = FMath::DivideAndRoundUp<int32>(ShadowViewProjectionMatrices.GetNumBytes(), sizeof(FMatrix44f));
1493
1494 if (ShadowInfo)
1495 {
1496 const int32 NumUsableMatrices = FMath::Min<int32>(NumShaderMatrices, ShadowInfo->OnePassShadowViewProjectionMatrices.Num());
1499 for (int32 i = 0; i < NumUsableMatrices; i++)
1500 {
1501 TypeCastedMatrices[i] = FMatrix44f(ShadowInfo->OnePassShadowViewProjectionMatrices[i]); // LWC_TODO: Precision loss?
1502 }
1504 {
1506 }
1510 TypeCastedMatrices.GetData(),
1512 );
1513
1515 }
1516 else
1517 {
1520
1524 ZeroMatrices.GetData(),
1526 );
1527
1529 }
1530 }
1531
1533 /*friend FArchive& operator<<(FArchive& Ar,FOnePassPointShadowProjectionShaderParameters& P)
1534 {
1535 Ar << P.ShadowDepthTexture;
1536 Ar << P.ShadowDepthTexture2;
1537 Ar << P.ShadowDepthCubeComparisonSampler;
1538 Ar << P.ShadowViewProjectionMatrices;
1539 Ar << P.InvShadowmapResolution;
1540 Ar << P.LightPositionOrDirection;
1541 return Ar;
1542 }*/
1543
1544private:
1551};
1552
1556// Quality = 0 / 1
1557template <uint32 Quality, bool bUseTransmission, bool bUseSubPixel>
1559{
1561public:
1562
1564
1567 {
1568 HairStrandsParameters.Bind(Initializer.ParameterMap, FHairStrandsViewUniformParameters::FTypeInfo::GetStructMetadata()->GetShaderVariableName());
1569 SubstrateGlobalParameters.Bind(Initializer.ParameterMap, FSubstrateGlobalUniformParameters::FTypeInfo::GetStructMetadata()->GetShaderVariableName());
1570 OnePassShadowParameters.Bind(Initializer.ParameterMap);
1571 ShadowDepthTextureSampler.Bind(Initializer.ParameterMap,TEXT("ShadowDepthTextureSampler"));
1572 LightPosition.Bind(Initializer.ParameterMap,TEXT("LightPositionAndInvRadius"));
1573 ShadowFadeFraction.Bind(Initializer.ParameterMap,TEXT("ShadowFadeFraction"));
1574 ShadowSharpen.Bind(Initializer.ParameterMap,TEXT("ShadowSharpen"));
1575 PointLightDepthBias.Bind(Initializer.ParameterMap,TEXT("PointLightDepthBias"));
1576 PointLightProjParameters.Bind(Initializer.ParameterMap, TEXT("PointLightProjParameters"));
1577 }
1578
1580 {
1582 OutEnvironment.SetDefine(TEXT("SHADOW_QUALITY"), Quality);
1583 if (IsMobilePlatform(Parameters.Platform))
1584 {
1585 OutEnvironment.SetDefine(TEXT("USE_TRANSMISSION"), 0);
1586 }
1587 else
1588 {
1589 OutEnvironment.SetDefine(TEXT("USE_TRANSMISSION"), (uint32)(bUseTransmission ? 1 : 0));
1590 }
1591 OutEnvironment.SetDefine(TEXT("SUBPIXEL_SHADOW"), (uint32)(bUseSubPixel ? 1 : 0));
1592 }
1593
1595 {
1596 if (IsMobilePlatform(Parameters.Platform))
1597 {
1598 return !bUseTransmission;
1599 }
1600
1601 return true;
1602 }
1603
1606 int32 ViewIndex,
1607 const FViewInfo& View,
1608 const FProjectedShadowInfo* ShadowInfo,
1610 {
1611 const FVector PreViewTranslation = View.ViewMatrices.GetPreViewTranslation();
1612
1614
1615 const FLightSceneProxy& LightProxy = *(ShadowInfo->GetLightSceneInfo().Proxy);
1616
1617 SetShaderValue(BatchedParameters, LightPosition, FVector4f(FVector3f(FVector(LightProxy.GetPosition()) + PreViewTranslation), 1.0f / LightProxy.GetRadius()));
1618
1620 SetShaderValue(BatchedParameters, ShadowSharpen, LightProxy.GetShadowSharpen() * 7.0f + 1.0f);
1621
1626
1627 if (HairStrandsParameters.IsBound())
1628 {
1630 }
1631
1632 if (SubstrateGlobalParameters.IsBound())
1633 {
1634 TRDGUniformBufferRef<FSubstrateGlobalUniformParameters> SubstrateUniformBuffer = Substrate::BindSubstrateGlobalUniformParameters(View);
1636 }
1637
1638 FScene* Scene = nullptr;
1639
1640 if (View.Family->Scene)
1641 {
1642 Scene = View.Family->Scene->GetRenderScene();
1643 }
1644
1646
1648
1649 if (DeferredLightParameter.IsBound())
1650 {
1652 }
1653 }
1654
1655private:
1660 LAYOUT_FIELD(FShaderParameter, ShadowSharpen);
1665};
1666
1667// Reversed Z
1669{
1671 FMatrix(
1672 FPlane(1, 0, 0, WAxis.X),
1673 FPlane(0, 1, 0, WAxis.Y),
1674 FPlane(0, 0, -(WAxis.Z * MinZ + WAxis.W) / (MaxZ - MinZ), WAxis.Z),
1675 FPlane(0, 0, MaxZ *(WAxis.Z * MinZ + WAxis.W) / (MaxZ - MinZ), WAxis.W)
1676 )
1677 {}
1678
1679 // Off center projection
1681 : FMatrix(
1682 FPlane( 2.0f / (Max.X - Min.X), 0.0f, 0.0f, WAxis.X),
1683 FPlane( 0.0f, 2.0f / (Max.Y - Min.Y), 0.0f, WAxis.Y),
1684 FPlane( -(Max.X + Min.X) / (Max.X - Min.X), -(Max.Y + Min.Y) / (Max.Y - Min.Y), 0.0f, WAxis.Z),
1685 FPlane( 0.0f, 0.0f, 1.0f, WAxis.W)
1686 )
1687 {}
1688
1689 // Change near and far plane
1690 FShadowProjectionMatrix( const FMatrix& InMatrix, float MinZ, float MaxZ )
1691 : FMatrix( InMatrix )
1692 {
1693 M[2][2] = -( M[2][3] * MinZ + M[3][3] ) / ( MaxZ - MinZ );
1694 M[3][2] = MaxZ * -M[2][2];
1695 }
1696};
1697
1698
1700template<uint32 Quality, bool bUseFadePlane>
1702{
1704public:
1705
1712
1718
1724
1727 int32 ViewIndex,
1728 const FSceneView& View,
1729 const FProjectedShadowInfo* ShadowInfo,
1730 bool bUseLightFunctionAtlas)
1731 {
1732 TShadowProjectionPS<Quality, bUseFadePlane>::SetParameters(BatchedParameters, ViewIndex, View, ShadowInfo, bUseLightFunctionAtlas);
1733
1734 // GetLightSourceAngle returns the full angle.
1736
1739 int32 MaxKernelSize = CVarMaxSoftShadowKernelSize->GetInt();
1740
1741 float SW = 2.0 * ShadowInfo->ShadowBounds.W;
1742 float SZ = ShadowInfo->MaxSubjectZ - ShadowInfo->MinSubjectZ;
1743
1744 FVector4f PCSSParameterValues = FVector4f(TanLightSourceAngle * SZ / SW, MaxKernelSize / float(ShadowInfo->ResolutionX), 0, 0);
1746 }
1747
1748protected:
1750};
1751
1752
1754template<uint32 Quality, bool bUseFadePlane>
1756{
1758public:
1759
1766
1772
1779
1782 int32 ViewIndex,
1783 const FSceneView& View,
1784 const FProjectedShadowInfo* ShadowInfo,
1785 bool bUseLightFunctionAtlas)
1786 {
1788
1789 TShadowProjectionPS<Quality, bUseFadePlane>::SetParameters(BatchedParameters, ViewIndex, View, ShadowInfo, bUseLightFunctionAtlas);
1790
1793 int32 MaxKernelSize = CVarMaxSoftShadowKernelSize->GetInt();
1794
1795 FVector4f PCSSParameterValues = FVector4f(0, MaxKernelSize / float(ShadowInfo->ResolutionX), 0, 0);
1797 }
1798
1799protected:
1801};
1802
1803
1804// Sort by descending resolution
1806{
1808 {
1809 return (B.ResolutionX * B.ResolutionY < A.ResolutionX * A.ResolutionY);
1810 }
1811};
1812
1813// Sort by shadow type (CSMs first, then other types).
1814// Then sort CSMs by descending split index, and other shadows by resolution.
1815// Used to render shadow cascades in far to near order, whilst preserving the
1816// descending resolution sort behavior for other shadow types.
1817// Note: the ordering must match the requirements of blend modes set in SetBlendStateForProjection (blend modes that overwrite must come first)
1819{
1821 {
1822 if (A.IsWholeSceneDirectionalShadow())
1823 {
1824 if (B.IsWholeSceneDirectionalShadow())
1825 {
1826 if (A.bRayTracedDistanceField != B.bRayTracedDistanceField)
1827 {
1828 // RTDF shadows need to be rendered after all CSM, because they overlap in depth range with Far Cascades, which will use an overwrite blend mode for the fade plane.
1829 if (!A.bRayTracedDistanceField && B.bRayTracedDistanceField)
1830 {
1831 return true;
1832 }
1833
1834 if (A.bRayTracedDistanceField && !B.bRayTracedDistanceField)
1835 {
1836 return false;
1837 }
1838 }
1839
1840 // Both A and B are CSMs
1841 // Compare Split Indexes, to order them far to near.
1842 return (B.CascadeSettings.ShadowSplitIndex < A.CascadeSettings.ShadowSplitIndex);
1843 }
1844
1845 // A is a CSM, B is per-object shadow etc.
1846 // B should be rendered after A.
1847 return true;
1848 }
1849 else
1850 {
1851 if (B.IsWholeSceneDirectionalShadow())
1852 {
1853 // B should be rendered before A.
1854 return false;
1855 }
1856
1857 // Neither shadow is a CSM
1858 // Sort by descending resolution.
1860 }
1861 }
1862};
1863
OODEFFUNC typedef void(OODLE_CALLBACK t_fp_OodleCore_Plugin_Free)(void *ptr)
#define FORCEINLINE
Definition AndroidPlatform.h:140
#define check(expr)
Definition AssertionMacros.h:314
@ INDEX_NONE
Definition CoreMiscDefines.h:150
#define FORCEINLINE_DEBUGGABLE
Definition CoreMiscDefines.h:74
#define TEXT(x)
Definition Platform.h:1272
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
#define RESTRICT
Definition Platform.h:706
FPlatformTypes::uint64 uint64
A 64-bit unsigned integer.
Definition Platform.h:1117
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
bool IsFeatureLevelSupported(const FStaticShaderPlatform InShaderPlatform, ERHIFeatureLevel::Type InFeatureLevel)
Definition DataDrivenShaderPlatformInfo.h:1047
bool IsMobilePlatform(const FStaticShaderPlatform Platform)
Definition DataDrivenShaderPlatformInfo.h:928
#define ENUM_CLASS_FLAGS(Enum)
Definition EnumClassFlags.h:6
#define X(Name, Desc)
Definition FormatStringSan.h:47
FTexture * GBlackTextureDepthCube
Definition GlobalRenderResources.cpp:564
#define FVector
Definition IOSSystemIncludes.h:8
void SetDeferredLightParameters(FRHIBatchedShaderParameters &BatchedParameters, const TShaderUniformBufferParameter< FDeferredLightUniformStruct > &DeferredLightUniformBufferParameter, const FLightSceneInfo *LightSceneInfo, const FSceneView &View, bool bUseLightFunctionAtlas)
Definition LightRendering.h:42
UE::Math::TVector2< float > FVector2f
Definition MathFwd.h:74
UE::Math::TVector< float > FVector3f
Definition MathFwd.h:73
UE::Math::TVector4< double > FVector4
Definition MathFwd.h:49
UE::Math::TVector2< double > FVector2d
Definition MathFwd.h:61
UE::Math::TVector4< float > FVector4f
Definition MathFwd.h:75
FInt32Point FIntPoint
Definition MathFwd.h:124
UE::Math::TMatrix< float > FMatrix44f
Definition MathFwd.h:77
#define LAYOUT_FIELD(T, Name,...)
Definition MemoryLayout.h:471
#define DECLARE_TYPE_LAYOUT(T, Interface)
Definition MemoryLayout.h:557
EMeshDrawCommandCullingPayloadFlags
Definition MeshPassProcessor.h:1655
CacheMode
Definition MetalPipeline.cpp:839
ERasterizerCullMode
Definition RHIDefinitions.h:369
ERasterizerFillMode
Definition RHIDefinitions.h:358
#define DECLARE_GPU_DRAWCALL_STAT_NAMED_EXTERN(StatName, NameString)
Definition RealtimeGPUProfiler.h:258
RENDERCORE_API bool MobileUsesFullDepthPrepass(const FStaticShaderPlatform Platform)
Definition RenderUtils.cpp:629
bool UseCachedMeshDrawCommands()
Definition SceneRendering.cpp:166
@ LightType_Spot
Definition SceneTypes.h:99
@ LightType_Directional
Definition SceneTypes.h:97
#define SHADER_PARAMETER_RDG_BUFFER_SRV(ShaderType, MemberName)
Definition ShaderParameterMacros.h:1800
#define SHADER_PARAMETER_RDG_TEXTURE(ShaderType, MemberName)
Definition ShaderParameterMacros.h:1752
#define SHADER_PARAMETER_TEXTURE(ShaderType, MemberName)
Definition ShaderParameterMacros.h:1708
#define END_GLOBAL_SHADER_PARAMETER_STRUCT
Definition ShaderParameterMacros.h:1669
#define SHADER_PARAMETER_ARRAY(MemberType, MemberName, ArrayDecl)
Definition ShaderParameterMacros.h:1696
#define SHADER_PARAMETER_SAMPLER(ShaderType, MemberName)
Definition ShaderParameterMacros.h:1740
#define BEGIN_SHADER_PARAMETER_STRUCT(StructTypeName, DllStorage)
Definition ShaderParameterMacros.h:1482
#define SHADER_PARAMETER_RDG_TEXTURE_UAV(ShaderType, MemberName)
Definition ShaderParameterMacros.h:1788
#define BEGIN_GLOBAL_SHADER_PARAMETER_STRUCT
Definition ShaderParameterMacros.h:1663
#define END_SHADER_PARAMETER_STRUCT()
Definition ShaderParameterMacros.h:1485
#define SHADER_PARAMETER_STRUCT(StructType, MemberName)
Definition ShaderParameterMacros.h:1847
#define SHADER_PARAMETER(MemberType, MemberName)
Definition ShaderParameterMacros.h:1684
void SetTextureParameter(FRHIBatchedShaderParameters &BatchedParameters, const FShaderResourceParameter &Parameter, FRHITexture *TextureRHI)
Definition ShaderParameterUtils.h:77
void SetUniformBufferParameter(FRHIBatchedShaderParameters &BatchedParameters, const FShaderUniformBufferParameter &Parameter, FRHIUniformBuffer *UniformBufferRHI)
Definition ShaderParameterUtils.h:207
void SetShaderValue(FRHIBatchedShaderParameters &BatchedParameters, const FShaderParameter &Parameter, const ParameterType &Value, uint32 ElementIndex=0)
Definition ShaderParameterUtils.h:24
void SetSamplerParameter(FRHIBatchedShaderParameters &BatchedParameters, const FShaderResourceParameter &Parameter, FRHISamplerState *SamplerStateRHI)
Definition ShaderParameterUtils.h:94
void SetUniformBufferParameterImmediate(FRHIBatchedShaderParameters &BatchedParameters, const TShaderUniformBufferParameter< TBufferStruct > &Parameter, const TBufferStruct &UniformBufferValue)
Definition ShaderParameterUtils.h:246
#define DECLARE_SHADER_TYPE(ShaderClass, ShaderMetaTypeShortcut,...)
Definition Shader.h:1688
EMeshPass::Type GetShadowMeshPassType(EShadowDepthType ShadowDepthType)
Definition ShadowDepthRendering.cpp:2321
void OverrideWithDefaultMaterialForShadowDepth(const FMaterialRenderProxy *&InOutMaterialRenderProxy, const FMaterial *&InOutMaterialResource, ERHIFeatureLevel::Type InFeatureLevel)
EShadowDepthRenderMode
Definition ShadowRendering.h:74
@ ShadowDepthRenderMode_EmissiveOnly
Definition ShadowRendering.h:79
@ ShadowDepthRenderMode_Normal
Definition ShadowRendering.h:76
@ ShadowDepthRenderMode_GIBlockingVolumes
Definition ShadowRendering.h:82
TGlobalResource< FEmptyTranslucentSelfShadowUniformBuffer > GEmptyTranslucentSelfShadowUniformBuffer
Definition ShadowRendering.cpp:2613
EShadowProjectionVertexShaderFlags
Definition ShadowRendering.h:1016
void DrawStencilingCone(const FMatrix &ConeToWorld, float ConeAngle, float SphereRadius, const FVector &PreViewTranslation)
bool IsShadowCacheModeOcclusionQueryable(EShadowDepthCacheMode CacheMode)
Definition ShadowRendering.h:188
void SetupTranslucentSelfShadowUniformParameters(const FProjectedShadowInfo *ShadowInfo, FTranslucentSelfShadowUniformParameters &OutParameters)
Definition ShadowRendering.cpp:2530
EShadowMeshSelection
Definition ShadowRendering.h:106
EShadowDepthCacheMode
Definition ShadowRendering.h:181
@ SDCM_Uncached
Definition ShadowRendering.h:185
@ SDCM_StaticPrimitivesOnly
Definition ShadowRendering.h:183
@ SDCM_CSMScrolling
Definition ShadowRendering.h:184
@ SDCM_MovablePrimitivesOnly
Definition ShadowRendering.h:182
TFunctionRef< void(FRHICommandList &RHICmdList, bool bFirst)> FBeginShadowRenderPassFunction
Definition ShadowRendering.h:246
EShadowDepthType
Definition ShadowRendering.h:86
void GetOnePassPointShadowProjectionParameters(FRDGBuilder &GraphBuilder, const FProjectedShadowInfo *ShadowInfo, FOnePassPointShadowProjection &OutParameters)
Definition ShadowRendering.cpp:278
USkinnedMeshComponent float
Definition SkinnedMeshComponent.h:60
TGlobalResource< FSystemTextures > GSystemTextures
Definition SystemTextures.cpp:146
uint32 PointerHash(const void *Key)
Definition TypeHash.h:91
uint8_t uint8
Definition binka_ue_file_header.h:8
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition MeshPassProcessor.h:1692
Definition ShadowRendering.h:1386
RENDERER_API void Commit()
Definition GPUScene.cpp:282
Definition GPUScene.h:217
static const bool GetSupportsPercentageCloserShadows(const FStaticShaderPlatform Platform)
Definition DataDrivenShaderPlatformInfo.h:296
FShader::CompiledShaderInitializerType CompiledShaderInitializerType
Definition GlobalShader.h:91
Definition GlobalShader.h:269
static void ModifyCompilationEnvironment(const FGlobalShaderPermutationParameters &Parameters, FShaderCompilerEnvironment &Environment)
Definition GlobalShader.h:289
Definition InstanceCullingManager.h:45
Definition LightSceneInfo.h:36
Definition LightSceneInfo.h:208
FLightSceneProxy * Proxy
Definition LightSceneInfo.h:223
Definition LightSceneProxy.h:43
const FLinearColor & GetModulatedShadowColor() const
Definition LightSceneProxy.h:228
virtual float GetLightSourceAngle() const
Definition LightSceneProxy.h:73
FVector4 GetPosition() const
Definition LightSceneProxy.h:193
FVector GetDirection() const
Definition LightSceneProxy.h:191
uint8 GetLightType() const
Definition LightSceneProxy.h:235
Definition MaterialRenderProxy.h:102
Definition MaterialShared.h:2058
Definition MeshElementCollector.h:26
Definition MeshPassProcessor.h:1670
Definition MeshPassProcessor.h:2199
Definition ShadowRendering.h:1449
void Bind(const FShaderParameterMap &ParameterMap)
Definition ShadowRendering.h:1453
void Set(FRHIBatchedShaderParameters &BatchedParameters, const FSceneView &View, const FProjectedShadowInfo *ShadowInfo) const
Definition ShadowRendering.h:1463
Definition MeshDrawCommands.h:114
Definition SceneManagement.h:1040
Definition PrimitiveDrawInterface.h:19
Definition PrimitiveSceneInfo.h:201
Definition PrimitiveSceneInfo.h:266
Definition PrimitiveSceneProxy.h:296
Definition ShadowRendering.h:279
TArray< FMatrix > OnePassShadowViewMatrices
Definition ShadowRendering.h:445
uint32 bHairStrandsDeepShadow
Definition ShadowRendering.h:424
const FPrimitiveSceneInfo * GetParentSceneInfo() const
Definition ShadowRendering.h:780
TArray< FPlane, TInlineAllocator< 4 > > CSMScrollingExtraCullingPlanes
Definition ShadowRendering.h:461
TArray< FMatrix > OnePassShadowViewProjectionMatrices
Definition ShadowRendering.h:442
float InvMaxSubjectDepth
Definition ShadowRendering.h:328
void ResetRayTracedDistanceFieldShadow(const FViewInfo *View)
Definition ShadowRendering.h:621
EShadowDepthCacheMode CacheMode
Definition ShadowRendering.h:297
uint32 ResolutionY
Definition ShadowRendering.h:361
uint32 bTransmission
Definition ShadowRendering.h:421
uint32 ResolutionX
Definition ShadowRendering.h:360
FMatrix44f InvReceiverInnerMatrix
Definition ShadowRendering.h:326
float MinPreSubjectZ
Definition ShadowRendering.h:343
uint32 bDirectionalLight
Definition ShadowRendering.h:391
bool HasVirtualShadowMap() const
Definition ShadowRendering.h:810
float GetMaxNonFarCascadeDistance() const
Definition ShadowRendering.h:814
void BuildRenderingCommands(FRDGBuilder &GraphBuilder, FGPUScene &GPUScene, FInstanceCullingDrawParams &InstanceCullingDrawParams)
Definition ShadowRendering.h:816
FMatrix ViewToClipInner
Definition ShadowRendering.h:314
uint32 bRendered
Definition ShadowRendering.h:382
uint32 bPreShadow
Definition ShadowRendering.h:412
FMatrix OnePassShadowFaceProjectionMatrix
Definition ShadowRendering.h:448
float InvPerObjectShadowFadeLength
Definition ShadowRendering.h:452
uint32 bVSM
Definition ShadowRendering.h:397
TArray< const FPrimitiveSceneInfo *, SceneRenderingAllocator > PrimitiveArrayType
Definition ShadowRendering.h:281
uint32 bWholeSceneShadow
Definition ShadowRendering.h:400
FMatrix GetScreenToShadowMatrix(const FSceneView &View) const
Definition ShadowRendering.h:733
uint32 bAllocatedInPreshadowCache
Definition ShadowRendering.h:385
float ComputeTransitionSize() const
Definition ShadowRendering.cpp:1957
float GetShaderSlopeDepthBias() const
Definition ShadowRendering.h:527
EGatherDynamicMeshElementsPass
Definition ShadowRendering.h:699
TSharedPtr< FVirtualShadowMapClipmap > VirtualShadowMapClipmap
Definition ShadowRendering.h:439
TArray< float, TInlineAllocator< 2 > > FadeAlphas
Definition ShadowRendering.h:376
uint32 bShouldRenderVSM
Definition ShadowRendering.h:431
TSharedPtr< FVirtualShadowMapPerLightCacheEntry > VirtualShadowMapPerLightCacheEntry
Definition ShadowRendering.h:438
float GetShaderReceiverDepthBias() const
Definition ShadowRendering.cpp:2011
FViewInfo * DependentView
Definition ShadowRendering.h:300
friend uint32 GetTypeHash(const FProjectedShadowInfo *ProjectedShadowInfo)
Definition ShadowRendering.h:727
FConvexVolume CasterOuterFrustum
Definition ShadowRendering.h:338
EMeshPass::Type GetTargetMeshPassType() const
Definition ShadowRendering.h:805
uint32 bOnePassPointLightShadow
Definition ShadowRendering.h:394
float CSMScrollingZOffset
Definition ShadowRendering.h:455
float MaxScreenPercent
Definition ShadowRendering.h:373
bool ShouldClampToNearPlane() const
Definition ShadowRendering.h:768
FMatrix ViewToClipOuter
Definition ShadowRendering.h:317
uint32 bAllocated
Definition ShadowRendering.h:379
FShadowMapRenderTargets RenderTargets
Definition ShadowRendering.h:295
FVector4f OverlappedUVOnCurrentShadowMap
Definition ShadowRendering.h:458
FVector PreShadowTranslation
Definition ShadowRendering.h:306
FSphere ShadowBounds
Definition ShadowRendering.h:345
uint32 bVolumetricShadow
Definition ShadowRendering.h:434
void SetStateForDepth(FMeshPassProcessorRenderState &DrawRenderState) const
FMatrix44f TranslatedWorldToClipOuterMatrix
Definition ShadowRendering.h:324
const TArray< FMeshBatchAndRelevance, SceneRenderingAllocator > & GetDynamicSubjectHeterogeneousVolumeMeshElements() const
Definition ShadowRendering.h:828
int32 ShadowId
Definition ShadowRendering.h:303
FConvexVolume ReceiverInnerFrustum
Definition ShadowRendering.h:341
uint32 bRayTracedDistanceField
Definition ShadowRendering.h:406
FVector4f OverlappedUVOnCachedShadowMap
Definition ShadowRendering.h:457
FIntRect GetOuterViewRect() const
Definition ShadowRendering.h:545
uint32 bPerObjectOpaqueShadow
Definition ShadowRendering.h:418
FIntPoint GetShadowBufferResolution() const
Definition ShadowRendering.h:750
TArray< int32, TInlineAllocator< 6 > > ViewIds
Definition ShadowRendering.h:473
float GetShaderMaxSlopeDepthBias() const
Definition ShadowRendering.h:528
FLightSceneInfo & GetLightSceneInfo() const
Definition ShadowRendering.h:774
uint32 X
Definition ShadowRendering.h:353
uint32 bTranslucentShadow
Definition ShadowRendering.h:403
FParallelMeshDrawCommandPass & GetShadowDepthPass()
Definition ShadowRendering.h:812
FIntRect ScissorRectOptim
Definition ShadowRendering.h:367
float PerObjectShadowFadeStart
Definition ShadowRendering.h:451
FMatrix TranslatedWorldToView
Definition ShadowRendering.h:311
uint32 bDepthsCached
Definition ShadowRendering.h:388
FIntRect GetInnerViewRect() const
Definition ShadowRendering.h:534
uint32 bNaniteGeometry
Definition ShadowRendering.h:427
uint32 Y
Definition ShadowRendering.h:354
uint32 bSelfShadowOnly
Definition ShadowRendering.h:415
EShadowDepthType GetShadowDepthType() const
Definition ShadowRendering.h:785
FViewInfo * ShadowDepthView
Definition ShadowRendering.h:292
float MaxSubjectZ
Definition ShadowRendering.h:334
uint32 BorderSize
Definition ShadowRendering.h:364
const FLightSceneInfoCompact & GetLightSceneInfoCompact() const
Definition ShadowRendering.h:775
FShadowCascadeSettings CascadeSettings
Definition ShadowRendering.h:347
uint32 bContainsNaniteSubjects
Definition ShadowRendering.h:430
float GetShaderDepthBias() const
Definition ShadowRendering.h:526
FMatrix44f TranslatedWorldToClipInnerMatrix
Definition ShadowRendering.h:323
uint32 bCapsuleShadow
Definition ShadowRendering.h:409
float MinSubjectZ
Definition ShadowRendering.h:335
Definition RenderGraphResources.h:1426
Definition RenderGraphResources.h:1321
Definition RenderGraphBuilder.h:49
Definition RenderGraphResources.h:571
Definition RHIResources.h:696
Definition RHICommandList.h:455
Definition RHICommandList.h:3819
Definition RHIResources.h:671
Definition RHIResources.h:2153
Definition RHIResources.h:1232
Definition RefCounting.h:252
virtual FScene * GetRenderScene()=0
Definition SceneRendering.h:2080
Definition SceneView.h:2212
FSceneInterface * Scene
Definition SceneView.h:2321
Definition SceneView.h:1425
const FSceneViewFamily * Family
Definition SceneView.h:1427
FViewMatrices ViewMatrices
Definition SceneView.h:1464
Definition ScenePrivate.h:2875
Definition ShaderCore.h:323
TMap< FString, FParameterAllocation > ParameterMap
Definition ShaderCore.h:367
Definition ShaderParameters.h:56
Definition ShaderParameters.h:87
Definition ShaderParameters.h:109
Definition SceneManagement.h:946
float FadePlaneLength
Definition SceneManagement.h:969
float FadePlaneOffset
Definition SceneManagement.h:966
float SplitNear
Definition SceneManagement.h:952
float SplitFar
Definition SceneManagement.h:955
Definition ShadowDepthRendering.cpp:429
Definition ShadowRendering.h:116
FMeshPassProcessorRenderState PassDrawRenderState
Definition ShadowRendering.h:129
Definition ShadowDepthRendering.cpp:260
Definition SceneRendering.h:1841
Definition ShadowRendering.h:210
FShadowMapRenderTargets()
Definition ShadowRendering.h:215
FIntPoint GetSize() const
Definition ShadowRendering.h:219
TArray< IPooledRenderTarget *, SceneRenderingAllocator > ColorTargets
Definition ShadowRendering.h:212
void CopyReferencesFromRenderTargets(const FShadowMapRenderTargetsRefCounted &SourceTargets)
Definition ShadowRendering.h:232
IPooledRenderTarget * DepthTarget
Definition ShadowRendering.h:213
Definition ShadowRendering.h:1050
void SetParameters(FRHIBatchedShaderParameters &BatchedParameters, const FSceneView &View, const FProjectedShadowInfo *ShadowInfo, EShadowProjectionVertexShaderFlags Flags)
Definition ShadowRendering.h:1059
FShadowProjectionNoTransformVS(const ShaderMetaType::CompiledShaderInitializerType &Initializer)
Definition ShadowRendering.h:1054
FShadowProjectionNoTransformVS()
Definition ShadowRendering.h:1053
Definition ShadowRendering.h:1067
FShadowProjectionPixelShaderInterface(const ShaderMetaType::CompiledShaderInitializerType &Initializer)
Definition ShadowRendering.h:1079
FShadowProjectionPixelShaderInterface()
Definition ShadowRendering.h:1071
Definition ShadowRendering.h:1086
void Set(FRHIBatchedShaderParameters &BatchedParameters, const FSceneView &View, const FProjectedShadowInfo *ShadowInfo, bool bModulatedShadows, bool bUseFadePlane, bool SubPixelShadow)
Definition ShadowRendering.h:1108
void Bind(const FShader::CompiledShaderInitializerType &Initializer)
Definition ShadowRendering.h:1089
Definition ShadowRendering.h:1026
FShadowVolumeBoundProjectionVS()
Definition ShadowRendering.h:1030
FShadowVolumeBoundProjectionVS(const ShaderMetaType::CompiledShaderInitializerType &Initializer)
Definition ShadowRendering.h:1031
Definition StaticMeshBatch.h:40
Definition StaticMeshBatch.h:16
Definition LightRendering.h:257
FTextureRHIRef TextureRHI
Definition RenderResource.h:358
Definition SceneRendering.h:1132
FGPUScenePrimitiveCollector DynamicPrimitiveCollector
Definition SceneRendering.h:1813
Definition VirtualShadowMapCacheManager.h:259
Definition VirtualShadowMapArray.h:291
Definition VirtualShadowMapCacheManager.h:93
static constexpr uint32 VirtualMaxResolutionXY
Definition VirtualShadowMapArray.h:78
Definition SceneRendering.h:211
Definition SceneManagement.h:1047
Definition IConsoleManager.h:558
Definition Renderer.Build.cs:6
Definition ArrayView.h:139
Definition Array.h:670
UE_FORCEINLINE_HINT SizeType AddUninitialized()
Definition Array.h:1664
SizeType AddZeroed()
Definition Array.h:2755
Definition ConcurrentLinearAllocator.h:571
Definition ShadowRendering.h:1702
LAYOUT_FIELD(FShaderParameter, PCSSParameters)
TDirectionalPercentageCloserShadowProjectionPS()
Definition ShadowRendering.h:1706
TDirectionalPercentageCloserShadowProjectionPS(const ShaderMetaType::CompiledShaderInitializerType &Initializer)
Definition ShadowRendering.h:1707
static bool ShouldCompilePermutation(const FGlobalShaderPermutationParameters &Parameters)
Definition ShadowRendering.h:1719
void SetParameters(FRHIBatchedShaderParameters &BatchedParameters, int32 ViewIndex, const FSceneView &View, const FProjectedShadowInfo *ShadowInfo, bool bUseLightFunctionAtlas)
Definition ShadowRendering.h:1725
static void ModifyCompilationEnvironment(const FGlobalShaderPermutationParameters &Parameters, FShaderCompilerEnvironment &OutEnvironment)
Definition ShadowRendering.h:1713
Definition AssetRegistryState.h:50
Definition RenderResource.h:543
Definition UnrealString.h.inl:34
Definition ShadowRendering.h:1331
LAYOUT_FIELD(FShaderUniformBufferParameter, MobileBasePassUniformBuffer)
LAYOUT_FIELD(FShaderParameter, ModulatedShadowColorParameter)
static bool ShouldCompilePermutation(const FGlobalShaderPermutationParameters &Parameters)
Definition ShadowRendering.h:1343
void SetParameters(FRHIBatchedShaderParameters &BatchedParameters, int32 ViewIndex, const FSceneView &View, const FProjectedShadowInfo *ShadowInfo, bool bUseLightFunctionAtlas)
Definition ShadowRendering.h:1352
TModulatedShadowProjection()
Definition ShadowRendering.h:1348
static void ModifyCompilationEnvironment(const FGlobalShaderPermutationParameters &Parameters, FShaderCompilerEnvironment &OutEnvironment)
Definition ShadowRendering.h:1335
Definition ShadowRendering.h:1559
TOnePassPointShadowProjectionPS(const ShaderMetaType::CompiledShaderInitializerType &Initializer)
Definition ShadowRendering.h:1565
static void ModifyCompilationEnvironment(const FGlobalShaderPermutationParameters &Parameters, FShaderCompilerEnvironment &OutEnvironment)
Definition ShadowRendering.h:1579
void SetParameters(FRHIBatchedShaderParameters &BatchedParameters, int32 ViewIndex, const FViewInfo &View, const FProjectedShadowInfo *ShadowInfo, FRHIUniformBuffer *HairStrandsUniformBuffer)
Definition ShadowRendering.h:1604
TOnePassPointShadowProjectionPS()
Definition ShadowRendering.h:1563
static bool ShouldCompilePermutation(const FGlobalShaderPermutationParameters &Parameters)
Definition ShadowRendering.h:1594
Definition RenderGraphResources.h:251
Definition ShadowRendering.h:1398
void SetParameters(FRHIBatchedShaderParameters &BatchedParameters, int32 ViewIndex, const FSceneView &View, const FProjectedShadowInfo *ShadowInfo, bool bUseLightFunctionAtlas)
Definition ShadowRendering.h:1420
TShadowProjectionFromTranslucencyPS(const ShaderMetaType::CompiledShaderInitializerType &Initializer)
Definition ShadowRendering.h:1415
static void ModifyCompilationEnvironment(const FGlobalShaderPermutationParameters &Parameters, FShaderCompilerEnvironment &OutEnvironment)
Definition ShadowRendering.h:1402
static bool ShouldCompilePermutation(const FGlobalShaderPermutationParameters &Parameters)
Definition ShadowRendering.h:1408
TShadowProjectionFromTranslucencyPS()
Definition ShadowRendering.h:1413
Definition ShadowRendering.h:1238
static bool ShouldCompilePermutation(const FGlobalShaderPermutationParameters &Parameters)
Definition ShadowRendering.h:1261
void SetParameters(FRHIBatchedShaderParameters &BatchedParameters, int32 ViewIndex, const FSceneView &View, const FProjectedShadowInfo *ShadowInfo, bool bUseLightFunctionAtlas)
Definition ShadowRendering.h:1288
static void ModifyCompilationEnvironment(const FGlobalShaderPermutationParameters &Parameters, FShaderCompilerEnvironment &OutEnvironment)
Definition ShadowRendering.h:1271
LAYOUT_FIELD(FShaderParameter, ShadowSharpen)
TShadowProjectionPS()
Definition ShadowRendering.h:1242
LAYOUT_FIELD(FShaderParameter, LightPosition)
LAYOUT_FIELD(FShaderParameter, ShadowFadeFraction)
TShadowProjectionPS(const ShaderMetaType::CompiledShaderInitializerType &Initializer)
Definition ShadowRendering.h:1251
LAYOUT_FIELD(FShadowProjectionShaderParameters, ProjectionParameters)
Definition SharedPointer.h:692
UE_FORCEINLINE_HINT const bool IsValid() const
Definition SharedPointer.h:1085
Definition ContainerAllocationPolicies.h:894
Definition ShadowRendering.h:1756
TSpotPercentageCloserShadowProjectionPS()
Definition ShadowRendering.h:1760
LAYOUT_FIELD(FShaderParameter, PCSSParameters)
static bool ShouldCompilePermutation(const FGlobalShaderPermutationParameters &Parameters)
Definition ShadowRendering.h:1767
static void ModifyCompilationEnvironment(const FGlobalShaderPermutationParameters &Parameters, FShaderCompilerEnvironment &OutEnvironment)
Definition ShadowRendering.h:1773
void SetParameters(FRHIBatchedShaderParameters &BatchedParameters, int32 ViewIndex, const FSceneView &View, const FProjectedShadowInfo *ShadowInfo, bool bUseLightFunctionAtlas)
Definition ShadowRendering.h:1780
TSpotPercentageCloserShadowProjectionPS(const ShaderMetaType::CompiledShaderInitializerType &Initializer)
Definition ShadowRendering.h:1761
Definition RHIStaticStates.h:127
static RHIParamRefType GetRHI()
Definition RHIStaticStates.h:57
Definition UniformBuffer.h:29
Type
Definition MeshPassProcessor.h:38
Type
Definition RHIFeatureLevel.h:20
@ SM5
Definition RHIFeatureLevel.h:42
bool IsEnabled(const FViewInfo &InView, ELightFunctionAtlasSystem In)
Definition LightFunctionAtlas.cpp:975
Definition ShadowRendering.h:50
constexpr uint32 ShadowStencilMask
Definition ShadowRendering.h:52
Definition ShadowSetup.cpp:1679
Definition ShadowSetup.cpp:1504
Definition ShadowSetup.cpp:1516
Definition ShadowSetup.cpp:1685
Definition ShadowRendering.h:1806
FORCEINLINE bool operator()(const FProjectedShadowInfo &A, const FProjectedShadowInfo &B) const
Definition ShadowRendering.h:1807
Definition ShadowRendering.h:1819
FORCEINLINE bool operator()(const FProjectedShadowInfo &A, const FProjectedShadowInfo &B) const
Definition ShadowRendering.h:1820
Definition ConvexVolume.h:44
Definition ShadowSetup.cpp:1366
Definition ShadowSetup.cpp:1510
Definition GlobalShader.h:73
Definition SceneManagement.h:1831
static constexpr UE_FORCEINLINE_HINT auto DegreesToRadians(T const &DegVal) -> decltype(DegVal *(UE_PI/180.f))
Definition UnrealMathUtility.h:871
Definition MeshBatch.h:371
Definition MeshPassProcessor.h:1573
Definition MeshPassProcessor.h:2118
Definition SceneTextures.h:52
Definition PSOPrecache.h:30
Definition PSOPrecache.h:150
FIntPoint Extent
Definition RendererInterface.h:420
Definition RHIShaderParameters.h:241
Definition ShaderParameterMacros.h:770
Definition SceneTexturesConfig.h:114
Definition ScreenPass.h:41
Definition Shader.h:1610
Definition ShaderCore.h:544
const EShaderPlatform Platform
Definition ShaderPermutation.h:29
Definition ShadowRendering.h:1669
FShadowProjectionMatrix(const FVector2D &Min, const FVector2D &Max, const FVector4 &WAxis)
Definition ShadowRendering.h:1680
FShadowProjectionMatrix(const FMatrix &InMatrix, float MinZ, float MaxZ)
Definition ShadowRendering.h:1690
FShadowProjectionMatrix(FVector::FReal MinZ, FVector::FReal MaxZ, const FVector4 &WAxis)
Definition ShadowRendering.h:1670
Definition AndroidStaticShaderPlatform.inl:18
Definition ShadowRendering.h:197
ETileType TileType
Definition ShadowRendering.h:206
FRDGBufferRef DrawIndirectParametersBuffer
Definition ShadowRendering.h:203
FRDGBufferSRVRef TileListDataBufferSRV
Definition ShadowRendering.h:204
ETileType
Definition ShadowRendering.h:199
uint32 TileSize
Definition ShadowRendering.h:205
Definition SceneView.h:317
const FMatrix & GetProjectionMatrix() const
Definition SceneView.h:433
const FVector & GetPreViewTranslation() const
Definition SceneView.h:518
virtual IConsoleVariable * FindConsoleVariable(const TCHAR *Name, bool bTrackFrequentCalls=true) const =0
static IConsoleManager & Get()
Definition IConsoleManager.h:1270
Definition RendererInterface.h:494
FRHITexture * GetRHI() const
Definition RendererInterface.h:520
virtual const FPooledRenderTargetDesc & GetDesc() const =0
Definition NaniteShared.h:35
Definition BoxSphereBounds.h:25
Definition IntPoint.h:25
IntType Y
Definition IntPoint.h:37
IntType X
Definition IntPoint.h:34
T M[4][4]
Definition Matrix.h:49
TVector4< T > TransformFVector4(const TVector4< T > &V) const
Definition Matrix.inl:170
T W
Definition Sphere.h:37
T X
Definition Vector2D.h:49
static CORE_API const TVector< double > ZeroVector
Definition Vector.h:79
double FReal
Definition Vector.h:55
void Set(T InX, T InY, T InZ)
Definition Vector.h:1665