Skip to content

My Computer Science Engineering MSc thesis at University of Miskolc

Notifications You must be signed in to change notification settings

mandyedi/raytracing-thesis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Summary

My interest of computer graphics led me to choose the topic of my diploma project. As a part of computer graphics I wanted to engage in ray tracing. I was interested in making photorealistic images using this method and also interested in all the problems and challenges that I had to deal with.

Firstly I set a goal to get more knowledge of the method of ray tracing through implementing a simple ray tracer algorithm. The method is not applicable in real time graphic applications due to its slow rendering time and instead of using ray tracing the much faster incremental image synthesis has become the ruler algorithm in computer graphics. Because of this the main goal of my thesis is to optimize the ray tracer algorithm using two features of the CPU. One of them is multithreading and the other is the SIMD technology. I used the advantages of multithreading on the main loop of the renderer such a way that the screen was split into multiple parts and the rendering happened in parallel on multiple parts. The SIMD technology was used to make faster the ray-triangle intersection. With the optimization the intersection test actually happens between one ray and four triangles at the same time.

For implementing the software I used C++ and for the user interface I used the QT framework that is also based on the C++ language. Before rendering the image the software makes it possible to construct the scene with simple objects or use custom obj files. Furthermore several properties of the object are adjustable such as the position and material. To display the actual scene I used the OpenGL API. Thanks to QT’s platform independence the source code can be built on Linux and OSX based systems too, though I did not test the software on them. I developed the software on Windows.

Ray tracing is easy to implement on a multithreading environment so I did not encounter any difficulties on this part of my work. On the other hand the SIMD technology had some challenges. The first tries did not give me the results I expected. The software became slower rather than faster. Delving into the subject I learnt new data structures and the Intel’s SIMD technology, the SSE. Finally I got the expected result. Using the advantages of a multicore processor and the SIMD technology I managed to make faster the ray tracing algorithm.

Though the ray tracing algorithm uses only the CPU I need to mention that the algorithm can be implemented on GPU as well. Since it is suitable to implement on a multicore architecture it can be worth to delve into the subject. The software has room for improvement both in the ray tracing algorithm and in the optimization. The ray tracing algorithm has only the basic effects such as diffuse and specular lightning, reflectance and shadows. Although the photorealistic image synthesis lacks of some effect it can be a good base for an advanced renderer. I used an early version of the SIMD technology. Though I could achieve good results with this version, on more modern CPU-s we can use registers with increased bit width so the ray-triangle intersection test can be improved to test one ray with more than four triangles.