Skip to content

Jabolol/raytracer

Repository files navigation

raytracer

This project is a raytracer written in C++. The goal of this project is to implement a raytracer that can render scenes with spheres, planes, lights... The raytracer supports features such as translation, rotation, and drop shadows. The raytracer outputs the rendered image to a PPM file.

development

  1. Clone the repository.
git clone git@github.com:Jabolol/raytracer.git .
  1. Create a build directory.
mkdir build && cd build
  1. Build the project.
cmake .. -GNinja -DBUILD_DOC=OFF -DBUILD_TEST=OFF
  1. Run the raytracer with a provided scene.
./raytracer --config ../scenes/cornell.cfg > cornell.ppm

features

must

Tip

The config file can be found at config/must.cfg

  • sphere
  • plane
  • translation
  • directional light
  • ambient light
  • flat color
  • add primitive to scene
  • set up lighting
  • set up camera
  • output to ppm

should

Tip

The config file can be found at config/should.cfg

  • cylinder
  • cone
  • rotation
  • drop shadows

could

Tip

The config file can be found at config/could.cfg

  • multiple directional lights (0.5)
  • colored lights (0.5)
  • transparency (0.5)
  • reflection (1)
  • refraction (1)
  • texturing from file (1)
  • texturing from procedural chessboard (1)
  • texturing from procedural perlin noise (1)
  • import a scene in a scene (2)
  • set up antialiasing through supersampling (0.5)
  • space partitioning (2)
  • scene preview using a fast renderer (2)

bonus

Tip

The config file can be found at config/bonus.cfg

  • quad box
  • motion blur
  • depth of field
  • quadrilaterals
  • constant medium (fog)
  • tinted dielectric

cornell box

Tip

The config file can be found at config/cornell.cfg

Languages