top of page

RAY TRACER

RaytrPreview.mp4
Role

Programmer

Language

C++

Duration

8 Weeks

Team Size

Solo Project

This project was made as a part of a graded assignment during my 1st year of education at BUas.

​

This was a solo project, work done for this project included: Multithreading, BVH, Adaptive sampling​, Multiple materials, Area lights and more.

Personal Focus & Contributions

Optimization was one of the most important aspects of this project. For this project I researched and implemented BVH using different split techniques, for example: SAH.​ To further optimize BVH, I converted it into a compact representation (Linear layout in memory). After building BVH, the tree is transformed to the linear representation by performing a depth-first traversal and stores the nodes in memory in linear order.

​

On average BVH with linear memory layout improved performance of the ray tracer by 90 times when rendering more complex scenes. Which allowed to render many primitives while maintaining sufficient performance. 

​

Multithreading was used to accelerate rendering by dividing the screen into multiple blocks (tasks) and distributing tasks between threads. 

Raytracer7.png
Raytracer9.png

Working on this project provided with a great opportunity to improve math and knowledge in certain areas of physics such as lighting, materials and more. Ray tracer supported multiple materials such as: Lambertian, Dielectric, Metal, Emissive, Marble-like.

Optimization: BVH / Multithreading

Features - materials, death of field, area lights

Rendering 160.000 spheres with simple materials. 

Traversal cost to reach the object in the BVH. 

Raytracer5.png
image (1).png

Implemented Depth Of Field. The effect was achieved by slightly offsetting ray's origin and direction everywhere except on the focus plane.

Added area lights that produce soft shadows by making light sources into spheres and casting multiple rays onto them. Average color of those multiple samples is used to color shadows.

bottom of page