Tuesday, May 15, 2007

Correct Reflections and Specular Lighting

Well, this is the first big milestone in the project. My ray tracer now actually renders something that looks believable, abstract, but believable. I corrected the bugs in the reflection ray calculations so reflections now show up on the correct side of the sphere. In addition, I added specular highlights as well. So now the spheres look like shiny balls that reflect their surroundings.

The algorithms are grossly inefficient. I don't really care at this point. :) I will have to go back in and refactor a lot of the code to fix the naive assumptions I made about ray tracing as I was just getting started. I only have one picture to post at this time. I am in the middle of upgrading my linux distribution from gentoo 2006.01 to the 2007.01 profile. This basically means I have to recompile every single library and executable on my machine. Since the dependant libs must be compiled first, sometimes apps stop working periodically. Apps like my ray tracer. *sigh*

I still need to add shadows. I couldn't get it to work before, but I think that fixing the reflections, will fix the shadows as well, since calculating the shadow rays, reflection rays and surface normals are very, very similar. I'll post more images when I can.



I decided to start using flickr for the renders I post. I added a few more renders, you can see them here.