genBSDF reduced Klems

Hi all,

I am running some convergence studies with genBSDF using different raytracing parameters.

I was wondering if there is a way to use the function with a reduced Klems resolution (e.g. 1/4) to speed up the iterations over different raytracing parameters.

Thanks in advance for your feedback,


Hi Valeria,

while rfluxmtx (which is doing the work behind genBSDF) supports half and quarter Klems resolutions, it is not implemented in genBSDF.
To really adapt genBSDF, you would need to replace all appearances of “kf” in genBSDF with “kq” or “kh”. This would take care of generating the correct matrices. However, also “wrapBSDF” needs to be adapted then to correctly write the data into an XML file then.
If you are fine with just having the data matrices (without having it put into an XML file), you might just use rfluxmtx directly. This offers the possibility for Klems full/half/quarter.

I hope this helps?


Hi Valeria,

I would be afraid to tinker with genBSDF myself without further testing, but there is another way, which is to pass the XML output to bsdf2klems, which supports half- and quarter-resolution output. It simply resamples the matrix, giving more or less the same result.

Another thing I would mention is that, depending on your ray-tracing tests, BSDF resolution may not matter to the computation time. What are you doing with the XML file(s)?