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.89k stars 457 forks source link

using --pixelstats in conjunction with --outfile do not work as expected #414

Open fvandw opened 9 months ago

fvandw commented 9 months ago

When rendering --pixelstats with an --outfile option, pixelstat images filenames seem to be over-sanitized.

Example: rendering to a destination subfolder

~/pbrt/build/pbrt ../pbrt-v4-scenes/bmw-m6/bmw-m6.pbrt --pixelstats --spp 4 --outfile bmw/bmw-m6-spp4.exr correctly renders the output image to a bmw-m6-spp4.exr file in the subdirectory bmw. However, the pixelstats images are rendered in the current directory under the name bmw_bmw-m6-spp4-[pixelstat name].exr

It gets even worse if the destination file name starts with ./: ~/pbrt/build/pbrt ../pbrt-v4-scenes/bmw-m6/bmw-m6.pbrt --pixelstats --spp 4 --outfile ./bmw/bmw-m6-spp4.exr produces a (hidden) stat image named ._bmw_bmw-m6-spp4-[pixelstat name].exr in the current directory

Also, a pixelstat named with a string containing a space character lead to an output file between quotes, eg. a "dummy name" pixel stat is rendered in a 'bmw-m6-spp4-dummy name.exr' file

pbrt4bounty commented 1 month ago

I found this issue here too. Try to investigating a bit..