ABSTRACT

In this chapter, the authors discuss decoupled deferred shading, a technique that uses a novel G-buffer structure to reduce the number of shading computations while keeping the antialiasing quality high. They consider the basic theory of decoupled sampling, and focus on the implementation details of our new G-buffer in the OpenGL pipeline. The authors also focus on how to implement decoupled deferred shading on a modern Graphics Processing Unit (GPU). In authors examples they provide OpenGL Shading Language source code snippets. They utilises global atomics and scatter operations, therefore a minimum version of OpenGL 4.2 is required for their application. The primary problem for authors example is the lack of hardware support for decoupled shading reuse, which is an architectural limitation. The streaming nature of the GPU suggests that even a simple first-in, first-out (FIFO) cache could be quite efficient as only the recently touched shading samples are "interesting" for the fragments.