12 Mart 2017 Pazar

Ceng 795 / Raytacer Part 1


I will be posting my results of the ray tracer that I will be developing rhoughout this semeter in the CENG 795 , ray tracing course.

Firstly, I used to have a working ray tracer which I wrote back in my undergraduate graphics course. I looked through the code and saw that it was garbage :) . Lots of argument value copies in small functions, weird syntax using and etc. I fixed those issues, refactored the code, migrated the input system to the new xml format specified in the class. Here are the basic images from the current version of the cpu ray tracer.



Shading model is blinn-phong. There are two types of light, one is ambient and the second is point light with shadows.





Optimization & Timings


Finally, I added the OpenMP parallel for functionality to the code. To make it work, one should only use the pragma before the for loop and give the -openmp compile flag to the commpiler. I know that doing low level optimmizations before doing some high level ones like "bounding volumes" is very unorthodox. Nevertheless, I had little time for some additional things and I wanted go for a parallelization technique. Timings for 800x800 stanford bunny image with debug, release and release parallel comfigurations are listed below.



Debug : too much to actually wait
Release: 28.34 secs
Parallel Release :9.34 secs







Hiç yorum yok:

Yorum Gönder