Sphere Ray-Tracing
Course project
This is an individual project conducted in the 6-th semester of my bachelor, in the course CSE306 Computer Graphics. Starting from scratch with C++, a simple ray-tracer is built for rendering spheres, simulating direct and indirect lighting of diffuse materials, reflective and transparent materials, soft shadows, depth of field, and motion blur.
The spheres in the scene were implicitly defined through functions, and from the camera's position, numerous rays were cast through each pixel. When a ray intersected with the surface of an object, the color of that pixel was determined by a predefined function that is determined by the material and lighting. Depending on the material, the ray would either return the surface's color directly or reflect/refract until it encountered a returnable color value or reached the maximum number of bounces. The implementation also included features like anti-aliasing, motion blur, and depth of field.
Different materials
2000 rays per pixel. From left to right: reflective, full transparent, hollow transparent.
Depth of field
2000 rays per pixel. The white sphere in the middle is in focus.
Motion blur
2000 rays per pixel. The sphere has an upward velocity.