Skip to content

alexktvsky/raytracer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Raytracer

This is a training project aimed at learning ray tracing algorithm and practicing convert sequential CPU code into a parallelized GPU code using CUDA.

Ray tracing is a rendering technique for generating an image by tracing the path of light as pixels in an image plane and simulating the effects of its encounters with virtual objects. The technique is capable of producing a high degree of visual realism, more so than typical scanline rendering methods, but at a greater computational cost [1].

Happily, the rendering of images is a highly parallelizable activity, as color of every pixels can be calculated independently of the others.

Since graphics APIs such as OpenGL and DirectX are not designed for ray-traced rendering, implementing a GPU raytracer seems like a suitable project to practice with CUDA C++.

Application supports PLY and FBX file formats. The first may contain only polygon meshes, for the last one meshes, light sources and materials are supported.

OpenGL and freeglut libraries were used to display the resulting image.

Rendering results

The source code is published under BSD 2-clause, the license is available here.

How to run

git clone https://github.com/alexktvsky/raytracer.git
cd raytracer
mkdir build
cd build
cmake .. && cmake --build . --parallel
./raytracer ../assets/fbx/ak74m.fbx

Supported systems

  • GNU/Linux
  • macOS
  • Windows 7 and above

Third-party