https://github.com/gpsnoopy/raytracingthenextweek
Implementation of Peter Shirley's Ray Tracing The Next Week book.
https://github.com/gpsnoopy/raytracingthenextweek
Last synced: about 1 year ago
JSON representation
Implementation of Peter Shirley's Ray Tracing The Next Week book.
- Host: GitHub
- URL: https://github.com/gpsnoopy/raytracingthenextweek
- Owner: GPSnoopy
- Created: 2019-03-14T17:33:42.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-10-29T22:02:50.000Z (almost 7 years ago)
- Last Synced: 2025-04-20T01:21:34.058Z (over 1 year ago)
- Language: C++
- Size: 3.82 MB
- Stars: 12
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ray Tracing The Next Week

My take on [Peter Shirley's Ray Tracing The Next Week](https://github.com/RayTracing/raytracing.github.io) book. This is the second book in his *Ray Tracing In One Weekend* series. My take on his first book is available [here](https://github.com/GPSnoopy/RayTracingInOneWeekend).
On top of my own programming style, I have added:
* Multi-threading support.
* Optimizing AABB ray intersection by removing conditional branches (this runs faster on any modern processor).
* Building the BVH tree using `depth%3` splitting rather than random one (this seems to run faster in my case).
* Using SSE and AVX instructions for implementing the Vec3 class.
The Earth texture was found on [NASA's The Blue Marbe](https://visibleearth.nasa.gov/view.php?id=57735).
## Building
Visual Studio 2019 project files provided as-is. Use `build_linux.sh` for a GCC build, be sure to change the `-march=skylake` to match your processor.
## Performance
The cover picture was rendered in about 26h running 14 threads on a Core i9-9900K @ 4.7GHz at 3840x2160 with 65536 samples per pixel. I've used [GIMP](https://www.gimp.org/) to open the resulting PPM image and convert it to more standard formats such as PNG and JPEG.
For best performance, I recommend the Linux build even on Windows (I've used Ubuntu 18.04 running via [WSL on Windows 10 1809](https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux)). For some reason, GCC (7.3) seems better at generating AVX FMA instructions than Visual Studio 2019 (16.3) on this code.