A downloadable project

DESCRIPTION

Ray tracing realistically simulates how light rays reflect and refract. In the real world,  light rays are scattered from a light source, which bounces off of objects, and a very small percentage of those light rays will reach our eyes. To reduce the computing costs, we instead reverse this process and shoot rays from the origin of our eyes. For every pixel on the screen, a light ray is shot out into the scene from the camera's origin. When the ray intersects with a sphere in the scene, the light ray will "pick up" the color of the sphere's albedo and will be reflected across the sphere's surface normal. Light rays that bounce off of a rough surface will appear to reflect in a random direction due to its microfacet surface. The light ray's direction is then randomly offset by a factor of the sphere's material roughness. This introduced randomness to the ray direction causes noise in the rendered image. To mitigate this, we increase the number of samples per pixel and average the output color, similar to an accumulation buffer.


SOURCE CODE

All code related to this project can be found here. All information on how to run the program is located in the "How to Run" section of the README.

Leave a comment

Log in with itch.io to leave a comment.