Integrator design in v3 vs. v4

61 views
Skip to first unread message

TheOwlforge

unread,
May 31, 2022, 9:40:15 AM5/31/22
to pbrt
Hello there,

looking at the new pbrt-v4, while having worked with v3 before, I noticed that in the new version all integrators were moved into a single file, with 3656 lines of code, whereas in the old version each integrator was written in it's own file. I was wondering what is the reason behind this design decision? And why were clean code principles like "one class per file" or "try to keep your files small" disregarded? With all due respect, for me it was just shocking to read through this massive file.

Thanks for clarifying!

Matt Pharr

unread,
May 31, 2022, 9:42:13 AM5/31/22
to pb...@googlegroups.com
On May 31, 2022, at 6:28 AM, 'TheOwlforge' via pbrt <pb...@googlegroups.com> wrote:

looking at the new pbrt-v4, while having worked with v3 before, I noticed that in the new version all integrators were moved into a single file, with 3656 lines of code, whereas in the old version each integrator was written in it's own file. I was wondering what is the reason behind this design decision? And why were clean code principles like "one class per file" or "try to keep your files small" disregarded? With all due respect, for me it was just shocking to read through this massive file.


It is certainly a trade-off. The benefit is faster compile times: https://pharr.org/matt/blog/2019/10/23/profiling-the-pbrt-build.

Matt

dcy665

unread,
Jun 1, 2022, 4:03:08 AM6/1/22
to pb...@googlegroups.com
Read your post. Good work overall, frustrating I am certain, as in: glad you had to do it, and not myself.

I wouldn't suggest using pre-compiled headers. I have had experience with them a few times, once was MSFT and that entire environment went nutty every now and then. Add a comment, won't compile. Remove the comment, still doesn't compile. Delete all prebuilt header files, add comment (cross your fingers) and ... compiles. As complex as C++ is these days, and how pervasive some of the STL functions are - well, do you have access to an intern?

Good Luck, and Great Work


--
You received this message because you are subscribed to the Google Groups "pbrt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pbrt+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pbrt/3D479809-5000-409A-A936-6CB5996DC6B6%40gmail.com.
Reply all
Reply to author
Forward
0 new messages