Gpu Occlusion Culling Vk Save Abandoned

GPU occlusion culling using compute shader with Vulkan

Project README

GPU occlusion culling using compute shader with Vulkan

This demo follows the hierarchical depth comparing method described in Experiments in GPU-Based Occlusion Culling by Kostas Anagnostou. Mesh, instance, and indirect draw command data stay in device local memory after initialization.

The commands(VkDrawIndexedIndirectCommand) for vkCmdDrawIndexedIndirect in this demo is not batched into one command for all instances, or packed as in the article above, but expanded as per instance. As a result, culling can be performed by setting the instanceCount to zero or one of a command according to visibility computation. According to query data, the demo shows that per-instance commands do not slow down draw performance. Shown in the following screenshots of non-extreme cases, significant amount of draw time is saved by enabling frustum and occlusion culling. (The program also provides a frustum culling only mode for isolating the effects.)

The frame time taken by compute pipelines for mipchain generation and depth image transfer commands is not trivial. But the convenience remains that it does not raise with scene complexity.

case 1

case 2


Controls:

  • pan: ADRF
  • forward/backward: WS
  • orbit: arrow keys
  • zoom: mousewheel
  • F1: MDI batched no culling
  • F2: MDI per-instance frustum culling
  • F3: MDI per-instance frustum and occlusion culling
  • F4: F3 with blending enabled
Open Source Agenda is not affiliated with "Gpu Occlusion Culling Vk" Project. README Source: sydneyzh/gpu_occlusion_culling_vk
Stars
36
Open Issues
0
Last Commit
6 years ago

Open Source Agenda Badge

Open Source Agenda Rating