For the first assignment, I was building the core features of the ray tracer.
This expected to have the required primitives, such as rays, camera model, and the image plane.
The external libraries used were: GLM, where vector operations were needed. I used vec3 as a container. Besides, functions such as normalize and distance were in use as well.
Although it might seem trivial, I had a tough time parsing the scene file, which is in XML format. There, the library called tinyxml2 came to the rescue.
Although I intended to get PNG outputs with LodePNG, currently I only settled for a .ppm output. Later on, full SDL integration would display the images in a window on the fly.
![]() |
| Cornell Box v0.1 |
1) The reflection on Phong material is wrong. Later, the vector direction was fixed.
2) The intensity of the light was somewhat arbitrary, as I failed to clamp the color values.
3) The mirror reflection is missing.
![]() |
| Cornell Box v0.2 |

The bunny looks somewhat better compared to the other. Here, the colors are also a bit darker from the reference image.
While simultaneously proceeding to the further assignments, I will also look for remedies for the problems that were listed above.


Yorumlar
Yorum Gönder