Nabla icon indicating copy to clipboard operation
Nabla copied to clipboard

Occlusion Culling in ILoDAndCullingSystem (or a derivative)

Open devshgraphicsprogramming opened this issue 4 years ago • 1 comments

Description

Incorporate @Przemog1's Depth Pyramid Generator and HiZ culling into the culling of the LoD System.

Description of the related problem

Requires two passes of rendering, once to render previously visible and frustum culled.

Inbetween as an interlude we need to compute the HiZ Pyramid and occlusion cull the remainder of the PVS set.

Then render the frustum culled, not previously visible and occlusion culled.

Solution proposal

A single PVS instance/drawcall buffer that's being appended to, can be appended from both sides.

We can use the beginning side to append instances and drawcalls visible in current frustum and last frame. And the end side to append instances and drawcalls visible in current frustum but not visible in the last frame.

However we shouldn't perform the sorting scatter or prefix sum of the non-previously visible instances until we HiZ Occlusion Cull the PVS draw instances (so delay the middle culling dispatch for the second set until after the first has been drawn).

Additional context

This should depend on the renderer using vis buffer, the culling system should just accept an SSBO with a per-object history visibility flag.

Cap the HiZ mip level 0 resolution to max 4096x2048

Consider whether to sort the image tapping requests by texelCoordinate morton code and mipmap within the workgroup.