Git Product home page Git Product logo

azdo's Introduction

azdo

AZDO OpenGL techniques including visibility culling and LOD selection inside the GPU

For more information about AZDO, checkout this 2014 presentation from GDC (mirror). You can also google "approaching zero driver overhead" :)

Description

We implement three techniques in the GPU:

  • Hardware instancing: Fast rendering of repeated geometries

    • Single draw call for all instances
      • Avoids API overhead
    • Access per-instance data
      • Use gl_InstanceID inside vertex shader
      • 3x4 transformation matrix
    • Combined with culling
      • gl_InstanceID -> visible buffer -> instance data
  • Visibility culling Discard geometries outside frustum and occluded

    • Compute shader
      • Test AABB vs frustum in clip space
      • Compute screen-space 2D AABB and its min-z
      • Fetch max depth from hierarchical-z 2D texture
      • If AABB min-z < max depth, store 1 else 0
    • How to build hi-z map
      • Draw occluders and use depth with mipmapping
      • logN rendering passes gather max of 4 texels=
  • Level of detail: Choose discrete levels during rendering

    • Compute shader
      • Gather instances with visible == 1
      • Use distance to camera to choose LOD
      • Write to different output buffer per LOD
      • Keep track of output index with atomic counters
    • Render all LOD at once
      • glMultiDrawElementsIndirect
      • drawCmds[i].baseInstance = i
      • LOD level vertex attrib w/ divisor = # instance + 1

The general rendering algorithm consists of the following steps:

  1. Render previously visible
  2. Update hierarchical-z mipmaps
  3. Test AABBs for visibility and store in current
  4. Gather visible in current and not last frames
  5. Render newly visible
  6. Gather visible in current for next frame
  7. Swap current with last

Results

Here are some images of a test scene consisting solely of cylinders and corresponding performance results:

scene lod perf

azdo's People

Contributors

potato3d avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

azdo's Issues

Link on the homepage is dead.

Hi,

I was interested to learn more about AZDO and wanted to follow the link in:
"For more information about AZDO, checkout this video".

Could you restore it, or share the name of the video?

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.