Skip to content

leonmavr/freestyle_raytracer

Repository files navigation

freestyle_rt_cpp

My first fully working ray tracer running on the CPU.

C/C++ CI

Features

  • Phong lighting model (embient, diffuse, specular light).
  • Shadows
  • Reflection
  • Refraction
  • Various shapes (sphere, block, etc.)
  • Texture mapping on blocks
  • Moving camera

Build (using Make)

  • A C++ compiler supporting C++17
  • GNU Make

Build and clean commands:

# build the demo executable
make
# remove build artifacts and the executable
make clean
# clean then build
make rebuild

You can run the executable from the project root as follows.

./demo

The output will be written in a .ppm file, as defined in src/main.cpp.

Gallery

Output 1 Output 2
Output 1 Output 2
Output 3 Output 4

References

  1. Gambeta's book
  2. refraction - de Greve
  3. Fresnel equations derivation
  4. Pfister's slides

About

Simple, straightforward, but fully-featured ray tracer from scratch on the CPU in C++17.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published