BSDF Data Interchange file format specification

This article describes the BSDF Data Interchange 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 non-sequential surface.

Authored By Ron Rykowski

Introduction

The BSDF Data Interchange file format is a compact, simple way to transfer BSDF data. Devices like the Imaging Sphere (IS-SA) 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 non-sequential surface in OpticStudio.

Definition of coordinate system

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)
  • 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; and so on.

https://downloads.zemax.com/zemax-portal/knowledge_articles/KA-01372/Images/Image1.png

Layout_2

Layout_3

Figure 1. The four BSDF angles important to communicating scatter data. Note that ScatterRadial and ScatterAzimuth angles are defined relative to the angle of specular reflection for BRDF. 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.

The ScatterAzimuth and ScatterRadial angles are defined relative to the angle of specular reflection. In this way, the amount of data that must be reported (especially for mostly specular sources) can be greatly reduced. 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 counter-clockwise fashion. Data from Radiant Vision System's IS-SA undergoes a rotational transformation to match this coordinate system, as the illumination axis of IS-SA is not defined at 0° Azimuth.

Transformation about point of specular reflection

Figure 2. Transformation about point of specular reflection. The top image shows the original hemispherical data for a sample with an AngleOfIncidence of 30°. The bottom image shows the transformed data, centered about the point of specular reflection. 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.

Definition of file format

The BSDF Data Interchange 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.

 Line #

 Description

 Values

 #

<comments>

<Any line that starts with # is ignored as a comment>

 1

Source

Measured

 2

Symmetry

PlaneSymmetrical Asymmetrical Asymmetrical4D

 3

SpectralContent

Monochrome XYZ

 4

ScatterType

BRDF BTDF

 5

SampleRotation

<number of different sample rotations>

 6

<enum>

<enumeration of sample rotations>

 7

AngleOfIncidence

<number of different angles of incidence>

 8

<enum>

<enumeration of angles of incidence>

 9

ScatterAzimuth

<number of different azimuth angles>

 10

<enum>

<enumeration of azimuth angles>

 11

ScatterRadial

<number of different radial angles>

 12

<enum>

<enumeration of radial angles>

 13

<empty line>

 

 14

<SpectralContent indicator

Monochrome Tristimulus<XYZ>

 15

DataBegin

<Begin Data>

 16+

<enum>

<enumeration of scatter data for all angles>

 17

DataEnd

<End Data>

Table 1. Description of lines in the BSDF Data Interchange format. Changing some variable settings can affect enumeration formatting. Refer to the Formatting Notes for specific details.

Taking the built-in sample file BrownVinyl.bsdf for example, we would note it as below.

Note

Formatting notes

Line     Notes

 

#. Any line that starts with the # symbol is ignored as a comment line.

  1. There is currently only one option for the Source variable: Measured

  2. There are three options for the Symmetry variable: PlaneSymmetrical, ASymmetrical, ASymmetrical4D

PlaneSymmetrical

The measured data is symmetrical about the illumination axis of the measurement, so only 180° degrees of Azimuth data are reported. Use this setting for isotropic samples with plane symmetry.

Asymmetrical

There is no symmetry in the measured data; no sample rotations. All 360° of  Azimuth data is reported. Use this for isotropic samples (only one sample rotation).

ASymmetrical4D

There is no symmetry in the measured data; includes sample rotations. All 360° of Azimuth data is reported. Use this for anisotropic samples (multiple sample rotations).

  1. There are two options for the SpectralContent variable: Monochrome, XYZ

Currently, Radiant Vision Systems’ IS-SA does not measure full spectral content, but only Tristimulus data. Monochrome is the same as Tristimulus Y (photopic).

Monochrome

There will only be one group of enumerated data between DataBegin and DataEnd. This group is labeled by an added line above the DataBegin line (line 14 in Table 1).

XYZ

There will be three groups of enumerated scatter data, one for each Tristimulus value. Each group is labeled by an added line above the DataBegin line (line 14 in Table 1).

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.

  1. There are two options for the ScatterType variable: BRDF, BTDF

BRDF

Reported data is in BRDF units. The coordinate system is defined so that Radial 0° corresponds to the angle of specular reflection.

BTDF

Reported data is in BTDF units. The coordinate system is defined so that Radial 0° corresponds to the angle of direct transmission.

5-12.  Value totals (lines 5, 7, 9, 11):

All value totals are expressed as positive integers (no decimal points allowed).

There is no upper limit to the number of sample rotations or incidence angles.

The upper limit of Azimuth angles is defined by the Symmetry variable (180° for PlaneSymmetrical, 360° for ASymmetrical, ASymmetrical4D).

The overall upper limit of Radial angles is 180°.

Enumeration values (lines 6, 8, 10, 12):

All enumeration values are positive.

The number of enumeration values must match the Value total from the line above.

Enumeration values do not have to be evenly spaced (See the example formats in the next section; the ScatterRadial and ScatterAzimuth enumerations are not evenly spaced). However, each data line must terminate at the end of the last enumeration value for that line (i.e. there should be no additional spaces or tabs at the end of the data line).

16. DataBegin and DataEnd statements surround each large group of data. 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.

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.

The enumeration formatting of scatter data changes depending on the settings chosen for the SpectralContent variable. If the SpectralContent variable is set to Monochrome, the formatting appears like Figures 3 and 4 in the next section. If the SpectralContent variable is set to XYZ, there are two additional DataBegin and DataEnd statement lines, with an extra label line above each DataBegin line that labels the data group with its associated Tristimulus value. See Figure 5 in the next section.

Example of BSDF data interchange formats

Monochrome

#Data Generated by Radiant Zemax' 'Imaging Sphere'

#6/1/2007 11:30:46 AM

#Name: Ron

#Model #: BTDF of matte sample

Source  Measured

Symmetry  PlaneSymmetrical

SpectralContent  Monochrome

ScatterType  BRDF

SampleRotation 1

0

AngleOfIncidence  6

0    10    20    30    45    60

ScatterAzimuth 5

0    30    60    90    180

ScatterRadial 15

0    1    2    3.5    5    6.7    8    13.1 ...

Monochrome

DataBegin

TIS 0.72

3.689E+00         3.575E+00         2.907E+00 ...

3.689E+00         3.585E+00         3.108E+00 ...

3.689E+00         3.585E+00         3.044E+00 ...

3.689E+00         3.511E+00         3.143E+00 ...

3.689E+00         3.313E+00         2.905E+00 ...

TIS 0.70

3.605E+00         3.491E+00         2.778E+00 ...

3.605E+00         3.444E+00         2.968E+00 ...

3.605E+00         3.444E+00         2.874E+00 ...

3.605E+00         3.316E+00         2.955E+00 ...

3.605E+00         3.206E+00         2.825E+00 ...

TIS 0.61

3.154E+00         3.059E+00         2.455E+00 ...

3.154E+00         2.924E+00         2.472E+00 ...

3.154E+00         2.924E+00         2.374E+00 ...

3.154E+00         2.768E+00         2.454E+00 ...

3.154E+00         2.892E+00         2.615E+00 ...

TIS 0.49

2.508E+00         2.453E+00         2.040E+00 ...

2.508E+00         2.341E+00         2.014E+00 ...

2.508E+00         2.341E+00         1.925E+00 ...

2.508E+00         2.203E+00         1.976E+00 ...

2.508E+00         2.311E+00         2.121E+00 ...

TIS 0.27

1.391E+00         1.362E+00         1.186E+00 ...

1.391E+00         1.351E+00         1.228E+00 ...

1.391E+00         1.351E+00         1.203E+00 ...

1.391E+00         1.324E+00         1.233E+00 ...

1.391E+00         1.323E+00         1.255E+00 ...

TIS 0.10

5.262E-01         5.333E-01         5.332E-01 ...

5.262E-01         5.295E-01         5.196E-01 ...

5.262E-01         5.295E-01         4.988E-01 ...

5.262E-01         5.122E-01         4.955E-01 ...

5.262E-01         5.070E-01         4.962E-01 ...

DataEnd

Figure 3: Example of Photopic (Monochrome) data formatting. There is only one contiguous data group, and one DataBegin and DataEnd statement. 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.

#Data Generated by Radiant Imaging's 'Imaging Sphere'

#6/1/2007 11:30:46 AM

#Name: Ron

#Model #: BTDF of matte sample

Source  Measured

Symmetry  PlaneSymmetrical

SpectralContent  Monochrome

ScatterType  BRDF

SampleRotation 1

0

AngleOfIncidence  6

0    10    20    30    45    60

ScatterAzimuth 5

0    30    60    90    180

ScatterRadial 15

0    1    2    3.5    5    6.7    8    13.1 ...

Monochrome

DataBegin                        Rad 1     Rad 2        ...

TIS 0.72

3.689E+00    Az 0      3.575E+00         2.907E+00 ...

3.689E+00    Az 30    3.585E+00         3.108E+00 ...

3.689E+00       .        3.585E+00         3.044E+00 ...    Inc 0

3.689E+00       .        3.511E+00         3.143E+00 ...

3.689E+00    Az 180  3.313E+00         2.905E+00 ...

TIS 0.70

3.605E+00          3.491E+00         2.778E+00 ...

3.605E+00          3.444E+00         2.968E+00 ...

3.605E+00          3.444E+00         2.874E+00 ...   Inc 10

3.605E+00          3.316E+00         2.955E+00 ...

3.605E+00          3.206E+00         2.825E+00 ...

TIS 0.61

3.154E+00          3.059E+00         2.455E+00 ...

3.154E+00          2.924E+00         2.472E+00 ...

3.154E+00          2.924E+00         2.374E+00 ...       .

3.154E+00          2.768E+00         2.454E+00 ...

3.154E+00          2.892E+00         2.615E+00 ...

TIS 0.49

2.508E+00          2.453E+00         2.040E+00 ...

2.508E+00          2.341E+00         2.014E+00 ...

2.508E+00          2.341E+00         1.925E+00 ...       .

2.508E+00          2.203E+00         1.976E+00 ...

2.508E+00          2.311E+00         2.121E+00 ...

TIS 0.27

1.391E+00          1.362E+00         1.186E+00 ...

1.391E+00          1.351E+00         1.228E+00 ...

1.391E+00          1.351E+00         1.203E+00 ...        .

1.391E+00          1.324E+00         1.233E+00 ...

1.391E+00          1.323E+00         1.255E+00 ...

TIS 0.10

5.262E-01          5.333E-01         5.332E-01 ...

5.262E-01          5.295E-01         5.196E-01 ...

5.262E-01          5.295E-01         4.988E-01 ...   Inc 60

5.262E-01          5.122E-01         4.955E-01 ...

5.262E-01          5.070E-01         4.962E-01 ...

DataEnd

Figure 4: Illustrated example of Photopic (Monochrome) data formatting. There is only one contiguous data group, and one DataBegin and DataEnd statement. The figure shows graphically the placement of Incidence angle groups, Azimuth angle groups, and Radial angle columns (3 of the 15 total columns are shown). 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.

#Data Generated by Radiant Imaging's 'Imaging Sphere'

#6/1/2007 11:30:46 AM

#Name: Ron

#Model #: BTDF of matte sample

Source  Measured

Symmetry  PlaneSymmetrical

SpectralContent  XYZ

ScatterType  BRDF

SampleRotation 1

0

AngleOfIncidence  6

0    10    20    30    45    60

ScatterAzimuth 5

0    30    60    90    180

ScatterRadial 15

0    1    2    3.5    5    6.7    8    13.1 ...

TristimulusX

DataBegin

TIS 0.72

3.689E+00         3.575E+00         2.907E+00 ...

3.689E+00         3.585E+00         3.108E+00 ...

3.689E+00         3.585E+00         3.044E+00 ...

3.689E+00         3.511E+00         3.143E+00 ...

3.689E+00         3.313E+00         2.905E+00 ...

TIS 0.70

3.605E+00         3.491E+00         2.778E+00 ...

3.605E+00         3.444E+00         2.968E+00 ...

3.605E+00         3.444E+00         2.874E+00 ...

3.605E+00         3.316E+00         2.955E+00 ...

3.605E+00         3.206E+00         2.825E+00 ...

TIS 0.61

3.154E+00         3.059E+00         2.455E+00 ...

3.154E+00         2.924E+00         2.472E+00 ...

3.154E+00         2.924E+00         2.374E+00 ...

3.154E+00         2.768E+00         2.454E+00 ...

3.154E+00         2.892E+00         2.615E+00 ...

TIS 0.49

2.508E+00         2.453E+00         2.040E+00 ...

2.508E+00         2.341E+00         2.014E+00 ...

2.508E+00         2.341E+00         1.925E+00 ...

2.508E+00         2.203E+00         1.976E+00 ...

2.508E+00         2.311E+00         2.121E+00 ...

TIS 0.27

1.391E+00         1.362E+00         1.186E+00 ...

1.391E+00         1.351E+00         1.228E+00 ...

1.391E+00         1.351E+00         1.203E+00 ...

1.391E+00         1.324E+00         1.233E+00 ...

1.391E+00         1.323E+00         1.255E+00 ...

TIS 0.10

5.262E-01         5.333E-01         5.332E-01 ...

5.262E-01         5.295E-01         5.196E-01 ...

5.262E-01         5.295E-01         4.988E-01 ...

5.262E-01         5.122E-01         4.955E-01 ...

5.262E-01         5.070E-01         4.962E-01 ...

DataEnd

 

TristimulusY

DataBegin

TIS 0.72

3.689E+00         3.575E+00         2.907E+00 ...

3.689E+00         3.585E+00         3.108E+00 ...

3.689E+00         3.585E+00         3.044E+00 ...

3.689E+00         3.511E+00         3.143E+00 ...

Figure 5: Example of Color (XYZ) data formatting. 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.

KA-01372

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.