This week I've been most working on the 660 final project. However I made something to show by now.
I made a few changes to the data structure and also fixed a small bug in my previous version. The changes are made mostly due to supporting new features.
The first thing added was Depth of Field. This part is done using a stochastic method based on purely physics. It's not computational heavy, cause I'm doing path tracing. If it has to be done in ray tracing, distributed ray tracing have to be used to generate a good result.
Here's a group of image showing lens with different focal plane (focus on different object).
Another feature is Fresnel refraction and reflection. I added this because I felt the transparent sphere in the scene seems weird, and then I realized that there should be reflection. This part is done also based on pure physics. Stochastic method is also used here to simulate different kinds of polarized light beams.
The third thing I did was analyzing the performance. Thanks to Varun, I learned to use Visual Profiler to see the detailed information of my program in run time, as well as occupancy calculator to find out the best block size for my program. Moreover, I changed the main PathTrace() function a little bit, and thus almost doubled the performance. In the previous version, I'm using a simpler scene and the fps is around 12, and now I've added a simple obj file into the scene, and rearranged the block size. The result is around 20 fps.
One last thing to say is I added a fps viewer. Showing not only the displaying frame rate(how frequently openGL is called draw function), but also the real rendering speed(how many layers rendered per second). In the process of adding this tool, I realized there's a certain need for my PathTrace() function to call cudaDeviceSynchronize(). And because I added this, the two frame rate displayed on the screen are almost the same all the time.
Here's two final image of my tracer. One takes 4 minutes to render and the other takes about 10 minutes. I just leave it running while writing this post.
Here's a image of previous version. No depth of field, no Fresnel equations, and also no obj files are added in the scene. You could make a comparison with former ones.
OK now I feel it's pretty much done for everything I thought possible to implement for final project. It's time to turn to my final paper and demo.
There's still lot's of future work to do, like continue with my previous cuda kdtree, and the image space photon mapping. This would definitely be my own projects during the summer.