4#ifndef vtkWebGPUComputeOcclusionCuller_h
5#define vtkWebGPUComputeOcclusionCuller_h
10#include "vtkRenderingWebGPUModule.h"
16VTK_ABI_NAMESPACE_BEGIN
97 void SetupDepthBufferCopyPass();
102 void SetupMipmapsPass();
107 void SetupCullingPass();
122 void CopyDepthBuffer();
142 void UpdateBoundsBuffers(
vtkProp** propList,
int listLength);
148 void AddOcclusionCullingPipelineToRenderer(
vtkRenderer* ren);
153 void CreateHierarchicalZBuffer();
160 int ComputeMipLevelsSizes(
int width,
int height);
166 void ResizeHierarchicalZBuffer(uint32_t newWidth, uint32_t newHeight);
172 void ResizeHierarchicalZBufferMipmapsChain();
178 void FinishSetupDepthCopyPass();
184 void FinishSetupMipmapsPass();
189 void FinishSetupCullingPass();
194 static void ReadIndicesCountCallback(
const void* mappedData,
void* indicesCount);
205 static void FillObjectsToDrawCallback(
const void* mappedData,
void* data);
211 static void OutputIndicesCulledCallback(
const void* mappedData,
void* data);
217 static void WindowResizedCallback(
218 vtkObject* caller,
unsigned long eid,
void* clientdata,
void* calldata);
228 int HierarchicalZBufferTextureIndexCopyPass = -1;
230 int HierarchicalZBufferTextureIndexMipmapsPass = -1;
232 int HierarchicalZBufferTextureIndexCullingPass = -1;
234 std::vector<vtkSmartPointer<vtkWebGPUComputeTextureView>> HierarchicalZBufferMipmapViews;
236 std::vector<int> HierarchicalZBufferMipmapViewsIndices;
238 int HierarchicalZBufferMipmapCount = -1;
240 std::vector<int> MipmapWidths;
242 std::vector<int> MipmapHeights;
254 int CullingPassHierarchicalZBufferView = -1;
256 int CullingPassBoundsBufferIndex = -1;
259 int CullingPassOutputIndicesBufferIndex = -1;
261 int CullingPassOutputIndicesCountBufferIndex = -1;
264 int CullingPassOutputIndicesCulledBufferIndex = -1;
266 int CullingPassOutputIndicesCulledCountBufferIndex = -1;
268 int CullingPassBoundsCountBufferIndex = -1;
270 int CullingPassMVPMatrixBufferIndex = -1;
273 struct FillObjectsToDrawCallbackMapData
277 int* listLength =
nullptr;
287 struct OutputIndicesCulledMapData
297 int culledCount = -1;
302 bool FirstFrame =
true;
304 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.
vtkWebGPUComputeOcclusionCuller()
~vtkWebGPUComputeOcclusionCuller() override
vtkWebGPUComputeOcclusionCuller(const vtkWebGPUComputeOcclusionCuller &)=delete
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.
void operator=(const vtkWebGPUComputeOcclusionCuller &)=delete
double Cull(vtkRenderer *ren, vtkProp **propList, int &listLength, int &initialized) override
Culls props and returns the number of props that still need to be rendered after the culling.