Skip to content
This repository has been archived by the owner on Apr 29, 2021. It is now read-only.

GPU occlusion culling using compute shader with Vulkan

Notifications You must be signed in to change notification settings

sydneyzh/gpu_occlusion_culling_vk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

GPU occlusion culling using compute shader with Vulkan

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages