85 vtkRenderer* renderer,
vtkProp** propList,
int& listLength,
int& initialized)
override;
98 void SetupDepthBufferCopyPass();
103 void SetupMipmapsPass();
108 void SetupCullingPass();
123 void CopyDepthBuffer();
143 void UpdateBoundsBuffers(
vtkProp** propList,
int listLength);
149 void AddOcclusionCullingPipelineToRenderer(
vtkRenderer* renderer);
154 void CreateHierarchicalZBuffer();
161 int ComputeMipLevelsSizes(
int width,
int height);
167 void ResizeHierarchicalZBuffer(uint32_t newWidth, uint32_t newHeight);
173 void ResizeHierarchicalZBufferMipmapsChain();
179 void FinishSetupDepthCopyPass();
185 void FinishSetupMipmapsPass();
190 void FinishSetupCullingPass();
195 static void ReadIndicesCountCallback(
const void* mappedData,
void* indicesCount);
206 static void FillObjectsToDrawCallback(
const void* mappedData,
void* data);
212 static void OutputIndicesCulledCallback(
const void* mappedData,
void* data);
218 static void WindowResizedCallback(
219 vtkObject* caller,
unsigned long eid,
void* clientdata,
void* calldata);
229 int HierarchicalZBufferTextureIndexCopyPass = -1;
231 int HierarchicalZBufferTextureIndexMipmapsPass = -1;
233 int HierarchicalZBufferTextureIndexCullingPass = -1;
235 std::vector<vtkSmartPointer<vtkWebGPUComputeTextureView>> HierarchicalZBufferMipmapViews;
237 std::vector<int> HierarchicalZBufferMipmapViewsIndices;
239 int HierarchicalZBufferMipmapCount = -1;
241 std::vector<int> MipmapWidths;
243 std::vector<int> MipmapHeights;
255 int CullingPassHierarchicalZBufferView = -1;
257 int CullingPassBoundsBufferIndex = -1;
260 int CullingPassOutputIndicesBufferIndex = -1;
262 int CullingPassOutputIndicesCountBufferIndex = -1;
265 int CullingPassOutputIndicesCulledBufferIndex = -1;
267 int CullingPassOutputIndicesCulledCountBufferIndex = -1;
269 int CullingPassBoundsCountBufferIndex = -1;
271 int CullingPassMVPMatrixBufferIndex = -1;
274 struct FillObjectsToDrawCallbackMapData
278 int* listLength =
nullptr;
288 struct OutputIndicesCulledMapData
298 int culledCount = -1;
303 bool FirstFrame =
true;
305 bool Initialized =
false;
307 vtkWeakPointer<vtkWebGPURenderWindow> WebGPURenderWindow =
nullptr;
311 vtkSmartPointer<vtkCallbackCommand> WindowResizedCallbackCommand;
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.