UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
DecalRenderingShared.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "RendererInterface.h"
8
10class FMaterial;
12class FScene;
13class FViewInfo;
15
16class FShader;
18template<typename ShaderType, typename PointerTableType> class TShaderRefBase;
20
42
45
47{
48public:
50
52 {
53 check(bFinishCalled);
54 check(AllTasksEvent.IsCompleted());
55 }
56
59
60 void Finish()
61 {
62 bFinishCalled = true;
63 AllTasksEvent.Trigger();
64 AllTasksEvent.Wait();
65 }
66
67 bool HasStage(EDecalRenderStage Stage) const
68 {
69 return RelevantDecalsMap.Contains(Stage);
70 }
71
72private:
73 const FDecalVisibilityTaskData& TaskData;
74 const FViewInfo& View;
75
76 struct FVisibleDecals
77 {
80
81 } VisibleDecals;
82
83 struct FRelevantDecals
84 {
87 };
88
91 bool bFinishCalled = false;
92};
93
95{
96public:
98
100 {
101 return ViewPackets[ViewIndex].FinishVisibleDecals();
102 }
103
105 {
106 return ViewPackets[ViewIndex].FinishRelevantDecals(Stage);
107 }
108
109 bool HasStage(int32 ViewIndex, EDecalRenderStage Stage) const
110 {
111 return ViewPackets[ViewIndex].HasStage(Stage);
112 }
113
114 void Finish()
115 {
116 for (FDecalVisibilityViewPacket& ViewPacket : ViewPackets)
117 {
118 ViewPacket.Finish();
119 }
120 }
121
122 bool IsDBufferEnabled() const
123 {
124 return bDBufferEnabled;
125 }
126
127 bool IsGBufferEnabled() const
128 {
129 return bGBufferEnabled;
130 }
131
132private:
134
135 const bool bDBufferEnabled;
136 const bool bGBufferEnabled;
137
139
142};
143
147namespace DecalRendering
148{
153 void SortDecalList(FRelevantDecalList& Decals);
160};
#define check(expr)
Definition AssertionMacros.h:314
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
EDecalRenderStage
Definition DecalRenderingCommon.h:36
#define UE_SOURCE_LOCATION
Definition PreprocessorHelpers.h:71
EShaderPlatform
Definition RHIShaderPlatform.h:11
#define RDG_FRIEND_ALLOCATOR_FRIEND(Type)
Definition RenderGraphAllocator.h:155
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition DecalRenderingShared.h:95
bool HasStage(int32 ViewIndex, EDecalRenderStage Stage) const
Definition DecalRenderingShared.h:109
void Finish()
Definition DecalRenderingShared.h:114
TConstArrayView< const FVisibleDecal * > FinishRelevantDecals(int32 ViewIndex, EDecalRenderStage Stage)
Definition DecalRenderingShared.h:104
bool IsGBufferEnabled() const
Definition DecalRenderingShared.h:127
TConstArrayView< FVisibleDecal > FinishVisibleDecals(int32 ViewIndex)
Definition DecalRenderingShared.h:99
bool IsDBufferEnabled() const
Definition DecalRenderingShared.h:122
Definition DecalRenderingShared.h:47
TConstArrayView< const FVisibleDecal * > FinishRelevantDecals(EDecalRenderStage Stage)
Definition DecalRenderingShared.cpp:126
TConstArrayView< FVisibleDecal > FinishVisibleDecals()
Definition DecalRenderingShared.cpp:115
bool HasStage(EDecalRenderStage Stage) const
Definition DecalRenderingShared.h:67
~FDecalVisibilityViewPacket()
Definition DecalRenderingShared.h:51
void Finish()
Definition DecalRenderingShared.h:60
Definition DeferredDecalProxy.h:16
Definition RHIResources.h:4572
Definition MaterialRenderProxy.h:102
Definition MaterialShared.h:2058
Definition RenderGraphBuilder.h:49
Definition RHICommandList.h:3819
Definition ScenePrivate.h:2875
Definition Shader.h:637
Definition Shader.h:829
Definition SceneRendering.h:1132
Definition Launch.Build.cs:10
Definition UnrealString.h.inl:34
Definition Shader.h:1021
Definition Task.h:236
void Trigger()
Definition Task.h:250
bool IsCompleted() const
Definition Task.h:68
bool Wait(FTimespan Timeout) const
Definition Task.h:76
Definition DecalRenderingCommon.cpp:14
void SortDecalList(FRelevantDecalList &Decals)
Definition DecalRenderingShared.cpp:419
float GetDecalFadeScreenSizeMultiplier()
Definition DecalRenderingShared.cpp:395
float CalculateDecalFadeAlpha(float DecalFadeScreenSize, const FMatrix &ComponentToWorldMatrix, const FViewInfo &View, float FadeMultiplier)
Definition DecalRenderingShared.cpp:400
void SetShader(FRHICommandList &RHICmdList, FGraphicsPipelineStateInitializer &GraphicsPSOInit, uint32 StencilRef, const FViewInfo &View, const FVisibleDecal &VisibleDecal, EDecalRenderStage DecalRenderStage, const FMatrix &FrustumComponentToClip, const FScene *Scene)
Definition DecalRenderingShared.cpp:670
FRelevantDecalList BuildRelevantDecalList(TConstArrayView< FVisibleDecal > Decals, EDecalRenderStage DecalRenderStage)
Definition DecalRenderingShared.cpp:520
bool HasRelevantDecals(TConstArrayView< FVisibleDecal > Decals, EDecalRenderStage DecalRenderStage)
Definition DecalRenderingShared.cpp:539
bool SetupShaderState(ERHIFeatureLevel::Type FeatureLevel, const FMaterial &Material, EDecalRenderStage DecalRenderStage, FBoundShaderStateInput &OutBoundShaderState)
Definition DecalRenderingShared.cpp:624
bool GetShaders(ERHIFeatureLevel::Type FeatureLevel, const FMaterial &Material, EDecalRenderStage DecalRenderStage, TShaderRef< FShader > &OutVertexShader, TShaderRef< FShader > &OutPixelShader)
Definition DecalRenderingShared.cpp:605
void SetVertexShaderOnly(FRHICommandList &RHICmdList, FGraphicsPipelineStateInitializer &GraphicsPSOInit, const FViewInfo &View, const FMatrix &FrustumComponentToClip)
Definition DecalRenderingShared.cpp:703
FVisibleDecalList BuildVisibleDecalList(TConstArrayView< FDeferredDecalProxy * > Decals, const FViewInfo &View)
Definition DecalRenderingShared.cpp:451
FMatrix ComputeComponentToClipMatrix(const FViewInfo &View, const FMatrix &DecalComponentToWorld)
Definition DecalRenderingShared.cpp:554
Type
Definition RHIFeatureLevel.h:20
@ List
Definition ITypedTableView.h:38
@ Task
Definition VulkanCommon.h:40
Definition RHIResources.h:4362
Definition Color.h:48
Definition DecalRenderingShared.h:25
uint32 SortOrder
Definition DecalRenderingShared.h:30
float InvFadeInDuration
Definition DecalRenderingShared.h:35
float FadeStartDelayNormalized
Definition DecalRenderingShared.h:36
float ConservativeRadius
Definition DecalRenderingShared.h:32
FLinearColor DecalColor
Definition DecalRenderingShared.h:38
float FadeInStartDelayNormalized
Definition DecalRenderingShared.h:37
FTransform ComponentTrans
Definition DecalRenderingShared.h:39
uintptr_t Component
Definition DecalRenderingShared.h:29
float FadeAlpha
Definition DecalRenderingShared.h:33
const FMaterialRenderProxy * MaterialProxy
Definition DecalRenderingShared.h:28
FBox BoxBounds
Definition DecalRenderingShared.h:40
FDecalBlendDesc BlendDesc
Definition DecalRenderingShared.h:31
float InvFadeDuration
Definition DecalRenderingShared.h:34
Definition DecalRenderingCommon.h:18