UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
DistortionRendering.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3/*=============================================================================
4 DistortionRendering.h: Distortion rendering implementation.
5=============================================================================*/
6
7#pragma once
8
9#include "CoreMinimal.h"
10#include "RendererInterface.h"
11#include "MeshPassProcessor.h"
12
15
20{
21public:
22
29 bool DrawAccumulatedOffsets(FRHICommandListImmediate& RHICmdList, const class FViewInfo& View, const FMeshPassProcessorRenderState& DrawRenderState, bool bInitializeOffsets);
30
35 void Append(FPrimitiveSceneProxy** PrimitiveSceneProxies, int32 NumProxies)
36 {
37 Prims.Append(PrimitiveSceneProxies, NumProxies);
38 }
39
44 {
45 return Prims.Num();
46 }
47
52 {
53 check(i>=0 && i<NumPrims());
54 return Prims[i];
55 }
56
57private:
60};
61
63
64class FDistortionMeshProcessor : public FSceneRenderingAllocatorObject<FDistortionMeshProcessor>, public FMeshPassProcessor
65{
66public:
67
69 const FScene* Scene,
75
76 virtual void AddMeshBatch(const FMeshBatch& RESTRICT MeshBatch, uint64 BatchElementMask, const FPrimitiveSceneProxy* RESTRICT PrimitiveSceneProxy, int32 StaticMeshId = -1) override final;
77 virtual void CollectPSOInitializers(const FSceneTexturesConfig& SceneTexturesConfig, const FMaterial& Material, const FPSOPrecacheVertexFactoryData& VertexFactoryData, const FPSOPrecacheParams& PreCacheParams, TArray<FPSOPrecacheData>& PSOInitializers) override final;
78
81
82private:
83 bool TryAddMeshBatch(
86 const FPrimitiveSceneProxy* RESTRICT PrimitiveSceneProxy,
88 const FMaterialRenderProxy& MaterialRenderProxy,
89 const FMaterial& Material);
90
91 bool Process(
92 const FMeshBatch& MeshBatch,
94 const FPrimitiveSceneProxy* RESTRICT PrimitiveSceneProxy,
96 const FMaterialRenderProxy& RESTRICT MaterialRenderProxy,
97 const FMaterial& RESTRICT MaterialResource,
98 ERasterizerFillMode MeshFillMode,
99 ERasterizerCullMode MeshCullMode);
100};
#define check(expr)
Definition AssertionMacros.h:314
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
void SetupDistortionParams(FVector4f &DistortionParams, const FViewInfo &View)
Definition DistortionRendering.cpp:113
ERasterizerCullMode
Definition RHIDefinitions.h:369
ERasterizerFillMode
Definition RHIDefinitions.h:358
Definition DistortionRendering.h:65
virtual void AddMeshBatch(const FMeshBatch &RESTRICT MeshBatch, uint64 BatchElementMask, const FPrimitiveSceneProxy *RESTRICT PrimitiveSceneProxy, int32 StaticMeshId=-1) override final
Definition DistortionRendering.cpp:993
FMeshPassProcessorRenderState PassDrawRenderStateNoDepthTest
Definition DistortionRendering.h:80
virtual void CollectPSOInitializers(const FSceneTexturesConfig &SceneTexturesConfig, const FMaterial &Material, const FPSOPrecacheVertexFactoryData &VertexFactoryData, const FPSOPrecacheParams &PreCacheParams, TArray< FPSOPrecacheData > &PSOInitializers) override final
Definition DistortionRendering.cpp:1021
FMeshPassProcessorRenderState PassDrawRenderState
Definition DistortionRendering.h:79
Definition DistortionRendering.h:20
void Append(FPrimitiveSceneProxy **PrimitiveSceneProxies, int32 NumProxies)
Definition DistortionRendering.h:35
bool DrawAccumulatedOffsets(FRHICommandListImmediate &RHICmdList, const class FViewInfo &View, const FMeshPassProcessorRenderState &DrawRenderState, bool bInitializeOffsets)
const FPrimitiveSceneProxy * GetPrim(int32 i) const
Definition DistortionRendering.h:51
int32 NumPrims() const
Definition DistortionRendering.h:43
Definition MaterialRenderProxy.h:102
Definition MaterialShared.h:2058
Definition MeshPassProcessor.h:1670
Definition MeshPassProcessor.h:2199
const FScene *RESTRICT Scene
Definition MeshPassProcessor.h:2203
ERHIFeatureLevel::Type FeatureLevel
Definition MeshPassProcessor.h:2204
Definition PrimitiveSceneProxy.h:296
Definition RHICommandList.h:4626
Definition SceneView.h:1425
Definition ScenePrivate.h:2875
Definition SceneRendering.h:1132
Definition Array.h:670
Definition ConcurrentLinearAllocator.h:571
Type
Definition RHIFeatureLevel.h:20
Definition MeshBatch.h:371
Definition MeshPassProcessor.h:2118
Definition PSOPrecache.h:30
Definition PSOPrecache.h:150
Definition SceneTexturesConfig.h:114