Apollo Ellis Gold Steel Ray Tracing Background: Ray Tracing needs no introduction in a graphics class, however Gold Steel is a Ray Tracer of a special kind. In this next generation of multi-core hardware acceleration, eyes are turning more and more toward the aesthetic benefits ray tracing as a possibility to produce real time 3d graphics. Gold Steel tries to accomplish this via the PS3 Linux Cell BE platform. Armed with 7 cores and fast SIMD floating point units the Cell processor offers theoretical performance gains of up to 24x over a serial processor. The Cell processor is divided into a control processor which is Power PC called the PPU, and 8 peripheral vector streaming units called SPEs or synergistic processing engines. DMA intrinsics are issued from either side to share data across a high speed BUS. The PPU is the only processor with access to main memory, and on the PS3 only 6 of the SPEs are active. Linux is installable on the PS3 in the flavors of Fedora Core, Yellow Dog, and even the popular Ubuntu releases. Once installed the operating system is not given access to the nvidia RSX GPU, but provides a memory mapped virtual frame buffer for graphics application writers. As software is the only available processing power attempts have been made at implementing the infamous software app a ray tracer since the release of the PS3. Numerous articles, talks, and documents are available for reference on Cell ray tracing. In fact the IBM cell SDK comes equipped with a plethora of vector math functions useful for maximizing speed on the tricky to code platform. Blue Steel, released at MIT open source, was one of the first PS3 ray tracers. It was showcased at GDC in San Francisco and is quite well know. I myself have written a ray casted clone version of the popular hit Doom on the PS3 and have worked on Blue Steel as well. For this project I decided to attempt yet another PS3 ray tracing implementation. I attempted to fully utilize the SIMD vector units while running the ray tracing kernel on all 6 SPEs. A simple Whitted style ray tracer was the goal, however the speed achieved by Blue Steel and others suggested the possibilities for some very interesting results, and speedy ones. Gold Steel Implementation In order to save space on the cache limited SPEs I pursued a C style functional implementation. Starting with the parser for the scene, I went on to implement a simple API for SPE communication on the PPU. I knew I needed to process four rays at a time with those SPE vector units so I took this into account when creating data structures. I ended up recreating the structure of array or SOA style of environment and structures for the task. After making sure that the scene was read onto the SPEs. I implemented a simple init function for creating the virtual camera boundaries and preparing for casting rays. I again turned to SOA to take advantage of the vector math libraries written in this format. My ray packet consist of 6, 4 element wide vectors of floats for origin point x, y, z and direction x,y,z for each of four rays. While going though a terribly rough ride of an over night install of Linux. I wrote up a triangle intersection algorithm in my simulator. Not being able to turn to conditional and branches as usual I utilized bit masks and logical operators to ensure the proper data was returned in each SOA “hit packet”. However after compiling the code I realized that the time taken understanding what I had done wrong (debugging ) was probably equivalent or even lengthier than that which would be spent understanding SOA in depth and using the provided IBM accelerated ray packet triangle intersection algorithm. The method takes a slue of vectors as input and returns the t value of the hit if a valid hit is reached, for each ray. It returns the uv coords of the hit, and even a user provided id of the triangle. Once I understood, though testing , how these values changed and were to be used. I implemented a more complex loop through triangles in a scene. The only thing left to do was write a shader. So I spent all night and two days doing that. Finally my triangle appeared and it was time move on. However, I was running out of time. This task had proven to be more extensive than I had expected, especially after starting with the Stanford ray tracer from CS 384g and abandoning it after a week worth of work for it's bloated code size. I decided that in the sake of time and getting something done that I should go back to my roots and turn to the Blue Steel predecessor of my Gold Steel project. Reluctantly I tar xjfed the file and began poking around in the Sphere intersection routine. As it turns out this routine is written in SOA form. After a bit of tweeking I was able to integrate it in. Then that famous glow bug arrived. YOU know the one where the sphere has a specular reflection, but in addition has nice brim of glow along the edges. This is the result of not checking the dot product between the view and the light's reflected vector before raising it to a even power. If the value is negative the color should be discarded. If not , well lets just say I started at 7pm and went to bed with a properly lit sphere an 9am. Again realizing that I was out of time. I have left the ray tracer in it's current state, which is buggy. I can render triangles. I can render spheres. Rendering triangles and spheres however is beyond the current capabilities. There is still a point to be made though. IT'S FAST! I can move spheres around in real time just about and that was worth the walk. ;-) Artifact For my artifact I have a video of the program running at 720p on the PS3. It is run from a remote ssh log in to avoid the slow PS3 Linux IO speeds. I am more focusing on spheres and have hard coded in some animation for them. As I am sure you have seen triangle before I will leave that to the imagination. References: IBM SPU_language_extensions_v21.pdf Blue Steel by Brian Sweat et al MIT Sketching for Multi-core Programming. Apollo Ellis Ray Tracing PPT. James O'brien UCB Shading PPT. James O'brien UCB
  • Video Demo
  • Gold Steel

    HOME

    Mom keeps watch Web Design by Linda Reed 2007