Combining BSDF files using rmtxop and wrapBSDF

Hi BSDF experts,

I need a simple method for combining BSDF files (No inter-reflection. Only Transmission Front).
So I found this solution in here.

As @Greg_Ward suggested I can use this command:

rmtxop -fa -c .27 .67 .06 interior_layer.xml -c .27 .67 .06 exterior_layer.xml | getinfo - | wrapBSDF -W -c -a kf -tf - -f “m=Maker;n=Name;t=10” -u centimeter -C “Combined from interior_layer and exterior_layer” > combined.xml

My question is:

  1. Does rmtxop by default take values from block “Visible”, “Transmission Front”? What if my xml file contains more blocks and I want to get other blocks e.g. “Solar”, “Transmission Front” to be multiplied?
  2. My xml files (mainly from Complex Glazing Database (CGDB)) doesn’t have RGB color. would it be fine to use this option -c .333 .333 .334 (equally) for rmtxop?

Thank you in advance.

Hi Fazel,

If both “Front Transmission” (going from outside to inside) and “Back Transmission” are available, rmtxop will prefer the “Front Transmission” matrix. Otherwise, the “Back Transmission” matrix will be used after reversing its direction using reciprocity. Only “Visible” data will be used in either case. If your data does not have color information, as in most cases, then the coeffeicients you use for the -c option do not matter, except that they should sum to 1.0.

Thanks for the quick respond.

So here is another question. If I take care of the final xml file data structure (for WINDOW) by myself, would it be possible to just use simple matrix product?
Tf BSDF1 X Tf BSDF2 = Tf Combined

Is there any need to duplicate the wrapBSDF -c option (Lambda) procedure?

You can use the matrix straight out of rmtxop in another matrix calculation, such as dctimestep or rmtxop. You don’t need to put it back into an XML file using wrapBSDF unless you intend to use it in a rendering process.

1 Like

Hi @Greg_Ward,

I am confused about how rmtxop multiplies the BSDF matrices.
I try to do the same thing with numpy but the results of matrix multiplication from rmtxop doesnt help me to understand the calculation method.

So, I made an Identity matrix (I.xml) and a all-ones matrix (1.xml) in “visble”, Transmission Front" block in the xml files. And I have tried to understand how lambda values are applied and what is the shape of this lambda matrix? (145X1) or (diagonal Lambda145X145)?
I used the commands bellow
rmtxop -fa -c .333 .333 .334 I.xml > diagonalLambda.out
rmtxop -fa -c .333 .333 .334 I.xml -c .333 .333 .334 I.xml > IXI.out

*and in python it gives me the same resultant matrix (IXI).
I = np.identity(145)
IXLamb =np.matmul(diagonalLambda_145X145,I)
IXI = np.matmul(IXLamb,IXLamb)

But I am not able to replicate the same results for unity matrix:

*in Radiance:
rmtxop -fa -c .333 .333 .334 1.xml -c .333 .333 .334 1.xml > 1X1.out

*and in python…

1XLamb =np.matmul(diagonalLambda_145X145,all_one)
1X1 = np.matmul(1XLamb,1XLamb)

you can find the files in here:

In general, is the method A correct to combine 2 BSDF files? Or B?


Your answers would be really appreciated.
Thanks, Fazel

Hi Fazel,

I am guessing that you are missing the fact that loading an XML file is not the same to rmtxop as loading a matrix file. In the case of a BTDF (XML) file, each matrix element gets multiplied by the corresponding solid angle for the incident patch to arrive at a flux coefficient.

A 100% diffusing Lambertian transmitter (which I believe is impossible BTW) would have BTDF values of 1/pi (0.3183 or so) for every entry. This would get converted to the receiving patch solid angle over pi when loaded in rmtxop.

A 100% specular transmitting surface (air) would have a diagonal matrix where each entry is equal to the reciprocal of the receiving patch solid angle. When loaded into rmtxop, these coefficients would then be multiplied by the patch solid angle to get the identity matrix.

If you give rmtxop a straight matrix rather than an XML file, then it is assumed that the coefficients correspond to flux transfer rather than BTDF values.

I hope this makes sense.

Thank you Greg.
I got it. Loading and interpreting the transmission matrix (from XML files) in rmtxop was in fact my confusion.

Hi Fazel, long time no see!

Which command did you end up using for combining two BSDFs?

1 Like

Hi Mathias,

Happy to see you active here and there :slight_smile:
So, for my case the transmittance was the main important component thus I simply used NumPy for multiplying the transmission matrices.
I would suggest using LBNL Window software if you are interested in different combinations of shading and glazings. I also suggest you take a look at the or this example.


Thanks a lot Fazel! I should say hi from Sareh also :slight_smile:

1 Like