Hacker News new | past | comments | ask | show | jobs | submit login
4th edition of Physically Based Rendering is now freely available online (pbr-book.org)
330 points by mariuz on Nov 2, 2023 | hide | past | favorite | 52 comments



The big update of the 4th edition over the third is the addition of a chapter about GPU rendering: https://pbr-book.org/4ed/Wavefront_Rendering_on_GPUs#chap:gp...

The difference are stated in the preface: https://pbr-book.org/4ed/Preface


> GPU rendering: This version of pbrt adds support for rendering on GPUs, which can provide 10–100 times higher ray tracing performance than CPUs. We have implemented this capability in a way so that almost all of the code presented in the book runs on both CPUs and GPUs, which has made it possible to localize discussion of GPU-related issues to Chapter 15.

Wow. Now getting more intrigued.


Now with SYCL and CUDA supporting most C++ proper, using it instead of shading languages is starting to be a thing.

Although I do think shading languages are still more appropriate, or other kind of more high level modelling.

In any case as long there is a toolchain to generate SPIR-V or PTX, there is a way for the favorite language into the GPU.


This goes in waves, McCool and that group were seeking ways to get "normal" c++ into the mix in 2001 or so, very early on for shaders.


Yeah, TI also had a C compiler for the TMS34010.


With the way rendering is going (see alan wake 2 / nvidia's ray reconstruction), it will not take long, maybe a decade, before all rendering is done entirely by AI.


> all rendering is done entirely by AI

What does this even mean? Each frame will be associated with some declaration of the contents of the scene and AI will just estimate the render without involving a physically-based rendering pipeline?


Unfortunately that might affect all of us, not only graphics rendering.

We will then be reduced at software architects advising AI minions.


I don't know much about 3D graphics and rendering. Oddly enough, I first learned about PBR when I heard that Metroid Prime Remastered for Nintendo Switch used PBR and still achieved 60fps, which is apparently an incredible feat for the platform.

But to help put it into perspective, can someone briefly explain what PBR brings to the table that last-gen rendering stacks in games failed to do? Also, was there a former widely-used standard akin to PBR, or was it more of a free-for-all? I'd love to have an entry-level understanding of how things changed for the gaming/real-time graphics industry with the onset of PBR.


PBR is not really a new rendering stack or a new framework, but a way of thinking about the asset creation process and shader development that allows for more of a separation between material models and lighting. There were a few things associated with the PBR trend that do not have anything, strictly, to do with PBR, but came along for the ride and helped things:

* The recognized importance of specularity in materials, outside of the ones that are obviously shiny. Something something, everything has fresnel. Look at your wood desk, or your matte walls, and you'll notice you'll see some glossy reflections on them.

* We switched away from art workflows that generated normal maps out of Photoshop filters, and towards programs and workflows that kept a much better idea of 3D-ness throughout the stack. Substance Painter, Substance Designer, and baking normal maps from ZBrush are a huge and understated part of the PBR transformation.

* We changed around our terminology, and put more floorboards underneath the rugs. e.g. in the before times, if you had a material that was "unlit", it probably just displayed as the diffuse color texture, and nothing else. That doesn't make sense, that's the reflectance properties of the material. So we changed things around to be lights-first, and a lot of things fell into place from that. Together with that, basic kinds of global illumination started becoming more and more mainstream through probes.

* We redesigned lighting and shading models to use more physics in them. Out went the observational Phong and Blinn-Phong, and in came the more empirical Trowbridge-Reitz and GGX. We fixed lights to have accurate inverse-square-law falloffs. We replaced (or are in the process of replacing) point lights and spotlights with area lights. And GI became a reliable tool.

Before the PBR revolution, things were far more scattershot, though there were definitely attempts at trying to integrate physics. Half-Life 2, Unreal 3, and Halo Reach might not have strictly been "PBR" by modern standards, but definitely had a lot of good ideas floating around it with regards to lighting.


tiny nitpick: I think there was no "unreal 3" game, only 1 and 2



So PBR has become the default in the industry since starting around 2009 but really took off around 2013 - 2014. It was adopted because it could represent a larger range of physical surfaces then previous models while looking more consistent and being easier to understand [0]. Before then most 3d games either used Phong or Blinn-Phong [1] but they were hard to control for artists and they didn't really represent many materials very well.

[0] https://marmoset.co/posts/physically-based-rendering-and-you...

[1] https://en.wikipedia.org/wiki/Blinn%E2%80%93Phong_reflection...


> So PBR has become the default in the industry since starting around 2009 but really took off around 2013 - 2014

I think Disney's publication of their Wreck-it-Ralph movie + papers, showcasing that a singular shader created all the different characters of that one film, really took PBR to the mainstream.

https://media.disneyanimation.com/uploads/production/publica...

A highly popular movie that showcased the methodology, as well as published papers on the subject to scientific journals really hammered the point home. This was a new paradigm shift and far easier to think about than earlier models.

> We deployed our “Principled Layers” shader on Wreck-It Ralph and used it on virtually every material except for hair (which still uses the model developed for Tangled).

A statement like this from Disney is truly a mic-drop moment. Especially given how impressively diverse the characters were from Wreck-It-Ralph.

Wreck-It-Ralph was 2012. So pretty close to your timeline. (Especially if we consider that it takes time for people to see the movie, read the papers, think about the situation and realize that a paradigm shift just happened).


My understanding is that in the past you could try to make some random shader and tune it to make it look good/real in some condition, but then it will not look good in other conditions. With PBR you take more complex shaders, but they are based on real physics, and they will look good in almost all conditions.


Hallelujah, the 2nd rendering bible (after Veach's thesis of course)! Greetz to Matt, he's lurking around here I think :)

Like every other rendering dev shop we've had a book on every table since it came out in print, but the digital version is still great for quick reference at the PC.


Veach thesis was truly years ahead.



Alternatively, it was exactly in its natural time. It just takes time for a) an academic discipline to absorb and reflect on ideas and b) industry to adapt


veach thesis gives me "damn I wish I could read" moments


I read the first and second editions. Best technical books I've read by far, very nice blend of explaining the math but also showing how to implement it. So many books skip the latter, and it's often not straight forward.

Think the literal programming style worked very well for this.


Do you mean "Literate" programming style?

http://literateprogramming.com/


Yep in a hurry and on the fly.Thanks!


https://mastodon.social/@mattpharr@mastodon.gamedev.place/11...

Happy to report that the full contents of the 4th edition of Physically Based Rendering are now freely available online: https://pbr-book.org/4ed/contents


Related. Others?

Physically Based Rendering: From theory to implementation (2016) - https://news.ycombinator.com/item?id=30714104 - March 2022 (36 comments)

Physically Based Rendering Book - https://news.ycombinator.com/item?id=27855145 - July 2021 (44 comments)

Show HN: Physically Based Rendering – Online Edition - https://news.ycombinator.com/item?id=18219296 - Oct 2018 (42 comments)


I purchased the paper version :-)

There is for me a special connection between this book and https://www.amazon.com/Advanced-Animation-Rendering-Techniqu... - in the way they connect to the underlying knowledge in a deep way.

This topic is such a sweet rabbit hole to me!


I love the Watt and Watt "Advanced Animation and Rendering Techniques" book as well; it was IMHO the best book on those topics in its time.


I'm quite emotional about you writing this :-) Thanks for your work, it's really high quality in the same spirit!


I am especially intrigued by how this book so effortlessly combines prose and code. It looks like literate programming, but the source code on GitHub doesn't appear to have those annotations. Does anyone know what software was used to make the book, and how it relates to the GitHub sources?


In the book it explains that it is a homegrown tool. It’s likely secret sauce they do not release publicly.


A very worthwhile book, thanks for making it available to everyone.


Fantastic to see that this edition shifts away from an RGB model to spectral rendering. I hope every renderer follows suit!


Pretty sure the 3rd edition already contained that, no? At that time (not sure if that's still the case now) the choice was a compile time option, iirc.


2nd edition did as well...


In the 4th edition, there's no support for RGB rendering--it's always and only spectral.

And admittedly the spectral rendering option in earlier editions wasn't great. We didn't always correctly distinguish between illuminants and reflectances, used a fixed binning of wavelength ranges (vs stochastically sampling wavelengths), and had a fine-but-not-state-of-the-art RGB -> Spectrum conversion algorithm. All of that is much better / state of the art in the 4th edition.


Nice work! This was a (small) wart in previous.

It's a great text, and remains one of my go-to examples when someone asks for examples of well executed technical book.

I was only ever peripherally involved in this area as a but found myself revisiting the origin just because it was put together so cleanly.


Oh, thanks a lot for the clarification! And thanks for the work on the book in general. :)

I need to look into the changes then. The spectrum implementation of the 3rd version served as inspiration for an X-ray raytracer I've been working on.


I've had a quick look in spectrum.cpp, but can't obviously find it: what uplifting method are you using now?

Is it something similar to Wenzel and Jo's one, or Alex Wilkie's Sigmoid variation?

Edit: ah: RGBSigmoidPolynomial...


Does any open source package like Blender support spectral rendering? Want to render dichroic glass :)


For Cycles, it’s in the works but it will take a while.

You can use LuxCoreRenderer with Blender, though!


How do you deal with materials in a spectral renderer? Use something like a gaussian for each rgb component?


English is not my native tongue. Shouldn't it be "physics based" and not "physically based"?


The ship has sailed on this term of art, but as a native English speaker, I agree with you that it's ungrammatical. I would use a hyphen, though: "physics-based." This answer agrees with you (and me): https://english.stackexchange.com/a/428679.

Here's one way to think about _why_ it sounds wrong. "Physically based" would mean that "physically" is the answer to the question "How is it based?" To a native English speaker, that question sounds odd. A more natural question is "What is it based on?" To answer that question, you need a noun: "It's based on physics." Hence the construct "physics-based," like "evidence-based medicine" or "merit-based scholarships."


Firstly, "physically based rendering" has become a term of the art. This means that today, it's correct to use it to mean this specific thing no matter what the grammar rules say about the phrase. Furthermore, another phrase that would mean the same thing and is grammatically correct (like "physics based rendering"), is less correct in this context because it loses the specific meaning attached to the term of the art.

Secondly, "physically" is an adverb. This means it is grammatically correct for it to preceed "based" if used as a verb. If "based" could only be used as an adjective, then you're right, "physics based rendering" would be more correct.

Anybody more knowledgeable feel free to correct me!


I just looked it up, adverbs can modify adjectives. Physically Based is definitely correct here.


e.g. needlessly verbose writing

incredibly entertaining movie


It should be "physically based" since it's about rendering based on how light works physically, in the real world. See https://en.wikipedia.org/wiki/Physically_based_rendering


English is my native tongue, but it doesn’t really help analyze this type of thing. Titles often use terms-of-art and shortened phrases.

But, fwiw, to my eyeballs “Physics based rendering techniques,” because it uses the word Physics, as in the whole big field of study, looks like it is a Physics text that happens to include a bit of rendering.

“Physically based rendering techniques” seems like it is a work about rendering techniques, which will draw a lot from physics.


Oh wow I wish I knew about this book five years ago. I learned some of this stuff the hard way. This is priceless.


Woot, gonna go through this :D


It's a great book and I'm happy to see it get attention, but this was previously posted at https://news.ycombinator.com/item?id=38106860


That didn't get any attention, otherwise the dupe detector would've come into play.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: