Skip to content

A basic cuda path tracer, based on the concepts in Peter Shirley's "Ray tracing in one weekend" https://raytracing.github.io/books/RayTracingInOneWeekend.html

License

Notifications You must be signed in to change notification settings

vshotarov/death-star

Repository files navigation

Death Star

A basic cuda path tracer, based on the concepts in Peter Shirley's Ray Tracing In One Weekend. The only dependency is tinyobjloader for loading wavefront .obj files.

The approach I've taken is more or less identical to what Peter Shirley describes, but I have had to make small adjustments, in order to make the code appropriate for running on the GPU, such as avoiding virtual functions (and inheritance in general) and using the Parallel BVH as proposed by Tero Karras, rather than the recursive one described by Peter Shirley in Ray Tracing, The Next Week.

This project was done (and unfortunately redone many times) as a part of my ongoing research into parallel computing and general computer graphics. Even though, it has incredibliy limited capabilities, I consider it complete as I feel that going deeper into BRDFs, lights, textures, etc. would be a massive undertaking with a disproportionate reward, so the only addition I might look into in the future is the OpenGL or Vulkan interoperability.

Here is the image that you get as an output if you run the current version of this repo. It is still noisy, as I ran it with 50 samples, a maximum of 25 bounces and a resolution of 1000x500, which took 30m19.357s

The following are images I've stored in a sort of chronological order. Prepare to see a lot of spheres

Visualizing normals

Visualizing normals - Random spheres and triangles

Visualizing Ambient Occlusion - Random spheres and triangles

Visualizing Ambient Occlusion - Two spheres

Metal material

Metal material with colours (albedo)

Visualizing metal fuzzy reflections

And some wavefront .obj models (I don't have a good answer as to why did I use stupidly ugly low res sphere and cube that intersect the floor for testing)

Dielectric material and first loaded wavefront .obj files

Positionable camera

Defocus blur

And then the obligatory "Ray tracing in one weekend" images, with some .obj additions

I am not really a Star Wars fan, but for some reason it was the first name I thought of in regards to shooting rays.