Penn CIS 400 - Achieving Real Time Ray Tracing Effects Through GPGPU Acceleration

Unformatted text preview:

University of Pennsylvania Senior Project: Achieving Real Time Ray Tracing Effects Through GPGPU Acceleration Matthew J. Vucurevich [email protected] Advisor: Camillo J. Taylor [email protected] Abstract: The computer graphics industry has recently become one of the most influential stimuli for the production of faster and more advanced ASICs. GPU’s have made their presence known as performance enhancements in your home computer as well as the primary component of video game consoles. They are recently emerging as a very important part of handheld devices (laptops, cell phones, i-pods) and their usefulness will only continue to grow. One could argue that computers are fast enough as is to run 99% of our non-graphical daily needs, but improvements in the GPU industry have been a driving force leading to improvements in the CPU industry as well. One major reason to upgrade to a more resource heavy OS such as Windows Vista is its ability to support Direct-X 10 graphics. As the demand for the GPU industry grows, research in this area becomes that much more important. The current direction of GPU hardware has allowed for a certain amount of computational abstraction allowing functionality that is different from the traditional graphics pipeline. This new approach allows for individual programmability in two of its most important stages. Vertex and fragment shaders can now be given unique sets of instructions to execute in order to fully exploit the true level of data parallelism that is available in a GPU. Many languages have been developed to allow customization that is close to assembly language in scope, but with a clearer structure. Nvidia and Microsoft developed the Cg (C for graphics) programming language allowing individual programming of vertex and pixel shaders, and other languages include ARB low level assembly language, OpenGL shading language (GLSL), and DirectX High-Level Shader Language (HLSL). NVidia’s CUDA technology (Compute Unified Device Architecture) focuses specifically on the potential programmable GPU shader blocks have to solve complex computational problems from a variety of different applications, and has its own Toolkit to develop in this environment. The programmability of this newer generation of GPU’s will allow complex functionality such as ray tracing image generation algorithm to take advantage of the GPU pipeline despite the fact that its approach to processing elements of the image is completely opposite of the traditional graphics pipeline. For this project, I utilize the programmability of the vertex and fragment shaders of modern GPU’s to implement a real time ray tracing effect through the help of programmable GPU hardware. Graphical Processing Units no matter the approach will all share qualities that differ greatly from their CPU counterparts. GPU’s can be improved simply by adding more vertex/pixel/shader processors because all graphics pipelines can parallelize most of their calculations. CPU’s generally operate on sequential code making the cost/benefit ration of adding extra transistors much higher. With this project I hope to demonstrate the power of parallelism in GPU shader processers as well as produce a deliverable that could be used as an effects enhancement for modern video games. 2 Previous Work:“Ray Tracing on Programmable Graphics Hardware” from Stanford University provides an excellent blueprint on an approach to Ray Tracing on a GPGPU. This project was conducted during the initial onset of programmable vertex and fragment processors so it runs a simulation on many of its ideas as opposed to an actual implementation. Although their work did not include an implemented version, the theory clearly inspired later implementations of GPU ray tracing. The most notable implementation of GPU ray tracing comes from Martin Christen’s (of University of Applied Sciences Basel) Master’s Diploma Thesis “Ray Tracing on GPU.” This paper gives a thorough breakdown on how to turn a shader program into a generalized stream processor and provides an actual HLSL GPU Ray Tracing example. While this pure ray tracer is very impressive, it still does not run in real time on even the most up to date graphics cards. As a result, the goal of my project is to take advantage of the normal graphics pipeline to do certain calculations quickly while only saving the most important for the costly ray tracer. My goal is to provide a ray tracing effect that is comparable to real ray tracing in quality but can be used in a real time environment. 3 Technical Approach: 3.1 GPGPU Ray Tracing In order to achieve the final goal of encapsulating the visual effects of ray tracing in a real time application, it was necessary to minimize calculations wherever possible. I will begin this section with a breakdown of how to properly implement a full out ray tracer on the GPU and follow with my project description of the shortcuts I used to achieve renderings that run in real time. Full GPGPU ray tracing closely follows the research of the pioneers listed in my previous work’s section. For a complete and detailed report on ray tracing using DirectX HLSL, see Martin Christen’s paper “Ray Tracing on GPU.” In general, when programming with GPU, the shader programs have a single main method and are compiled into one executable set. The compiled shader suite serves a single function; to render the scene. We do not explicitly call this shader program like a normal function. It simply is run automatically when on a stream of input data when we decide to render the scene. When we consider a ray tracing application, we need to abstract the use of shader programs into generic stream processors. The following definitions will come in handy when describing the shader program’s new use: kernel: a small program that operates on a stream (i.e. the shader) stream: set of data of the same type that is read-only or write-only The following is an abstracted diagram of Martin Christen’s approach that summarizes the operation of kernels in GPU ray tracing: (each circle represents a kernel or a shader program)3.1.1 Ray Generator The Ray Generator is a shader that generates a ray for each pixel that will be traversed in the following kernels. Output is stored in a texture. Each pixel in the texture corresponds to a pixel on screen. The fragment


View Full Document

Penn CIS 400 - Achieving Real Time Ray Tracing Effects Through GPGPU Acceleration

Download Achieving Real Time Ray Tracing Effects Through GPGPU Acceleration
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Achieving Real Time Ray Tracing Effects Through GPGPU Acceleration and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Achieving Real Time Ray Tracing Effects Through GPGPU Acceleration 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?