Ray Tracing in One WeekendPeter Shirley, Trevor D. Black, Steve Hollasch
Ray Tracing in One Weekend
by Peter Shirley, Trevor D. Black, Steve Hollasch · first published 2024
84mentions
48recommended by
65HN commenters
2016–2026first – last mentioned
74% recommend26% neutral
Why HN recommends it
Quick, hands-on route to writing your own ray tracer, starting from a program that just dumps pixels to an image file. Short, with light linear algebra and graphics; suits beginners and a fun weekend project.
Summarised by Claude from recommending comments
Affiliate links. As an Amazon Associate I earn from qualifying purchases.







If anyone is interested in getting started on Ray Tracing _today_. I recommend Peter Shirley's _Ray Tracing In One Weekend_ Series. https://raytracing.github.io/ (I edited the later editions)
on “Ray Tracing with POV-Ray: 25 scenes in 25 days (2013)” ↗If you want fun miniproject may I suggest Peter Shirley's excellent mini-raytracing bookseries: Ray Tracing In One Weekend, Ray tracing the next week, and Ray Tracing, the Rest of Your Life: https://www.amazon.com/Ray-Tracing-Weekend-Minibooks-Book-eb... If you get interested on rendering Matt Pharr & Co's Oscar winning…
on “Ask HN: Best way to learn modern C++?” ↗Check out Peter Shirley's book series, starting with Ray Tracing in One Weekend. It's about ray tracing, not path tracing, but it's a fun introduction to the broader topic. As for languages, I guess that depends on how long you are willing to wait for results. You might be able…
on “Photorealistic Path Tracer” ↗For a gentle intro to Ray tracing that is specifically geared for beginners, and lays a simple foundation for physically based rendering, I'll recommend Pete Shirley's mini-book Ray Tracing in One Weekend. http://in1weekend.blogspot.com/2016/01/ray-tracing-in-one-we...
on “Black Book of Graphics Programming, Special Edition (1997)” ↗How about ray tracing? Peter Shirley (whom I learned a ton from in grad school) wrote a trilogy of mini-books beginning with "Ray Tracing in One Weekend." https://github.com/RayTracing/raytracinginoneweekend
on “Build Your Own Text Editor” ↗…to understand than rasterization, it's easy to write your own simple ray tracer, and it relies almost entirely on the math. So I definitely recommend finding some tutorials for that. Peter Shirley's "ray tracing in one weekend" book is a popular one. You could also look into doing ray marching instead of ray tracing, which is slightly more complicated, but fundamentally the same, you can actually see them in realtime on most…
on “Ask HN: How to self-learn graphics programming?” ↗Mentioned elsewhere, there is also Peter Shirley's "Ray Tracing in One Weekend" series: https://raytracing.github.io/
on “Physically Based Rendering Book” ↗> If I want to write a ray tracer, well... Good bye life for a week or two. Lookup this book: Ray tracing in one weekend by Peter Shirley. You're in for a treat :-)
on “Leetcode has taught me that I'm a bad engineer” ↗Peter Shirley is a University of Utah guy right? His Ray Tracing in One Weekend series is brilliant
on “How the Computer Graphics Industry Got Started at the University of Utah” ↗Hence Ray Tracing in One Weekend by raytracing royalty prof. Shirley himself https://raytracing.github.io/
on “ZX Spectrum Raytracer” ↗Peter Shirely's Ray Tracing in One Weekend series (https://raytracing.github.io/) is a great way to learn enough about ray tracing to implement it yourself.
on “Ray Tracing Essentials, Part 1: Basics of Ray Tracing” ↗Here’s a fun way to decide. Do Raytracing in One Weekend[1] in one of them. Then rewrite it again in the other. That should give you a good sense for which one you want to invest in. Spoiler: I did this exercise myself. I found Rust to be more convenient in some ways. The Rayon crate made adding parallelism (threads) pretty easy. Some other crates made things pretty terminal output easier. C++ f
on “Ask HN: Learn C++11 or Rust in 2022?” ↗Seconded, his "Ray Tracing in One Weekend" is great. Simple, and so satisfying once you start producing images.
on “A minimal raytracer” ↗…Shirley > Almost 100% of smallpt is derived from this book. FWIW, Peter Shirley distilled all the fun parts of Realistic Ray Tracing into an easy quick e-book available for $3, or free with the trial. "Ray Tracing in One Weekend." https://www.amazon.com/gp/product/B01B5AODD8/ Blog post about it w/ more code & lots of resources: http://in1weekend.blogspot.com/2016/01/ray-tracing-in-one-we...
on “Smallpt: Global Illumination in 99 lines of C++” ↗This is a great resource! For those interested in a very quick and direct intro to writing code for ray tracing, something I think supplements Scratchapixel nicely, you might want to also check out "Ray Tracing in One Weekend". http://in1weekend.blogspot.com/2016/01/ray-tracing-in-one-we.... It's a $3 ebook on Amazon, but the blog post has lots of free resources including the complete code for the small ray tracer developed…
on “Scratchapixel: Computer Graphics Programming from Scratch” ↗