For a programming class in my second year of studies I wrote an object oriented ray tracer in C++. There is support for multiple types of objects, diffuse and reflection, multiple light sources and a scene reader.
I have rendered the same scene with different resolutions and samples per pixel. Samples per pixel means the number of times a ray is shot through that pixel, and each time through a slightly different point in that pixel.
Render time for the cornell box on a i5-8250u processor.
|Resolution||Sampels Per Pixel||Render time||Result|
- Support for Spheres, Cubes and Planes
- Diffuse and reflection
- Multiple lights
- Movable camera with a user controlled FOV and position
- Scene reader
The ray tracer consists of different objects classified in a class structure. For example, a Parent class for all objects, and different objects derived from this Parent class such as Cube, Sphere and Plane. By using the Parent-Child structure, the child class can inherit functions that are the same for all objects. See the simple UML design below.
The installation process is quite simple. Clone this repository and execute the following command:
- Add support for more shapes
Checkout the source code here!