按年被提到
20192022 · 12 次2026
开源书›图形与游戏·No.42·简称 RTIOW

Ray Tracing in One Weekend

一个周末学光线追踪
Peter Shirley, Trevor David Black, Steve Hollasch

用 C++ 一个周末写出能渲染的光线追踪器

免费阅读 ↗
被推荐 · 49 人首次 2019-08-24 · 最近 2026-08-18许可证 CC0(公有领域)
49不同的人
36活跃月份
21有推荐的月份
50讨论串

Peter Shirley 等人用很短的篇幅,从输出一张图片开始,逐步实现光线、球体、材质、相机等,最终得到一个能渲染出带反射和折射场景的路径追踪器。代码用 C++ 写,但思路足够通用,可以换成其他语言实现。它是 One Weekend 系列的第一本,后面还有续作继续深入。以简短、增量式推进见长。

HN 为什么推荐它

HN 上的人认为它是从零入门图形学和渲染的最佳项目,篇幅短、很快就能在屏幕上看到结果,也常被推荐用来练习一门新语言。

难度 2 / 5约 12 小时开放许可
适合谁

想动手入门图形学和渲染的程序员

读之前最好知道
1C++ 基础
2向量运算
3基础几何

怎么读

由 Claude 根据这本书和 HN 上的说法整理,可能有错
  1. 1从头按章节写代码,每章都运行看效果
  2. 2不必拘泥于 C++,可以用熟悉的语言重写
  3. 3做完第一本再读后续两本,加入更多渲染技术
  4. 4需要理论补充时再查图形学教材

HN 书评

推荐在前,同类按时间 · 每本最多保留 20 条,统计用全部提及 · 作者本人贴的不算
强烈推荐percentcer · 2020-12

“Peter Shirley's "Ray Tracing in One Weekend" is probably the best zero-to-one introduction to graphics”

称它大概是最好的图形学从零到一入门
Hallucinations re: the rendering of Cyberpunk 2077原评论 ↗
强烈推荐jtanderson · 2021-02

“I'd also highly recommend Ray Tracing in One Weekend[1]”

强烈推荐它,只用一个 C++ 程序输出图像就能开始渲染
Computer Graphics from Scratch原评论 ↗
推荐eachro · 2020-02

“Ray Tracing in a Weekend is an incredible guide to work through to write a basic functioning ray tracer.”

称它是写出基础可用 ray tracer 的绝佳指南
Ask HN: What are some books where the reader learns by building projects?原评论 ↗
推荐mafm · 2020-02

“Ray Tracing in One Weekend series is a great way to learn enough about ray tracing to implement it yourself.”

称它能让人学到足够的 ray tracing 并自己实现
Ray Tracing Essentials, Part 1: Basics of Ray Tracing原评论 ↗
推荐carl_dr · 2020-12

“Check Ray Tracing In One Weekend out: Ray Tracing in One Weekend”

推荐它,能很快让 ray tracer 出图
More challenging projects every programmer should try原评论 ↗
推荐dagmx · 2021-01

“A good intro to rendering is reading Raytracing in a Weekend”

推荐它作为渲染入门读物
Pixar's Render Farm原评论 ↗
看全部 20 条 →
推荐d26900 · 2021-02

“Peter Shirley's one is nice too!”

补充推荐它,用来做一个简单的 ray tracer
Graphics Programming Weekly原评论 ↗
推荐dartmoose · 2021-04

“I’d recommend either Keenan Crane’s Discrete Differential Geometry course ((链接) and (链接)) or Peter Shirley’s Ray Tracing in a Weekend Series.”

与 Keenan Crane 的课程并列,推荐为简短有趣的图形学入门
Ask HN: What is the best free online course you completed?原评论 ↗
推荐psytrx · 2021-06

“Here's a great primer on that topic - it's still actively developed and made me look at modern ray tracing technology in awe.”

推荐它作为构建 ray tracer 的入门读物,仍在更新
Ask HN: Projects for learning a language?原评论 ↗
推荐fsloth · 2021-06

“Peter Shirley's free Ray Tracing series is incredibly good as well:”

称这套免费 ray tracing 系列极好,是学渲染数学的资源
Fluid Paint原评论 ↗
推荐thrower123 · 2021-09

“Peter Shirley's Ray Tracing in One Weekend book (and sequels) are also fun little projects”

推荐它作为学新语言时有趣的小项目
Ask HN: Books that teach you programming languages via systems projects?原评论 ↗
推荐t8y · 2022-01

“The book RayTracingInOneWeekend[1] is a good starting point for people looking to write a raytracer.”

推荐它作为想写 raytracer 的人的起点
Finding your home in game graphics programming原评论 ↗
推荐pixelpoet · 2022-01

“Ray Tracing in One Weekend, which is pretty good (IMO mostly on account of its brevity)”

称它不错,主要因为篇幅简短
Finding your home in game graphics programming原评论 ↗
推荐pfranz · 2022-01

“Ray Tracing in One Weekend - a basic raytracer that incrementally adds features”

推荐它,逐步加功能做出基础 raytracer
Finding your home in game graphics programming原评论 ↗
推荐tgflynn · 2022-03

“I can vouch for the first two as being good.”

为软件渲染教程列表担保,认为前两个不错
Introduction to GPUs with OpenGL原评论 ↗
推荐blenderdt · 2022-03

“I can recommend Ray Tracing in One Weekend [1]. Not only will you learn how to write a path tracer”

推荐它,能学会写带运动模糊和动画的 path tracer
Physically Based Rendering: From theory to implementation (2016)原评论 ↗
推荐going_ham · 2022-03

“The entire ray tracing in one weekend[1] series is really good book for getting into computer graphics.”

称整个系列是借简单 path tracer 入门计算机图形学的好书
Ask HN: Which book can attract anyone towards your field of study?原评论 ↗
推荐sk1pper · 2022-05

“Do Raytracing in One Weekend[1] in one of them. Then rewrite it again in the other.”

建议用它当项目,在两种语言里各实现一遍来比较
Ask HN: Learn C++11 or Rust in 2022?原评论 ↗
推荐erwincoumans · 2022-06

“Raytracing in a weekend is also useful:”

称它对学 3D 图形也有用
Source code for 4kb demoscene production “Elevated” released (2016)原评论 ↗
推荐rychco · 2022-09

“you might be interested in the "One Weekend" series [2], which is all C++ but is mostly general enough for other languages.”

推荐这个系列的后续各册,虽用 C++ 但思路通用
Ask HN: What is the coding exercise you use to explore a new language?原评论 ↗