BTDF Luminit file to BSDF.xml

Hello,

I am trying to use Luminit diffuser data (BTDF & BSDF Data | Luminit Optical Diffuser Performance).

The workflow I am currently following is:

  1. Start from the Luminit file BTDF_2.bsdf.txt .
  2. Read the angular BTDF blocks in Python.
  3. Generate intermediate meas_*.dat files for each incident angle.
  4. Use:
pabopto2bsdf meas_*.dat > luminit.sir
  1. Then generate the TensorTree with:
bsdf2ttree -g 5 luminit.sir > BTDF_60_TensorTree.xml

The XML is generated correctly and can be visualized with bsdfview , but in Radiance simulations the material barely diffuses light, even at short distances (~0.4 m), whereas a simplified Gaussian approximation did show visible diffusion.

Thanks for all

Hi Alex,

Welcome to the forum!

Your conversion steps seem sensible to me, but there may be some issue with the data you are providing to pabopto2bsdf. Can you share the meas_*.dat files somewhere?

Also, let me know what your Gaussian approximation for this material is, so I have an idea of what you are expecting.

Cheers,
-Greg

Hi Greg,

Thanks for your response. I have been following the Radiance forum passively for quite some time now — congratulations for all the work you and the community do there.

I think the issue is related to how I convert the BSDF obtained from Luminit into the meas_*.dat files.

I am sharing the folder with the generated files here:
https://udlcat-my.sharepoint.com/:f:/g/personal/alex_moreno_udl_cat/IgDhxZNxSvRlR73XHHCejEYVAasmnYK6c0JzHfVnDVms95E?e=0ePlZA

I suspect I may be misunderstanding the normalization expected by the meas_*.dat format — possibly confusing integrated BTDF values with differential BSDF values in sr^-1.

Best regards,
Alex

Hi Alex,

Ah, so you’re one of our “lurkers.” You had me wondering how you acquired such expertise out the gate!

Thanks for posting your converted files. I’m not sure I understand the input format exactly, but I am looking at their “BRDF_2.bsdf” file, and it seems to be a header describing the steps of each axis in a 4-D (theta_i, phi_i, theta_s, phi_s) array of BSDF values. Your code broke this into separate files for each incident pair and correctly labeled the data as “#theta phi BSDF”, so you shouldn’t need to perform any conversions on the values themselves unless I’m missing something.

Under these assumptions, the first value in your first incident file “meas_00.dat” should start something like:

#incident_angle 0.000000 0.000000
#intheta 0.000000
#inphi 0.000000
#format: theta phi BSDF
0.000000 0.000000 3.95E+00
1.000000 0.000000 3.25E+00
2.000000 0.000000 2.45E+00
…

Instead, your first file starts out:

#incident_angle 0.000000 0.000000
#intheta 0.000000
#inphi 0.000000
#format: theta phi BSDF
0.000000 0.000000 7.4701517983e-01
0.000000 1.000000 7.4701517983e-01
0.000000 2.000000 7.4701517983e-01
…

I’m also assuming that the later angles in the input file are the inner-loops on the array, which is why the scatter angles are different above. Even if the order were reversed, the first value should still be “3.95” rather than “0.747” – a value that doesn’t appear in the input.

It makes sense that you would exclude all-zero values from the input, which I guess is anything over 75° theta_s or so, but the value count still doesn’t square with that, so there may be something else going on. I didn’t go through your whole output file.

Finally, there are “TIS” values inserted in the input, which I assume is total integrated scattering at each incidence. These will be handy for checking the data once we get the conversion right, but don’t need to go in the files given to pabopto2bsdf.

Does any of this track?

Cheers,
-Greg

Hi Greg,

First of all, I realized that the meas files I sent you the other day likely contained an error. I suspect that during the conversion process I unintentionally treated the data as reflection instead of transmission. Because of this, I am now exporting the transmission hemisphere using:

theta_out = 180 - theta_src

which seems to be the correct convention for transmitted directions in the meas files.

However, I am still encountering significant issues with the narrow-angle diffusers, especially the 10° BTDF. The 60° diffuser behaves much more reasonably, while the 10° case produces obvious artifacts and nonphysical behavior when converted into the TensorTree XML representation and checked with checkBSDF.

I have shared a folder containing all the current files and intermediate results:
folder: radiance

  • BTDF_10.bsdf.txt
    Original Luminit BTDF data for the 10° diffuser.
  • BTDF_60.bsdf.txt
    Original Luminit BTDF data for the 60° diffuser.
  • meas10/
    Generated meas_*.dat files for the 10° diffuser.
  • meas60/
    Generated meas_*.dat files for the 60° diffuser.
  • luminit_sir10.sir
    Intermediate .sir file generated from the 10° measurements.
  • luminit_sir60.sir
    Intermediate .sir file generated from the 60° measurements.
  • luminit_10.xml
    Final TensorTree XML generated for the 10° diffuser.
  • luminit_60.xml
    Final TensorTree XML generated for the 60° diffuser.

I also included a PDF named:

  • EXPLANATION DIFFUSERS.pdf

In this document I show some Radiance simulations comparing both diffusers. The problem with the 10° case becomes very evident there: instead of producing a tighter transmitted lobe than the 60° diffuser, it behaves incorrectly and generates an excessively spread distribution, which is clearly nonphysical.

At this point I suspect that the issue may occur during the pabopto2bsdf / bsdf2ttree conversion process, particularly for very narrow angular distributions.

Thanks again for all your help

Best regards,
Alex

Hi Alex,

Yes, it does look like the lobe-fitting algorithm is struggling with this dataset. I’ll see if I can figure out what’s going on. It’s been tested thoroughly on more densly-sampled BSDFs, but I don’t know how robust it is to different sampling patterns. Maybe not robust enough!

I’ll get back later with my findings. Thanks for organizing everything so nicely.

-Greg

OK, I don’t know if this is the only problem, but the thing keeping pabopto2bsdf from creating a useful SIR (Scattering Interpolant Representation) from your input is the large swath of missing data outside the main peak. You should cover as much of the hemisphere as you can, not just 30° around the peak. Otherwise, the quadtree subdivision forces the data into a truncated tree that can’t represent it.

In your converter, please convert all the measured data, even if the BSDF values are tiny. (They can even be negative, though local averages should not be.)

Cheers,
-Greg

Thanks Greg,

After filling the full tree matrix and keeping all the measured values — including the very small ones — the results now look much more realistic. Your explanation about the missing low-level tails and the quadtree truncation was extremely helpful.

The behavior of the 10° diffuser has improved significantly compared to the previous attempts, where the distribution became completely nonphysical.

I will continue refining the workflow, and the next step will be to try modeling anisotropic diffusers as well.

I have attached two images showing the updated results.

Best regards,
Alex

1 Like