Solved

BTDF data


Hi

I try to make a BTDF data file to simulate a VDI roughness from air to glass or glass to air, but I don’t understand what is the reference for radial direction, it is indicated by the “angle of direct transmission” in article https://support.zemax.com/hc/en-us/articles/1500005486801-BSDF-Data-Interchange-file-format-specification

Do I have to take into account the refraction for this angle, which seem logical, or not ?

Is it possible do use BTDF scattering between two media with a difference on refractive indexes?

Marc

icon

Best answer by MichaelH 17 April 2023, 18:13

View original

17 replies

Userlevel 6
Badge +2

Hi @Marc.Derrien!

By the angle of direct transmission, we mean that the reference in the BTDF case is the refracted transmitted ray, so the refraction is taken into account. 
I set up a system below. A ray is incident on a rectangular volume with an angle of 40 degrees. I ran the simulation twice:

  • I set the index of refraction to 1 first, so the specular transmitted ray has an angle of 40 degrees.
  • I set the index of refraction to 1.5, the specular transmitted ray has an angle of roughly 25 degrees.
     

The plots show the scattered angular distribution of light on the detector. We can see that the data is centered around the refracted transmitted ray.


 

Hi

I made a BTDF file for a transmission from glass (n=1.5) to air (n=1)

For small angle the comparison between the simulation and the “scatter polar plot” give corresponding response 

 

For angles greater than 28.4° there is no rays transmitted from glass to air and I don’t understand why, as the scatter Polar plot gives good results :

 

Userlevel 6
Badge +2

Hi Mark!

Thank you for sharing your file.
The Scatter Polar Plot is showing the raw results of the BSDF.
The Detector Viewer shows the results from the simulation.
On my side, it works fine so I have attached my file. Let me know if it helps. Below are the results for a 40-degree incident angle and an index of 1.5:
 

 

Hi Sandrine,

You don’t read correctly my response, the problems is when the rays are coming from glass to air, your file is from air to glass.

In attached file you could find a simulation with rays source in glass and detector in air with 2 angles 28° (blue) and 29° (green). At 29° there are no ray transmitted.

 

 

regards

Userlevel 6
Badge +2

Oh yes sorry! I don’t really understand...I will check with my colleagues. I am puzzled.

I added 2 configurations to the file:

  • configuration 1: no scattering
  • configuration 2: scattering from a dummy surface before the glass-air interface
  • configuration 3: scattering from the glass-air interface

 

Userlevel 6
Badge +2

Hi @Marc.Derrien! Sorry for not replying. Still checking on this file.

Hi Sandrine,

I have a guess why there is a problem with high angles. I don't know if the refraction is done after the scattering function or on the contrary the scattering after the refraction. In the first case it is possible that the angles after scattering can become too large for the refraction (Total Internal Refraction) and the program does not know how to handle these cases.

Marc

 

Userlevel 6
Badge +2

Yes it might well be. In this article https://support.zemax.com/hc/en-us/articles/1500005574962-How-to-apply-scattering-in-the-presence-of-total-internal-reflection-TIR-, we explain that we first consider TIR and then scattering. But because the specular is not under TIR, I thought it would work…

Thank you for your comment.

Userlevel 6
Badge +2

We have filled a bug report and we will let you know when we hear back from the developers.

Userlevel 6
Badge +2

I had a quick look at this but couldn't definitely convince myself of the exact cutoff.  What I found was the TIS for angles between 45deg and 50deg was 0.0, so effectively the cutoff for transmission scattering is somewhere between 45deg and 50deg.  The ray is undergoing transmission then scattering, but at 29deg AOI (~47.8deg exitance angle), the transmission rays already have 0 energy.  OpticStudio has to do some interpolation to determine when the value goes to 0 (and this is not at 50deg exactly because OpticStudio or any other algorithm does not like discontinuities in the first derivative of a curve); it appears that OpticStudio gives 0 transmission for any AOE above the halfway point of 47.5deg. 

If you modify the scatter file to either increase the TIS (a more realistic scan will have a few steps from TIS = 1 to TIS = 0 and not just a single step) or increase the AOI scan angle beyond how you intend to model it, you should be the performance you’re looking for.

Userlevel 6
Badge +2

Thank you very much @MichaelH for your help on this! I couldn’t figure it out.

Yes indeed I forgot the TIS value and the fact that BTDF are defined vs the angle of direct transmission!
For BTDF, ScatterRadial and ScatterAzimuth angles are defined relative to the angle of direct transmission.” (https://support.zemax.com/hc/en-us/articles/1500005486801-BSDF-Data-Interchange-file-format-specification)

So it means that if the angle of incidence is 29 degrees, the angle of direct transmission will be asin(sin(29)x1.53) =47.9 degrees. So if we plot the TIS vs the angle of incidence for that particular BSDF, we have:

I did what Michael suggested and copy the BSDF block for the angle of direct transmission of 45 degrees into the BSDF block for the angle of direct transmission of 50 degrees.

So it now looks like this:
 

Light is now exiting for configuration 3:
 

Again thank you very much @MichaelH !

And apologies @Marc.Derrien for missing this.

Hi all,

It was my first question about the definition of “angle of direct transmission” and the first response from Ms Auriol was : “ By the angle of direct transmission, we mean that the reference in the BTDF case is the refracted transmitted ray, so the refraction is taken into account” which not correspond to your last response or I don’t understand it correctly.

Marc

Userlevel 6
Badge +2

Hi Marc,

The BSDF (either BRDF or BTDF) is always measured from the non-scatter specular ray with respect to the normal of the surface.  So, the concept is that a “Snell’s Law” ray trace is performed at the surface and then the scattering is applied to the ray after transmission or reflection.   

For the 28deg AOI, the angle after refraction is ~45deg and there is still  valid BSDF data.  For the 29deg AOI, the angle after refraction is ~47.9deg and after interpolation of the BSDF data, the TIS is 0 and no energy in the transmitted ray, therefore no scattered rays.

So to directly answer your questions:

Do I have to take into account the refraction for this angle, which seem logical, or not ?

Yes, you have to take into account the angle after refraction, not the angle of incidence.

Is it possible do use BTDF scattering between two media with a difference on refractive indexes?

Yes, the BTDF doesn’t know or care about the previous medium.

The article you first referenced has a diagram which shows this:

The one confusing part might be that if you look at the actual BSDF file, there is a line (#9) which reads AngleOfIncidence, which is poorly worded in the file format definition.  This is actually the specular ray angle w.r.t. to the normal. 

Userlevel 6
Badge +2

I had misunderstood because the angle of incidence is a misnomer in the format. The angle of incidence in the BSDF means the angle of the direct transmitted ray (or the angle of reflected specular ray). 

For example in the BSDF files below you have 2 “angles of incidence”.

If light arrives at 20 degrees incident angle on a scattering rectangular volume that has an index of 1.97, the specular reflected ray will have an angle of 20 degrees and the direct transmitted 10 degrees.

The scattering in reflection will follow the 2nd BSDF block of the file (for the “angle of incidence” of 20), so a narrow, specular distribution.

The scattering in transmission will follow the 1st BSDF block of the file (for the “angle of incidence” of 10), so a Lambertian distribution. I will make sure to clarify the documentation.

Again thank you @MichaelH for your help on this.

 

 

Hi Sandrine and Michael

It’s very tricky this incidence angle definition, especially since in the document ( https://support.zemax.com/hc/en-us/articles/1500005486801-BSDF-Data-Interchange-file-format-specification) there is not the image given by Michael with the green arrows.

I corrected my BTDF files but I found another bug when there is a the same time a BRDF and a BTDF files for the same surface, the global energy after scattering is not good, I have a loss of half of the energy. If I use only the BTDF or the BRDF file the value for transmission and reflection are good. For the BTDF and BRDF file I indicate a value of TIS=1 for each angle, the Fresnel law given the good value of transmission and reflection.

With only BRDF :

With only BTDF :

With the 2 files :

 

I don’t understand!

Regards

Marc

Userlevel 6
Badge +2

Hi @Marc.Derrien,

We are planning some change in the documentation but in the meantime I have added Michael’s sketch to our article: https://support.zemax.com/hc/en-us/articles/1500005486801

For the issue with the energy when a BRDF and a BTDF files are defined for the same surface, I have checked and can confirm your issue. I checked in our bug reports and it has already been reported. I will let you know when we have a fix. Sorry about that.

Userlevel 6
Badge +2

Hi @Marc.Derrien,

I hope you are well. Our developers are looking into the issue of the energy when BRDF and BTDF files are defined for the same surface.  

Our code is currently checking the total TIS of reflection/transmission BSDF pairs and forces the total to be less than or equal to one. If the sum of TIS exceeded one, the individual TIS values are renormalized to one. So I believe this gives you an idea of how to fix it by changing the TIS values of your files. We will let you know once we have a fix, but I thought that can give you a workaround in the meantime.

Reply