This article describes the Zemax Tabular BSDF data file format that is required for the BSDF scattering model. This model is used to apply a scattering distribution as provided by tabular BSDF data on a nonsequential surface.
Authored By Ron Rykowski, reviewed by Sandrine Auriol
Downloads
Introduction
The Zemax Tabular BSDF data file format is a compact, simple way to transfer BSDF data. Devices like the Imaging Sphere (ISSA) developed by Radiant Vision Systems can provide a full hemisphere of BSDF data in a single measurement, thus requiring a way to export this data for straightforward use in an optical design program, such as OpticStudio.
This file format is employed by the BSDF scattering model, which is described in the article "How to use Tabular BSDF Data to Define the Surface Scattering Distribution". This model uses the BSDF data provided in the input file to generate a scattering distribution, which may be applied to any nonsequential surface in OpticStudio.
Scattering Geometry for Tabular BSDF
Definition of angles and coordinate systems
There are four important angles that describe how light scatters from a surface. They are defined below in order of importance:
 Sample Rotation (enumeration label: SampleRotation)
 Angle of Incidence (enumeration label: AngleOfIncidence): this name is a misnomer. This angle actually represents the specular reflected or transmitted angle.
 Azimuth Scatter angles (enumeration label: ScatterAzimuth)
 Radial Scatter angles (enumeration label: ScatterRadial)
The order of the four angles is important:
 for every Sample Rotation, you can have data for multiple Angles of Incidence.
 For every Angle of Incidence, you can have data for multiple Azimuth angles.
 For every Azimuth angle, you can have data for multiple Radial angles.
 For every Angle of Incidence, you can have data for multiple Azimuth angles.
Sample rotation
The sample rotation measures the angle between the normal of the plane of incidence and the +X local axis of the object in the counterclockwise direction.
All values for the sample rotation are between 0 and 360 degrees with nonzero values corresponding to rotation of the sample in the counterclockwise direction relative to the +X axis of the object.
It means that if an incident ray is in the YZ local plane of the object (and the angle setting of the BSDF in OpticStudio is set to 0), then the sample rotation would be considered equal to 0. The angle setting of the BSDF is defined in "How to use Tabular BSDF Data to Define the Surface Scattering Distribution".
OpticStudio uses the +X local axis of the object, and not the face of the object. This is important to consider when using a BSDF on an object, as the BSDF might not be correct on faces other than the front face.
Here are a few examples to understand how the sample rotation works. Both images assume that the 'Angle' setting in object properties is set to zero:
Angle of incidence
The angle of incidence can be a bit of a misnomer. It is the angle of the specular ray AFTER reflection or transmission.
BRDF  BTDF  
Angle of incidence  Angle of specular reflection  Angle of direct transmission 
 For BRDF, the ScatterRadial and ScatterAzimuth angles are defined relative to the angle of specular reflection. In this way, the number of values that must be reported is reduced, especially for mostly specular samples.
 For BTDF, ScatterRadial and ScatterAzimuth angles are defined relative to the angle of direct transmission.
So if light is incident at an angle of 20 degrees on a scatter rectangular volume with an index of refraction of 1.5, the angle of specular reflection is 20 degrees and the angle of direct transmission is 13.2 degrees (=asin(sin(20)/1.5).
To find the scatter distribution in reflection, one needs to look at the BSDF block for an "angle of incidence" of 20 degrees.
To find the scatter distribution in transmission, one needs to look at the BSDF block for an "angle of incidence" of 13.2 degrees.
Scatter Radial / Scatter Azimuth
 For BRDF: the ScatterRadial and ScatterAzimuth angles are defined relative to the angle of specular reflection for BRDF.
 For BTDF, ScatterRadial and ScatterAzimuth angles are defined relative to the angle of direct transmission.
Radial 0° is defined at the angle of specular reflection, with increasing Radial angles extending outward.
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 counterclockwise fashion.
Geometry in an example
Let’s have a look at an example. The scattering surface below has a scatter profile given by the following Tabular BSDF.
Let's compare two cases:
 A Source Ray sends rays in the YZ plane with an angle of incidence of 20 degrees.
 A Source Ray sends rays in the XZ plane with an angle of incidence of 20 degrees.
Plane of incidence  YZ  XZ 
Angle of incidence  20 degrees  20 degrees 
Sample rotation  0 degrees  90 degrees 
Azimuthal reference  The phi angle is pointing up.  The phi angle is pointing to the right. 
Geometry 
Definition of file format
The Zemax Tabular BSDF data file is simply a formatted text file with a *.BSDF extension. Below is a table which lists each text and data line of the file along with possible values.














Note in this article, we explain the format of BSDF data for CIE tristimulus values XYZ. However, OpticStudio doesn't currently support the scattering model for the BSDF data with CIE tristimulus values. If you load the BSDF data with CIE tristimulus values XYZ in your system, only Y group values will be used. 


The file format supports two inputs for the ScatterType value: BRDF and BTDF. However, this data is not used by OpticStudio. The software will ask for a BRDF and a BTDF files.



Positive integer (no decimal points allowed) 


All values for the rotation angles should be between 0 and 360 degrees, with nonzero values corresponding to rotation of the sample in the counterclockwise direction relative to the +X axis. All enumeration values are positive. The number of enumeration values must match the number of sample rotation. 


Positive integer (no decimal points allowed). 


All enumeration values are positive. The upper limit for the angle of incidence is 90 degrees. 


Positive integer (no decimal points allowed) 


The upper limit of Azimuth angles is defined by the Symmetry variable: 

ScatterRadial 
Positive integer (no decimal points allowed) The model limits the Number of radial angles to a maximum of 1000. 


The overall upper limit of Radial angles is 180°. 








DataBegin and DataEnd statements surround each large group of data. Following the TIS value, Scatter data is enumerated with columns representing the ScatterRadial values for each ScatterAzimuth row. The rows are organized in groups. First, the ScatterAzimuth values are reported for each AngleOfIncidence. Data for each AngleOfIncidence, which contains various ScatterAzimuth rows, is then reported by following rows. Data for each SampleRotation, which contains various AngleOfIncidence groups, is then reported by appending more rows. 


Before each block of scatter data for a given Angle Of Incidence is a value for Total Integrated Scatter. That value is on a separate line preceded by “TIS”. The value is a fraction, such that a value of .500 would indicate that 50% of the light is scattered, and the remaining is absorbed or transmitted in the case of BRDF. 


Table of the measured BSDF according to radial and azimuthal angles, for the sample rotation N°1 and 


Table of the measured BSDF according to radial and azimuthal angles, , for the sample rotation N°1 and 



Example 1: Monochrome Isotropic sample
Isotropic samples show symmetrical data about the illumination axis of the measurement. The builtin sample file BrownVinyl.bsdf is an example of an isotropic BSDF.
It can be found under "{Zemax}\ScatterData\BrownVinyl.bsdf". Open the file in a text editor.
 There is only one wavelength (SpectralContent is set to Monochrome), so it means that there is one contiguous data group with one DataBegin and one DataEnd statements.
 The BSDF symmetry setting is set to PlaneSymmetrical, meaning that the azimuthal values are defined from 0 to 180 degrees.
So, the BSDF value for a radial angle = 10 and an azimuthal angle = 200 (180 + 20) is the same than the BSDF value for a radial angle = 10 and an azimuthal angle = 160 (18020).
 Note the placement of Incidence angle groups, Azimuth angle groups, and Radial angle columns.
 This example only includes data for one sample rotation. If there are multiple sample rotations, the data group will have additional lines of data after the last data line, but before the DataEnd statement.
Example 2: Monochrome anisotropic samples
Anisotropic samples show no symmetry in the measured data and so the distribution will vary with the sample rotation. Although OpticStudio can read Asymmetrical data (one sample rotation) or Asymmetrical4D (several sample rotations) in the symmetry setting of the BSDF data format, it is recommended to use Asymmetrical4D as an anisotropic sample will likely change with the rotation of the sample.
The file called asymmetrical4d_btdf_zemax.bsdf in the Download section is an example of a monochrome asymmetrical4D BSDF data format. It shows how to define an anisotropic sample.
There is only one contiguous data group, and one DataBegin and DataEnd statement. The BSDF symmetry is set to Asymmetrical4D, meaning that the azimuthal values are defined from 0 to 360 degrees. The file also contains different sample rotation values, as the BSDF will change against the sample rotation.
FAQ
 OpticStudio can’t read my BSDF file. Is there an issue with the format?
The BSDF file is sensitive to formatting, so for any issues, we recommend opening the BSDF file with a text editor like Notepad++ and click on Show All Characters. The formatting should be identical to one of the attached examples.  Are measured tabular BSDF with Radiant Vision System’s ISSA direct given in the same format as OpticStudio?
Data from Radiant Vision System's ISSA undergoes a rotational transformation to match this coordinate system, as the illumination axis of ISSA is not defined at 0° Azimuth.
Note that the data appears rotated. Azimuth 0° is defined to be along the axis of illumination for this format, but the standard Imaging Sphere coordinate system (which is used to display this transformation) defines Azimuth 0° as normal to the axis of illumination, as shown in the top image.  Can tabular BSDF in OpticStudio vary with the wavelength?
The Zemax Tabular BSDF data format can contain BSDF values for each Tristimulus XYZ. However, OpticStudio will only read the data for the Tristimulus Y.
An example is provided under Download. The file called XYZ_PlaneSymmetrical_btdf_zemax.bsdf is an example of the Color (XYZ) BSDF data format.
Note that each separate Tristimulus value has a separate DataBegin and DataEnd statement. If there are multiple sample rotations, each Tristimulus grouping will have additional lines of data after the last data line, but before the DataEnd statement.
KA01372
Comments
Please sign in to leave a comment.