Tuesday, January 29, 2008

Raytracing Woes

Well, last semester I wrote a raytracer for class. Now I'm currently adapting it to other projects this semester, and working on it to be fast enough to become the default renderer in GameLib.

It's amazing how much a month of neglect of code brings out all the flaws. Rested mind, I easily found spots where the logic was questionable - and impossible to enter if statements. And all that in the core ray-shooting code.

Right now I'm adding amortized rays, and removing bad code. The program is somewhat faster - from 0.8fps -> 1.8fps max on a 256x256 texture. I had hoped for more than just a single fps gain - so will revisit the code next week to improve subdivisions.

The implementation from last semester used Altivec to amortize rays - the problem being that if rays diverged paths then a lot of useless calculations would be done (the higher the resolution, the better the benefit, or so is the bet).

No comments:

Post a Comment