Skip to content

An exploration into ray tracing and SIMT programming using C++ and the CUDA toolkit

Notifications You must be signed in to change notification settings

jayrabjohns/raytracer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ray tracing

Based on: Ray Tracing In One Weekend

Local Setup

  1. Install cmake, a C++17 compiler, and the CUDA toolkit v12.1
  2. Build the project.
    cmake -DCMAKE_BUILD_TYPE=Debug -B out/build
    cmake --build out/build --config Debug
    Or replace Debug with Release if you want a release build
  3. Run the project.
    ./out/build/raytrace
  4. Alternatively, if you're using VS Code, there's quite a good cmake extension you can use for bulding and running the project.

Discalimer

The CUDA SDK is tightly coupled system type and hardware specifications, meaning there is no guarantee of this project working on platforms which it hasn't been explicitly tested.

The project has been tested on Ubuntu 22 with an Intel CPU, and a Geforce 1660ti.

If the project is incompatible with your machine, or if you'd prefer not to download the CUDA sdk, this project also contains an implementation for running on the CPU, which should hopefully be more consistent across platforms.

Renders timeline

9. Big Scene

Loads of spheres

8. Defocus blur

Defocus blur

7. Dielectrics (refraction)

Glass ball

6. Fuzzy metals

Fuzzy metal material

5. Shiny metals

Metal material

4. Diffuse materials

Diffuse material

3. Shading geometry with surface normals

Shading normals

2. Adding geometry

Adding geometry

1. Creating an Image

Creating and image

About

An exploration into ray tracing and SIMT programming using C++ and the CUDA toolkit

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published