mmp / pbrt-v4

Source code to pbrt, the ray tracer described in the forthcoming 4th edition of the "Physically Based Rendering: From Theory to Implementation" book.
https://pbrt.org
Apache License 2.0
2.87k stars 448 forks source link

Imgtool denoise looks for variance channel with wrong name. #300

Closed Kerdek closed 1 year ago

Kerdek commented 2 years ago

Recent pbrt-v4 gbuffer outputs contain channels named "Variance.R" etc, but imgtool can't find them because it's looking for a channel named "rgbVariance". I tried to patch this but I'm not sure if it's right because i don't know if the denoise filter looks at all three channels correctly.

Also wishlist item: some file format that just records each sample at the sensor, no bucketing. Resumable renders.

<3

Kerdek commented 2 years ago

have a cat scene

pbrt4bounty commented 2 years ago

You are right. I found the same error that you meant using denoise. I made a small test and with a small change this is fixed now. Let me create a pull request for @mmp Cheers..

pbrt4bounty commented 2 years ago

After a few bad attempt to create a patch, now is ready. @mmp , As @Kerdek says, the channel names are different when is created into film.cpp file: https://github.com/mmp/pbrt-v4/blob/master/src/pbrt/film.cpp#L703 and how is called from imgtool.cpp file: https://github.com/mmp/pbrt-v4/blob/master/src/pbrt/cmd/imgtool.cpp#L2427 This pull request fix this difference and avoid the error from denoise about missing 'rgbVariance' channels. Cheers..

mmp commented 1 year ago

Thanks for the PR, @pbrt4bounty !

And, @Kerdek, wishlist items noted!