UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
OIT.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#include "RenderResource.h"
9
10class FViewInfo;
14class FViewInfo;
15
22
24{
27};
28
29// Sorted triangles data
48
49// Order Independent Translucency pass data for a given translucent pass
62
63// Order Independent Translucency scene data
78
79namespace OIT
80{
81 /* Return true if OIT sorted triangles is enabled/supported */
83
84 /* Return true if the current MeshBatch is compatible with per-instance sorted triangle */
86
87 /* Return if OIT sorted pixel is enabled for the project*/
89
90 /* Return if OIT is enabled for the current runtime */
93
94 /* Return if OIT is enabled for the translucent pass current pass */
96
97 /* Sort triangles of all instances whose has the sorted triangle option enabled */
98 void AddSortTrianglesPass(FRDGBuilder& GraphBuilder, const FViewInfo& View, FOITSceneData& OITSceneData, FTriangleSortingOrder SortType);
99
100 /* Create OIT data for translucent pass */
101 FOITData CreateOITData(FRDGBuilder& GraphBuilder, const FViewInfo& View, EOITPassType PassType);
102
103 /* Compose all OIT samples into the target color buffer */
104 void AddOITComposePass(FRDGBuilder& GraphBuilder, const FViewInfo& View, FOITData& OITData, FRDGTextureRef SceneColorTexture);
106
107 /* Call on SceneRenderer OnRenderBegin */
108 void OnRenderBegin(FOITSceneData& OITSceneData);
109}
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
FTriangleSortingOrder
Definition OIT.h:24
EOITPassType
Definition OIT.h:17
@ OITPass_None
Definition OIT.h:18
@ OITPass_RegularTranslucency
Definition OIT.h:19
@ OITPass_SeperateTranslucency
Definition OIT.h:20
EPrimitiveType
Definition RHIDefinitions.h:822
@ PT_TriangleList
Definition RHIDefinitions.h:824
EShaderPlatform
Definition RHIShaderPlatform.h:11
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition RenderResource.h:509
Definition RenderGraphBuilder.h:49
Definition RenderGraphResources.h:571
Definition RHICommandList.h:455
Definition OIT.cpp:268
Definition SceneRendering.h:1132
Definition Array.h:670
Definition Queue.h:48
Type
Definition RHIFeatureLevel.h:20
Definition BasePassRendering.h:52
void OnRenderBegin(FOITSceneData &OITSceneData)
Definition OIT.cpp:1034
bool IsSortedTrianglesEnabled(EShaderPlatform InPlatform)
Definition OIT.cpp:868
FOITData CreateOITData(FRDGBuilder &GraphBuilder, const FViewInfo &View, EOITPassType PassType)
Definition OIT.cpp:959
bool IsSortedPixelsEnabledForPass(EOITPassType PassType)
Definition OIT.cpp:887
void AddOITComposePass(FRDGBuilder &GraphBuilder, const FViewInfo &View, FOITData &OITData, FRDGTextureRef SceneColorTexture)
Definition OIT.cpp:1024
void AddSortTrianglesPass(FRDGBuilder &GraphBuilder, const FViewInfo &View, FOITSceneData &OITSceneData, FTriangleSortingOrder SortType)
Definition OIT.cpp:898
bool IsSortedPixelsEnabled(const FViewInfo &InView)
Definition OIT.cpp:884
bool IsCompatible(const FMeshBatch &InMesh, ERHIFeatureLevel::Type InFeatureLevel)
Definition OIT.cpp:893
bool IsSortedPixelsEnabledForProject(EShaderPlatform InPlatform)
Definition OIT.cpp:873
Definition MeshBatch.h:99
Definition MeshBatch.h:232
Definition MeshBatch.h:371
Definition OIT.h:51
uint32 Method
Definition OIT.h:54
float TransmittanceThreshold
Definition OIT.h:57
uint32 SupportedPass
Definition OIT.h:53
uint32 MaxSideSamplePerPixel
Definition OIT.h:56
FRDGTextureRef SampleDataTexture
Definition OIT.h:59
FRDGTextureRef SampleCountTexture
Definition OIT.h:60
EOITPassType PassType
Definition OIT.h:52
uint32 MaxSamplePerPixel
Definition OIT.h:55
Definition OIT.h:65
TQueue< uint32 > FreeSlots
Definition OIT.h:75
TQueue< FSortedIndexBuffer * > PendingDeletes
Definition OIT.h:74
void Allocate(FRHICommandListBase &RHICmdList, EPrimitiveType PrimitiveType, const FMeshBatchElement &InMeshElement, FMeshBatchElementDynamicIndexBuffer &OutMeshElement)
Definition OIT.cpp:350
TArray< FSortedTriangleData > Allocations
Definition OIT.h:72
TArray< FSortedIndexBuffer * > FreeBuffers
Definition OIT.h:73
uint32 FrameIndex
Definition OIT.h:76
void Deallocate(FMeshBatchElement &OutMeshElement)
Definition OIT.cpp:421
Definition OIT.h:31
FSortedIndexBuffer * SortedIndexBuffer
Definition OIT.h:33
uint32 SourceBaseVertexIndex
Definition OIT.h:37
uint32 NumPrimitives
Definition OIT.h:40
uint32 SourceMaxVertexIndex
Definition OIT.h:39
uint32 SourceMinVertexIndex
Definition OIT.h:38
const FIndexBuffer * SourceIndexBuffer
Definition OIT.h:32
EPrimitiveType SortedPrimitiveType
Definition OIT.h:44
uint32 SortedFirstIndex
Definition OIT.h:35
uint32 SourceFirstIndex
Definition OIT.h:36
EPrimitiveType SourcePrimitiveType
Definition OIT.h:43
bool IsValid() const
Definition OIT.h:46
uint32 NumIndices
Definition OIT.h:41