What does HackerNews think of pbrt-v3?

Source code for pbrt, the renderer described in the third edition of "Physically Based Rendering: From Theory To Implementation", by Matt Pharr, Wenzel Jakob, and Greg Humphreys.

Language: C++

Once you finish the main book, there's a few free bonus chapters provided [1] that help you implement soft area lights, bounding boxes (AABB in this case), and texture mapping. Beyond that, you might be interested in the "One Weekend" series [2], which is all C++ but is mostly general enough for other languages. There's also PBRT [3] which is an open source textbook/documentation for the pbrt-v3 renderer [4], but this is beyond the scope of "small exercise" territory. Good luck!

[1] http://www.raytracerchallenge.com/#bonus

[2] https://raytracing.github.io/

[3] https://pbr-book.org/3ed-2018/contents

[4] https://github.com/mmp/pbrt-v3

The full text is available here: http://www.pbr-book.org/

The source is available here: https://github.com/mmp/pbrt-v3/

The latest text has an additional author: Wenzel Jakob

This codebase won an Oscar:

https://pbrt.org/

https://github.com/mmp/pbrt-v3

That said, IMHO, there is no "clean" C++ code. There are C++ codebases that use different styles, and their "quality" more or less is context sensitive.

Personally I felt the best tutorial to C++ were actually two other programming languages - Scheme and F#.

Scheme drove in the concept that it's totally fine to model things based on the shape of the data and that you don't need to create type based abstractions around every thing.

F# then demonstrated how a language with type system is supposed to work.

The problem with C++ is that the language is so verbose that unless you have an abbreviated model in your head how a type based language can be used to solve problems in best way, you will get lost in trivial C++ minutiae.

So, personally, I generally think "Am I solving a Scheme like problem or Standard ML like problem" and then try to apply C++ as simply as possible.

Several academics have created a career of how to patch C++/Java/C# with concepts that make them less fragile in a collaborative context:

https://en.wikipedia.org/wiki/Design_Patterns

https://www.amazon.com/Design-Patterns-Elements-Reusable-Obj...

In my opinion design patterns are not a fundamental concept, but rather provide common syntax for collaboration purposes for various patterns that are parts of language and more or less invisible in e.g. Scheme or F#. But if one is diving into C++ it's probably convenient to be familiar with these concepts.

If you want to learn more, the best raytracing book is http://www.pbrt.org/ which goes into immense details about various techniques and won an Academy Award. The renderer described in the book is also available online: https://github.com/mmp/pbrt-v3
+1 on PBRT - great textbook, and a full program to boot.

Though they don't use the batching method outlined in the video - it would be interesting to see PBRT modified to do it and compare the resulting efficiency in rendering.

https://github.com/mmp/pbrt-v3/