Skip to content

krispy-snacc/cpp-ray-tracer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌟 C++ Ray Tracer

Welcome to C++ Ray Tracer – a modern, multi-threaded ray tracing engine written in C++. This project is designed as a learning tool: experiment with materials, build your own scenes, and discover the fundamentals of computer graphics, one pixel at a time!


Example Output

Rendered Example


Features

  • Physically-based rendering: Realistic lighting, reflections, and refractions
  • Multi-threaded: Fast rendering using all your CPU cores
  • Modular design: Easy to extend with new objects and materials
  • Gamma-corrected output: Images look great on any display
  • PNG export: High-quality output via stb_image_write.h

Quick Start

Build

mkdir build
cd build
cmake ..
make

Run

./bin/MyRayTracer

Project Structure

include/   # Header files (Vec3, Color, Scene, etc.)
src/       # Source code
bin/       # Compiled binaries
build/     # Build artifacts

How It Works

  • Rays are cast from a virtual camera into a 3D scene.
  • Objects (like spheres) are intersected, and materials determine their appearance.
  • Lighting, shadows, and reflections are computed recursively.
  • The final image is written to a PNG file.

Credits

  • stb_image_write.h by Sean Barrett
  • Inspired by Peter Shirley’s "Ray Tracing in One Weekend" series

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published