4#ifndef vtkWebGPUComputeOcclusionCuller_h
5#define vtkWebGPUComputeOcclusionCuller_h
10#include "vtkRenderingWebGPUModule.h"
17VTK_ABI_NAMESPACE_BEGIN
86 vtkRenderer* renderer,
vtkProp** propList,
int& listLength,
int& initialized)
override;
99 void SetupDepthBufferCopyPass();
104 void SetupMipmapsPass();
109 void SetupCullingPass();
124 void CopyDepthBuffer();
144 void UpdateBoundsBuffers(
vtkProp** propList,
int listLength);
150 void AddOcclusionCullingPipelineToRenderer(
vtkRenderer* renderer);
155 void CreateHierarchicalZBuffer();
162 int ComputeMipLevelsSizes(
int width,
int height);
168 void ResizeHierarchicalZBuffer(uint32_t newWidth, uint32_t newHeight);
174 void ResizeHierarchicalZBufferMipmapsChain();
180 void FinishSetupDepthCopyPass();
186 void FinishSetupMipmapsPass();
191 void FinishSetupCullingPass();
196 static void ReadIndicesCountCallback(
const void* mappedData,
void* indicesCount);
207 static void FillObjectsToDrawCallback(
const void* mappedData,
void* data);
213 static void OutputIndicesCulledCallback(
const void* mappedData,
void* data);
219 static void WindowResizedCallback(
220 vtkObject* caller,
unsigned long eid,
void* clientdata,
void* calldata);
230 int HierarchicalZBufferTextureIndexCopyPass = -1;
232 int HierarchicalZBufferTextureIndexMipmapsPass = -1;
234 int HierarchicalZBufferTextureIndexCullingPass = -1;
236 std::vector<vtkSmartPointer<vtkWebGPUComputeTextureView>> HierarchicalZBufferMipmapViews;
238 std::vector<int> HierarchicalZBufferMipmapViewsIndices;
240 int HierarchicalZBufferMipmapCount = -1;
242 std::vector<int> MipmapWidths;
244 std::vector<int> MipmapHeights;
256 int CullingPassHierarchicalZBufferView = -1;
258 int CullingPassBoundsBufferIndex = -1;
261 int CullingPassOutputIndicesBufferIndex = -1;
263 int CullingPassOutputIndicesCountBufferIndex = -1;
266 int CullingPassOutputIndicesCulledBufferIndex = -1;
268 int CullingPassOutputIndicesCulledCountBufferIndex = -1;
270 int CullingPassBoundsCountBufferIndex = -1;
272 int CullingPassMVPMatrixBufferIndex = -1;
275 struct FillObjectsToDrawCallbackMapData
279 int* listLength =
nullptr;
289 struct OutputIndicesCulledMapData
299 int culledCount = -1;
304 bool FirstFrame =
true;
306 bool Initialized =
false;
a superclass for prop cullers
a simple class to control print indentation
abstract base class for most VTK objects
abstract superclass for all actors, volumes and annotations
abstract specification for renderers
Hold a reference to a vtkObjectBase instance.
a weak reference to a vtkObject.
This culler does both frustum culling and occlusion culling.
double Cull(vtkRenderer *renderer, vtkProp **propList, int &listLength, int &initialized) override
Culls props and returns the number of props that still need to be rendered after the culling.
vtkWebGPUComputeOcclusionCuller()
~vtkWebGPUComputeOcclusionCuller() override
void SetRenderWindow(vtkWebGPURenderWindow *webGpuRenderWindow)
Sets which render window this occlusion culler is going to work on.
static vtkWebGPUComputeOcclusionCuller * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.