Giter Club home page Giter Club logo

gpu_occlusion_culling_vk's Introduction

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

gpu_occlusion_culling_vk's People

Contributors

sydneyzh avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.