Skip to content

My raytracing engine based off of the "Ray Tracing in One Weekend — The Book Series" by Peter Shirley, Trevor D Black, and Steve Hollasch - Link to the series here: https://raytracing.github.io/

Notifications You must be signed in to change notification settings

DylanTopic/RayTracer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stochastic Monte Carlo Ray Tracer

A physically based Monte Carlo path tracer written in C++, implementing global illumination, volumetric media, acceleration structures, and polygonal geometry from scratch.

Final Render


Project Overview

This project is a custom stochastic path tracing renderer designed to simulate realistic light transport using Monte Carlo integration. The renderer supports indirect lighting, participating media, emissive geometry, and complex scene construction.

While inspired by the Ray Tracing in One Weekend book series, this implementation extends beyond the introductory material by integrating additional geometry types, a full BVH acceleration structure, and volumetric effects.


Features

Geometry & Scene Representation

  • Spheres with analytic ray–sphere intersections
  • Triangle primitives using the Möller–Trumbore intersection algorithm
  • Quadrilaterals (quads) for walls, floors, and area lights
  • Instancing via translation and rotation transforms
  • Manually constructed meshes composed of triangle groups

Lighting & Materials

  • Global Illumination using recursive Monte Carlo path tracing
  • Diffuse (Lambertian) materials
  • Metallic materials with adjustable roughness
  • Dielectrics (glass/water) using refraction and Schlick approximation
  • Emissive materials for physically based area lights
  • Volumetric media (fog/smoke) via constant-density participating media

Textures

  • Image textures with UV mapping (e.g., Earth texture)
  • Procedural Perlin noise for marble and turbulence effects
  • Checkerboard procedural textures

Performance & Core Systems

  • Bounding Volume Hierarchy (BVH) for accelerated ray–object intersection
  • Motion blur via temporal ray sampling
  • High sample-count rendering with importance-driven recursion limits

Build & Run Instructions

Visual Studio (Recommended)

  1. Clone the repository.
  2. Open RayTracer.vcxproj in Visual Studio.
  3. Set configuration to Release.
  4. Build and run (Ctrl + F5).
  5. Output is written to image.ppm.

References

Ray Tracing in One Weekend

Ray Tracing: The Next Week

Command Line (g++)

g++ main.cpp -O3 -o raytracer
./raytracer > image.ppm

About

My raytracing engine based off of the "Ray Tracing in One Weekend — The Book Series" by Peter Shirley, Trevor D Black, and Steve Hollasch - Link to the series here: https://raytracing.github.io/

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published