This is a very basic raytracer and it is for learning purposes. This project is still in progress.
Used this library to make a thread pool CTPL.
- Modify
samples_per_pixelandmax_depthwith your prefered values, less values means better performance. - Modify
image_widthandaspect_ratiowith your prefered values. num_of_threadsis the number of threads in the pool, choose a suitable number (Default: All available)lines_per_threadis the number of lines that each thread should handle (line is just a single row of pixels of the image width)
to make the raytracer
make
to output the image, this redirects the program output to a file called image.ppm
make image
You can view the image using your any image viewer that supports ppm, if it doesn't support ppm below command to ouput a png image
make jpeg
- notice that this would make your CPU an inefficient heater, Mine got to 95C. and if you didn't use the optimizer it would take ages to finish.
Followed this guide Ray Tracing in One Weekend