External libraries used:
- tinyxml2 (tinyxml2.h, tinyxml2.cpp are provided in the homework files.)
- lodepng (lodepng.h, lodepng.cpp are provided in the homework files.)
- Eigen (Can be obtained from http://eigen.tuxfamily.org/)
Command to compile:
g++ -I /usr/include/eigen3/ -std=c++11 -O3 main.cpp RayTracer.cpp Vec3d.cpp Ray.cpp shape.cpp tinyxml2.cpp lodepng.cpp -o RayTracer
Running the ray tracer:
./RayTracer command should be fed by the relative path of the input file, e. g.,
795_input_set_02/horse.xml
The image on the left is the output of bunny.xml file with smooth shading mode. It illustrates how bunny looks when it is rendered with smooth mode.
Generated around 56 seconds.
Please note that same image with flat mode was generated around 53 seconds.


The image on the left is the output of horse.xml file with smooth shading mode and when no transformation is applied. It illustrates how horse looks when it is rendered with smooth mode and without any transformation.
Generated around 39 minutes and 54 seconds.
The image on the left is the output of simple_transform.xml file. It just includes objects in the file simple.xml from the previous homework with some transformations applied.
Generated below 1 second.
The image on the left is the output of horse.xml file with flat shading mode and with the given transformations applied. The transformations are applied directly to the object rather than the ray. We can infer from the figure that translation and rotation works correctly. However, there may be a bug with the scaling because the horse in the given reference output was not as tall as in this image.

The image on the left is the output of spheres_transform.xml file. This time, instead of transforming the objects, the ray is transformed to the object space. The image does not match with the image provided as reference output. From sphere at the left in the image, we can infer that translation operation works correctly. However, most probably there is a bug with the scaling and rotation matrixes while transforming the ray into the object space.
Generated below 1 second.
The image on the right creates three instances of the horse in the image two above. While instancing, copies of the objects with desired transformations are created rather than transforming the ray. The horses in the reference output provided are smooth while in the image on the left are flat. This is due to the fact that I tested instancing before implementing smoothing and I the image on the left was generated. However, generation of this scene took so much time that I could not rendered the scene again with the smooth mode.
Generated around 118 minutes.
Hiç yorum yok:
Yorum Gönder