Skip to content

tomsarry/tracer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tracer

A simple raytracer, based on Ray Trancing in One Weekend.

Requirements

  • cmake
  • g++
  • libncurses5-dev

How to Use

Either use the vscode tasks cmake and build or manually:

$ mkdir build && cd build
$ cmake ..
$ cmake --build .

Run the script using:

$ ./build/src/tracer > image.ppm
$ mogrify -format jpg *.ppm # optional

Updates

Book One

A single object in the scene.

01_sphere

Coloring the sphere based on the direction of the normal vector (first image is a bug).

02_chroma_bug 03_normal

Adding more objects to our world.

04_world

Adding anti-aliasing with 5, 10, and 50 samples for pixel, respectively.

05_samples 06_samples 07_samples

Adding a mate texture to our spheres with 10 and 100 samples per pixel, respectively.

08_diffusion 09_diffusion

Removing shadow acne.

10_shadow_acne

Improving light reflection by using a lambertian distribution.

11_lambertian_reflection

Applying gamma correction.

12_gamma_correction

Adding new materials: lambertian and fuzzy metal.

13_lambertian 14_metal 15_fuzzy_metal


Adding new materials: dielectrics and hollow glass sphere.

16_dielectrics 17_hollow_glass


Improving the flexibility of the camera.

18_improving_camera


Adding mate and shiny iridescent materials.

19_iridescent


Adding defocus blur to camera.

20_defocus_blur


Final scene of book one (took 24 minutes to render on 8 cores 🤡).

21_final_scene


First pass at creating a real-time rendered.

real_time_rendering


Animated camera to make real-time animations.

video


Precomputed frames assembled afterwards, with variying anti-aliasing.

video_dual video_dual2 video_dual3

Book Two

Bouncing spheres.

bouncing_spheres


BVH

For performance analysis, see perf.

About

A basic ray tracer in c++

Resources

Stars

Watchers

Forks