ABSTRACT

This chapter presents an original GPU ray-tracing application running solely on the compute shader and Shader Model 5.0 in DirectX 11. (DirectX 11.1 was released shortly after this writing. The demo uses only DX11.0 features, and a few implementation details may change in DX11.1) The implementation includes gloss mapping, normal mapping, texturing, shadowing, reflections, and a bounding volume hierarchy (BVH) for fast ray-intersection discovery. We analyze the advantages and disadvantages of using multipass ray tracing for handling a number of infinite concurrent textures versus a strategy that handles a limited number of textures in one pass. The ray tracer achieves interactive frame rates on high-end video cards and can be used as a starting point to implement more advanced rendering techniques. (See Figure 3.1.)

3.2 Ray Tracing Ray tracing is an advanced illumination technique that simulates the effects of light by tracing rays through the screen on an image plane. The degree of visual realism of the images generated via this technique is considerably higher than that obtained through other rendering methods such as rasterization. However, the computational cost is so high that ray tracing has mostly been used for offline rendering. Nevertheless, real-time ray-tracing applications are available today thanks to constant hardware improvements and algorithmic advances, which ultimately yield more efficient algorithms.