HW #1

During this phase, I have implemented the backbone of the ray tracer. Basically, it shoots rays from the camera and for each of them the program checks if it hits any object in the scene. If it does, the program checks if that ray reaches one of the lights and calculates the color value. If the object is a mirror, it sends another ray starting from the hit position and the procedure continues like that. Shading model used in the ray tracer is Blinn-Phong model.

The only acceleration technique applied is backface culling. Since the scenes given for this homework does not require us to draw back faces of objects (in other words, they are not expected to be visible in the output), I have implemented it and observed the results. Of course, it is not always desired and it may cause errors for certain scenes.

The ray tracer supports Microsoft Windows platform only since it makes use of Win32 API. Other third party libraries used are:
Compiler used is "Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23506 for x64" which comes with Microsoft Visual Studio 2015. Compiler and linker flags used are as follows:

    Compiler:
        Debug  : /fp:except- /fp:fast /Gm- /GR- /EHa- /Od /MTd
        Release: /fp:except- /fp:fast /Gm- /GR- /EHa- /O1 /MT

   
    Linker:
        Debug  : /opt:noref
        Release: /opt:ref


The ray tracer is tested on a Microsoft Windows 8 machine with Intel® Core™2 Quad Processor Q8400. The following table shows how many seconds it took the program to generate images below.



Cornellbox
Bunny
w/ Culling
w/o Culling
w/ Culling
w/o Culling
Debug
6,3350104
6,0724381
289,1138215
239,518744
Release
0,7132393
0,7718221
39,8909909
42,7677958


Cornellbox (800x800)

Bunny (512x512)

Generated images for different configurations shown in the table are completely identical for corresponding inputs. Also, /fp:fast flag does not affect the results significantly. It only changes the value of a few pixel, which is not perceivable and negligible.

Thanks for reading.

Comments

Post a Comment