This project is a CPU-based Ray Tracer written in Java, developed as part of a university computer graphics course.
It demonstrates the core principles of physically based rendering, simulating how light interacts with geometry and materials to create realistic images — all computed on the CPU.
The implementation focuses on clarity and modularity, providing a transparent look into the mathematics and algorithms that power modern rendering engines.
It supports both analytical primitives (like spheres and planes) and loaded OBJ models, each capable of being translated, rotated, and scaled using transformation matrices.
This renderer combines traditional ray tracing with modern features like Cook–Torrance shading, path tracing, and multithreaded performance to achieve visually accurate results.
-
Ray Casting through Each Pixel – Traces rays from the camera through every pixel to compute scene color contributions.
-
Intersection Tests – Detects intersections with basic primitives (spheres, planes), analytical objects and Constructive Solid Geometry (CSG) shapes.
-
Recursive Ray Bounces – Supports multiple ray reflections and refractions for realistic light transport.
-
Cook–Torrance Shading Model – Implements physically based microfacet shading with Fresnel and geometric attenuation.
-
Shadows – Calculates occlusion using shadow rays for both soft and hard shadows.
-
Anti-Aliasing – Reduces jagged edges using multi-sample stochastic supersampling.
-
Skybox – Provides background lighting and reflections when rays miss geometry.
-
Path Tracing – Performs global illumination for indirect light simulation.
-
Configurable Camera & Viewport – Adjustable field of view, aspect ratio, and position for flexible perspectives.
-
OBJ Model Rendering – Supports loading and rendering of complex 3D meshes from
.obj
files. -
Object Transformations – Each object can be translated, rotated, and scaled through matrix operations.
-
Image Output – Renders to an image buffer and exports to PNG.
-
Multithreading – Utilizes multiple CPU cores for parallelized, faster rendering.