CPU Ray Tracer
Overview
- Period: October 2024
- Type: Personal project
- Objective: Implement a basic ray tracer that runs entirely on the CPU.
Implementation
- Implemented intersection tests for triangles, quadrilaterals, spheres, axis-aligned bounding boxes, cones, and cylinders.
- Implemented reflection, refraction, and shadow effects through ray tracing.
- Produced soft shadows by casting additional rays toward randomly sampled points around a light source.
- Loaded glTF files and rendered triangle-mesh data.
- Applied physically based rendering shading.
Result
Albedo: Triangle
Albedo: Rectangle
Albedo: Sphere
Albedo: AABB
Albedo: Cone
Albedo: Cylinder
Normal: Triangle
Normal: Rectangle
Normal: Sphere
Normal: AABB
Normal: Cone
Normal: Cylinder
glTF Model: Avocado
glTF Model: glTF Box
PBR Shading: Metallic = 0.0 / Roughness = 0.0
PBR Shading: Metallic = 0.0 / Roughness = 1.0
PBR Shading: Metallic = 1.0 / Roughness = 1.0
PBR Shading: Metallic = 1.0 / Roughness = 0.0
Ray Tracing Effects: Reflection-1
Ray Tracing Effects: Reflection-2
Ray Tracing Effects: Refraction-1
Ray Tracing Effects: Refraction-2
Ray Tracing Effects: Shadow-1
Ray Tracing Effects: Shadow-2
Demo: Fox
Demo: Tiger Statue (Hard Shadow)
Demo: Tiger Statue (Soft Shadow)
Demo: Chess (Hard Shadow)
Demo: Chess (Soft Shadow)