The main topic of this thesis was to implement a computer program that can render photorealistic images by simulating the laws of physics. In practice the program builds an image by finding every possible path that a light ray can travel. Technique presented in this thesis will naturally simulate many physical phenomenons such as reflections, glass materials, soft shadows, indirect lighting etc. This thesis explains step-by-step how a pixel in an image gets its color by tracing a light ray through an arbitrary scene. The thesis also explains how to make the renderer run faster by optimizing certain data structures and exploiting parallellism in CPU and in GPU by using the OpenCL framework. Using these techniques it is possible to reduce the...