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;
306 vtkWeakPointer<vtkWebGPURenderWindow> WebGPURenderWindow =
nullptr;
310 vtkSmartPointer<vtkCallbackCommand> WindowResizedCallbackCommand;
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.