Skip to content

TechSupportSparky/SDL_RayTracer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multithreaded Ray Tracer with SDL

This project is my version of the "Ray Tracing: In a Weekend," and "Ray Tracing: The Next week," course. The raytracer itself follows much of the design of the book, however I've swapped from writing to a PPM file (as my write speeds are rather slow) over to using SDL for rendering. I've also utilized a few modern C++ techniques such as parallelizing the main render loop using std::execution::par to distribute work across all available CPU cores.

Building

SDL2 is included in the repository under SDL2-2.26.5/, so no manual setup is required. Simply clone the repo, open the solution in Visual Studio, and build.

Renders

This was the final render utilizing a sample size of 10,000 (vectors per px), and a max bounce of 50. This was a showcase of all features learned thus far for lambertian, metallic, dielectric, and diffuse materials. Constant medium isotropic fog to cover the scene as well as its interactions with light. Reflective, refractive, and absorption of color data. Texture wrapping on a spherical shape with dynamic scaling. As well as a Bounding Volume Hierarchy to speedup runtime: FinalRender

This image was with a very low sample size and bounce for a fairly quick write speed (<5 minutes). Metallic and lambertian objects reflect the correct amount and a depth of field effect is applied to objects far away: LowerSample

This image was utilizing a much larger sample size of around 500 (vectors per px) and a bounce of around 200. This led to a bit of color bleed where even lambertian objects appeared mirror-like. This is far from ideal as it does not appear normal, however it is an interesting effect nonetheless! BallRender

Repeated sin wave texture mapping to the ground:

SmallTexture

Perlin noise with no background and a light source:

PerlinWithLight

Not a showcase of the raytracer itself, however a neat result of turning the sample size down very low on the final image render. This was a sample size of 2 (vectors per ppx) and a max bounce of 2. Overall render took less than a minute: LowSampleFinalRender

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages