Pathtracer

2018 APRIL

Image


Recently, there has been a revival of raytracing and pathtracing. NVIDIA has kicked this off and shown that the time is right. In order for me to really appreciate what raytracing is and how it works, I’d need to write my own. I can only really understand something if I do it myself. Just reading about something usually leaves me with too many questions.

So I decided to make pathtracer with only triangular primitives.

The only way to do so, is to visually verify that things are right. Knowing myself, I needed to have some debugger. Therefore, I decided to make a system that has a small adapter to OpenGL that renders my object primitives, and the camera in an OpenGL 3D environment so I can see what’s going on. The pathtracer rendering screen is also rendered inside this OpenGL world.

Here is a video to show it in action:

This pathtracer does around 0.00001 frames per second on 1080p resolution without much noise. Clearly I cannot be accused of early optimization.

Progress

Image
Started with a *ray*tracer, and rendered the triangle.

Image
Put a few triangles in the world, added illumination and color properties.

Image
Added perspective. This render took around an evening.

Image
My (shabby..) take on the Cornell Box.

Resources