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 454 forks source link

Option as a Parameter List? #455

Open Xaldew opened 3 weeks ago

Xaldew commented 3 weeks ago

In PBRT-v4, the "Option" keyword was introduced to set miscellaneous options. Typically, I have been able to treat all rendering options as parameter lists, but this particular one seems to break that pattern.

As far as I have been able to tell from the PBRT-v4 source code (pbrt/parser.cpp:877), it is only valid to set these sequentially, i.e.:

Option "string seed" [123]
Option "bool pixelstats" [true]

However, given that PBRT-v4 is still under active development, perhaps it would make sense to also support treating the options themselves as a parameter list? I.e., allowing something like this:

Option "string seed" [123] "bool pixelstats" [true]

Not sure that this would help in any specific regard, but it would at least allow treating the file format in a more unified way.

Also, is there any example files out there that actually use these options? I couldn't find any among the PBRT-v4 example scenes (https://github.com/mmp/pbrt-v4-scenes).