Monte Carlo Ray Tracer

Monte Carlo Ray Tracer

A ray tracer built for CSCE 441, Computer Graphics

Blinn-Phong vs Path Tracing

Blinn-Phong Ray Tracing

Blinn-Phong render

Monte Carlo Path Tracing

Path traced render

Bonus Features

Monte Carlo Path Tracing

Uses probability to create a more realistic image by averaging the results of many random paths.

GPU Acceleration

I am on a M1 MacBook Pro so I do not have ray tracing specific hardware acceleration. To achieve higher Monte-Carlo speeds, I implemented it as a fragment shader through OpenGL, using the GPU as my hardware acceleration.

SAH BVH

I've implemented BVHs before but mostof them have been top-down instead of bottom up.In this project I implement a BVH for both model space for narrow collisions and world space for broad collisions.

Antialiasing

Multiple ray casts per pixel leverage probability to mix the contributions of multiple objects in a single pixel.

Ambient Occlusion

Indirect lighting rays get trapped in tight corners creating darker spots while being able to escape to a light source when given more room.

Refraction

Utilizes Snell's law to calculate the angle of the refracted ray.

Texture Mapping

Uses a textured material system for albedo, normal, roughness, and metalness.

Area light sources

Lights are treated as objects instead of point lights, allowing for more realistic lighting. This is also required by Monte Carlo Path Tracing.

Light Attenuation

transmissive objects can use absorption and density to absorb specific light frequencies.

Boxes

simple OBBs with each face of the cube having full UVs