UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FInstanceCullingOcclusionQueryRenderer Class Reference

#include <InstanceCullingOcclusionQuery.h>

Public Member Functions

uint32 Render (FRDGBuilder &GraphBuilder, FGPUScene &GPUScene, FViewInfo &View)
 
void RenderDebug (FRDGBuilder &GraphBuilder, FGPUScene &GPUScene, const FViewInfo &View, const FIntRect &ViewRect, FRDGTextureRef SceneColor, FRDGTextureRef SceneDepth)
 
void MarkInstancesVisible (FRDGBuilder &GraphBuilder, TConstArrayView< FGPUSceneInstanceRange > Ranges)
 
void EndFrame (FRDGBuilder &GraphBuilder)
 
bool IsCompatibleWithView (const FViewInfo &View)
 

Public Attributes

TRefCountPtr< FRDGPooledBufferInstanceOcclusionQueryBuffer
 
EPixelFormat InstanceOcclusionQueryBufferFormat = PF_Unknown
 

Detailed Description

Implements accurate per-instance occlusion culling similar to FOcclusionFeedback, except using GPUScene.

Member Function Documentation

◆ EndFrame()

void FInstanceCullingOcclusionQueryRenderer::EndFrame ( FRDGBuilder GraphBuilder)

Perform various book-keeping tasks that must run at the end of each frame Saves view ID mapping data, extracts result buffer to be available next frame, etc.

◆ IsCompatibleWithView()

bool FInstanceCullingOcclusionQueryRenderer::IsCompatibleWithView ( const FViewInfo View)

◆ MarkInstancesVisible()

void FInstanceCullingOcclusionQueryRenderer::MarkInstancesVisible ( FRDGBuilder GraphBuilder,
TConstArrayView< FGPUSceneInstanceRange Ranges 
)

Mark blocks of occlusion query buffer entries as visible in all views. Required, for example, when GPUScene instances are invalidated betwen frames, i.e. when when GPUScene instance buffer slot is re-allocated.

◆ Render()

uint32 FInstanceCullingOcclusionQueryRenderer::Render ( FRDGBuilder GraphBuilder,
FGPUScene GPUScene,
FViewInfo View 
)

Perform per-instance occlusion culling using HZB and software occlusion queries. Returns view-specific bit mask that should be used when interpreting query result buffer, since it contains 1 bit per view.

◆ RenderDebug()

void FInstanceCullingOcclusionQueryRenderer::RenderDebug ( FRDGBuilder GraphBuilder,
FGPUScene GPUScene,
const FViewInfo View,
const FIntRect ViewRect,
FRDGTextureRef  SceneColor,
FRDGTextureRef  SceneDepth 
)

Render object bounding boxes, color-coded based on visibility

Member Data Documentation

◆ InstanceOcclusionQueryBuffer

TRefCountPtr<FRDGPooledBuffer> FInstanceCullingOcclusionQueryRenderer::InstanceOcclusionQueryBuffer

One uint8 per instance in GPUScene, with 1 bit per view Available when when instance culling is enabled and r.InstanceCulling.OcclusionQueries=1. Contains data for previous frame. Assumes that GPUScene instance indices are consistent.

◆ InstanceOcclusionQueryBufferFormat

EPixelFormat FInstanceCullingOcclusionQueryRenderer::InstanceOcclusionQueryBufferFormat = PF_Unknown

The documentation for this class was generated from the following files: