Advanced DirectX 11: DirectCompute by Example
- September 2 (Thu) 11:20 - 12:20
- Session (60min.)
GPU programming experience and understanding of the graphics pipeline
Ideas Take Away
Learn about advanced DirectX 11 techniques that take advantage of DirectCompute features and how they can be applied to games
DirectCompute is a relatively new addition to the DirectX 11 API that enables GPGPU processing within the standard DirectX 11 graphics API. In this talk we will discuss some key DirectCompute capabilities of DirectX 11 features using two examples ? order independent transparency and cloth simulation. The goal of our talk is not to teach all the details of DirectCompute and DirectX 11, but rather highlight some key features that could be useful to developers and how that could translate to existing game applications. The structure of the talk will be high level discussions of the algorithms and some code samples. These samples will only highlight key API features that would be new to current developers. Demos will be shown.
The first example, order-independent transparency, is a rendering example. Since blending semi-transparent geometry is often an order dependent operation, sorting must be performed. However, sorting is difficult (interacting geometries) and current methods can be time consuming (depth-peeling). We introduce a method that is fast, accurate, and only possible because of new DirectCompute features in DirectX 11. This method consists of two stages. In the first stage, all objects with transparency are rendered as normal with standard pixel shaders, except instead of writing to a render target we construct a linked list per-pixel consisting of depth and color. The linked list is constructed by using an append buffer (a new DX11 feature) and scattered writes. In the second stage, the resolve step, a single shader pass is used to sort the linked list at each pixel and blend the sorted list for the final pixel color. One advantage of this method is that it is a simple change and can be easily integrated into an existing rendering pipeline. Many DirectCompute features can be used in the traditional graphics pipeline (VS and PS). This technique has been featured in the Mecha demo for ATI 5000 series GPUs:
In the second example, we will present the integration of a DirectCompute-accelerated cloth simulation into the Bullet Physics SDK. Real time cloth simulation is a highly parallel problem that is perfect for acceleration on data parallel compute engines such as the current generation of GPUs. A cloth instance comprises a large number of particles connected by links defined by spring properties. Changing the structure and compression properties of these springs changes the behavior of the cloth allowing the artist to replicate the properties of a wide range of real and imaginary materials. We will introduce the applicable features of DirectX 11, present the flow of the computation and how this is implemented efficiently and describe some of the algorithmic changes necessary to obtain good performance on parallel hardware. One of the key takeaways will be performing the simulation with compute shader (CS 5.0) and using shared buffers to render directly using the vertex and pixel shader in order to limit extraneous copies. This technique can also be applied to other particle based simulation systems.
* The session contents are based on the information provided by the speakers.
O-CTO, Senior Engineer
Senior Member of Technical Staff
Advanced Technology Initiatives
Justin Hensley is a senior member of technical staff in AMD's Products Group Office of the CTO focusing on parallel programming using graphics processors. Since joining AMD, Justin has been involved with numerous projects including face recognition, depth extraction, game physics, and advanced rendering techniques. Justin received his Ph.D. in Computer Science from the University of North Carolina at Chapel Hill in 2007. He also holds an M.S. in Electrical Engineering from the University of California at Davis.'