In many cases, scattering data is delivered as a text file of experimental values that may not be easily modelled. This article discusses how to use tabular Bi-Directional Scatter Distribution Function (BSDF) data for defining surface scattering properties that may not be able to be described by Lambertian, Gaussian, or ABg models that are built in to OpticStudio.
Authored By Sanjay Gangadhara; updated by Alissa Wilczynski and Sandrine Auriol
Downloads
Introduction
Surface scattering is an important effect to consider when analyzing both the illumination and stray light characteristics of a system. While OpticStudio provides Lambertian, Gaussian, and ABg models, in many cases, the desired distribution is simply provided in terms of a table of measured data for the Bi-Directional Scatter Distribution Function (BSDF)
A model has been constructed where tabular BSDF data may be used to generate surface scattering properties. This article describes the model and provides an example of how this model can be used to specify the scattering distribution on any object surface in the Non-Sequential mode of OpticStudio.
Tabular BSDF data
The BSDF scattering model built into OpticStudio supports the use of tabular BSDF data for defining the scattering properties of the surface(s) of an object.
Data sets are provided to the program via a text file which must follow the Zemax Tabular BSDF Data format. A full description of that format is provided in the Knowledgebase article "Zemax Tabular BSDF data file format". Please read through that article carefully before proceeding with this article.
Let’s take a look at a simple example using real BSDF data measured by the IS-SA instrument at RVS (formerly Radiant Imaging). This simple setup is provided in the sample file {Zemax}\Samples\Non-sequential\Scattering\Tabular BSDF scattering surface.zos".
The data are for an automotive dashboard vinyl material named Brown Vinyl. The BSDF data for this material are provided in the text file BrownVinyl.BSDF, which is provided with the OpticStudio installation (located in the {Zemax}/Scatter folder). This file contains monochromatic BSDF data, and data are defined for 13 incident angles, 19 azimuthal angles, and 11 radial angles
Scatter Function Viewer / Polar Plot
Before using the data in a simulation, the Tabular BSDF data can be checked with the Scatter Function Viewer or the Scatter Polar Plot. The BSDF should be copied in the {ScatterData} folder to be seen by the software.
Please note that the Scatter Polar plot is not exactly comparable to what you will see in a non-sequential Ray Trace.
- One difference is that the Scatter Polar plot directly represents the content of the BSDF file. Interpolations between data tables in the BSDF file are used to plot cases where there is no surface azimuth specified in the file. In contrast, in a ray trace, two random rays are drawn from corresponding tables and a linear combination of those two directions gives the “interpolated” scatter ray.
- A second difference is that the Scatter Polar plot uses a different azimuth convention than in the ray trace. In the ray trace, Azimuth 0° is defined by pointing from the angle of specular reflection towards the axis normal to the sample, with Azimuth angles increasing in a counter-clockwise fashion. In the Scatter Polar plot, this is Azimuth 90°.
- Finally, the Scatter Polar plot is given for a specific angle of incidence. It does not take into account any divergence in the source rays.
Tabular BSDF settings
We use this data to define the scattering distribution on a Rectangle object in non-sequential mode:
Let’s review the scattering properties of Object 2.
- Scatter Fraction = 1
When using this model, the "Scatter Fraction" parameter is usually set to 1, because the BSDF file includes both the specular and scattered ray information and contains the TIS data directly.
As with any other scattering model, the scattered power will then be divided equally amongst the number of scattered rays defined by the "Number Of Rays" parameter. Power that is not scattered is assumed to be lost at the surface, i.e. due to surface absorption. Thus, all input rays will undergo scattering, but the power of the scattered rays will be scaled by the appropriate TIS value (of course different TIS values will be used for different input rays that have different angles of incidence). - Number of Rays = 5
Each input ray is split into 5 scattered rays. - Angle
The Tabular BSDF format allows for measurements at multiple rotations of the sample. This is needed to account for surfaces which exhibit anisotropic scattering.
If the surface is to be modeled in the optical system with a different orientation relative to measurement orientation, the user can specify a non-zero value for the "Angle" input.
Angle values are input in degrees and should be between 0 and 360. Non-zero angle values correspond to counter-clockwise rotation of the surface relative to the +X axis. - Reflect / Transmit:
The Tabular BSDF file supports two inputs for the ScatterType value: BRDF and BTDF. However, this data is not used by OpticStudio; the scattering distributions in reflection and transmission are determined by which files are selected under the "Reflect" and "Transmit" inputs respectively:
Thus, the BSDF model may be used to scatter simultaneously in both transmission and reflection, allowing for different scattering distribution in each direction. The total amount of scattered power in each direction will be based on the relevant TIS values for scattering in reflection and transmission as well as on the surface coating properties. - Importance Sampling
If needed, the model supports Importance Sampling (under the Scatter To section). A very nice example is provided in the file {Zemax}\Samples\Non-sequential\Scattering\ Tabular BSDF scattering surface with Importance Sampling.ZMX.
When Importance Sampling is used, the TIS value that is needed to normalize the energy carried towards the object of interest is again read directly from the input data file; the TIS value used for a given scattered ray is the value associated with the incident angle of the corresponding input ray.
Simulation
A Source Ray object is then used to launch rays towards the Rectangle at an angle of incidence of 30 degrees. A Detector Rectangle object is placed in front the Rectangle to view emission that results from scattering in reflection:
The Detector Rectangle object is rotated 180 degrees with respect to the Rectangle object, and the “Front Only” flag is set to 1, so that only the reflected rays are recorded by the detector.
When 1 million analysis rays are launched from the source, the incoherent irradiance and Radiant Intensity distributions on the detector are observed to be:
Note that the total power which hits the detector is 0.1229 W.
For this case, the total power should equal the product of the mirror reflectivity and the TIS value for scattering for an incident angle of 30 degrees.
- For an uncoated mirror (for which OpticStudio assumes a coating of thick aluminum) the reflectivity is 94.555% (you can confirm this value simply by running a ray-trace in the sample file with scattering turned off).
- For the Brown Vinyl data file, the TIS value at an incident angle of 30 degrees is 0.1371577.
- The product of the mirror reflectivity and the TIS value is thus 0.94555*0.1371577 = 0.1297.
The amount of power on the detector only agrees with this value within 1%, because the simulation doesn’t capture the edge of the scattering distribution. To confirm this, we can increase the size of the detector or bring the detector closer to the scattering surface, which is what we do here.
Now the total power that hits the detector is 0.1297W. It agrees perfectly with the data from the calculation.
Scattering ray-tracing
The direction cosines for the scattered ray are determined in the model by integrating the measured BSDF data provided in the input file. A cumulative distribution function (CDF) in angle space is pre-computed based on the tabulated BSDF data . To find a scatter angle, the software will draw a random number between 0 and 1 and based on the CDF will decide the angle.
OpticStudio will in fact use two random numbers, one for the scatter polar angle and one for the scatter azimuth angle.
The necessary integrals – and their relationship to the scattered ray vector – are identical to those provided in the Knowledgebase article "How to create a user defined scattering function". Since the BSDF is described by tabular data rather than an analytic function, in this case it is necessary to perform numerical integration rather than analytic integration. Otherwise, the procedure is the same.
In all cases, the necessary integrals are performed only once, when the file is first loaded into OpticStudio. The integrated data are then stored in memory and are available for use during any number of ray traces. Since the data are stored in memory, the computational time required to perform a ray trace is basically the same as it would be for a built-in OpticStudio scattering model. Thus, multiple input files may be used to define various scattering distributions on different surfaces in the design with no significant increase in computation time.
However, the number of different files that can be stored in memory is currently set to 200. If a design were setup with more than 200 input files for the various scattering distributions, OpticStudio would not scatter rays for those surfaces after which the distribution limit of 200 was reached; rays would simply follow the specular ray path at those surfaces.
Interpolation
- Interpolation between sample rotations:
It is important to note that interpolation of BSDF or TIS values is only performed between data sets at different sample rotation angles, to ensure a fairly smooth transition between results as the sample is rotated in OpticStudio.
In order for the interpolation to work reasonably well between the SampleRotation entries, the ScatterAzimuth entries must contain all azimuth points that map to each other under the individual sample rotations.
For example, if there is a point at 5.1 degrees, and sample rotations are every 90-degrees, the azimuth samples must also include 95.1, 185.1, and 275.1. - Interpolation within a given sample rotation:
At any given sample rotation angle, interpolation is also performed to correlate the random numbers selected in the algorithm with the scattering angles, analogous to the determination of scattering angles in the Knowledgebase article “How to create a user defined scattering function”.
It means that scattering can and will generally occur at angles other than the input azimuthal and radial angles provided in the data file. However, this correlation requires the use of integrated data sets (analogous to the functions Iq and IN in the above article) which will only exist at discrete values of the incident, azimuthal, and radial angles, since the input data are only provided at discrete values for these angles.
In the BSDF model, the closest angle values are chosen to determine the appropriate data sets for calculating the scatter angles, i.e. interpolation is not performed in choosing the appropriate data sets.
Thus, when using this model, you must ensure that the input data have sufficient angular resolution (specifically with regards to the incident, azimuthal, and radial angles) to describe any variations of importance in the BSDF data.
Extrapolation
Data is not extrapolated. This means that if the maximum azimuth angle is 350, there will be not scattered light between 350-360.
FAQ
- Issue with the interpolation :
To avoid any issues with the interpolation, these steps might generally help:- Ensure that the data points extend all the way to the maximum allowed azimuthal angle.
For PlaneSymmetrical (data with a left-right symmetry), this is 180 degrees.
For Asymmetrical (no azimuthal symmetry), the azimuthal data should extend to 360 degrees. - If the data contains some steps, add some low-valued data around the step, to allow the interpolation algorithm to generate a smooth profile. If the data is all-zero except for a single step, there might be noise elsewhere in the interpolated BSDF. If you add some smoothing to the step, the noise in other parts of the BSDF should also smooth out.
- Ensure that the data points extend all the way to the maximum allowed azimuthal angle.
- High unphysical intensity in specular direction:
BSDF files cannot have rows of zero BSDF value (e.g., each azimuth stripe must have at least one non-zero value) because this produces regions where the radial angle cannot be sampled from the integrate scatter probability distribution. This is the cause of unphysically high intensity in specular direction, because undefined scatter samples are sent to the specular direction. - Artifacts using BSDF data:
Artifacts in the radiant intensity distribution can be seen near the edges of the plot, i.e. the “staircase” structure near the bottom of the plot. This structure arises from the coarseness of the input data, which are provided with a resolution of 10 degrees in the azimuthal direction and over most of the radial direction.
To eliminate these artifacts, the angular resolution of the input data needs to be increased. For example, the BSDF current file has a 5 or 10 degrees resolution for the radial direction and a 10 degrees resolution for the azimuthal direction.
The screenshots below compare the current file with a BSDF input file with 2 degrees of resolution in both the azimuthal and radial directions. The plot shows the incoherent irradiance distribution for both cases. The 2 degrees resolution results are on the right.
The plot shows the radiant intensity distribution:
Note the smoother variation of the radiant intensity distribution at higher resolution. Also note that since the BSDF file format allows for non-uniform spacing of data in angle space, it may be sufficient to increase the resolution of the data only in the region where the artifacts appear. This keeps the file size compact while providing a high level of accuracy to the ray trace results.
The higher resolution BSDF file can be downloaded from the Attachment section of this page.
KA-01520
Comments
Please sign in to leave a comment.