Creating a BRDF file and using it as a bottom boundary

From PlanarRad
Jump to navigation Jump to search

It is possible to use PlanarRad to generate a BRDF file that can then be used as input as the bottom boundary condition for another run. One reason to do this is to implement a layered media. Currently PlanarRad only supports vertically homogenous media, but a two layer system (for example) can be modelled by generating BRDF for the lower layer and then using that as the bottom boundary for the upper layer.

The key points are this:

  • Generating the BRDF file requires 10 runs, one for each incident theta position of 0, 10, 20, 30, 40, 50, 60, 70, 80 and 87.5 degrees.
  • For layers where the refractive index does not change substantially (most likely for layers where the embedding media is the same but constituents change) the runs for generating the BRDF file should use the 'non-existent' interface option 'None'.
  • The separate tool 'reflectool' must be run from the command line to generate the BRDF file from the ten runs.
  • Then to model the upper layer is a standard run with normal interface settings and uses the the BRDF file for the lower boundary.
  • A simple test procedure to verify everything works OK is to do a model with two layers that have same optical properties and compare that to a single run for the depth of the two layers added together, the light field in the top half of the media should be identical.

This page gives a worked example for a model of two layers and demonstrates the verification that the output is correct.

Characterising the BRDF

To make a BRDF file requires that we have data on the full hemisphere of light reflected in every exitant direction for every incident direction, from a surface. In PlanarRad the standard directional discretisation for a hemisphere contains 217 quads, so the BRDF for one wavelength is a table of 217 x 217 numbers. To populate this table we can run PlanarRad with all the incident light in just one quad, and that will give us the 217 values, one for each exitant direction, for that particular incident direction. So on the face of it 217 PlanarRad runs would be required to characterise the whole BRDF. However, in almost all cases we can assume the BRDF is rotationally invariant.

The meaning of rotational invariance is this: Imagine you are looking at a surface from an angle and the sun is off to the right somewhere. You and the sun stay in the same place but the surface is rotated in a horizontal plane - it still looks the same. In PlanarRad currently the only way non-rotationally invariant results can be obtained is when using windblown air-water interface. Any runs using a flat or non-existent interface are rotationally invariant. The interface option of 'none' is what is normally required for a BRDF of a lower layer in a media. This means only 10 runs are required to characterise the BRDF, one for each incident theta row (zenith position) in the hemisphere. We can set the incident azimuth to zero for all runs and that will be enough information to characterise the BRDF.

Example model

For the example here we will generate a single wavelength BRDF for a 5m depth, attenuation c = 0.3, absorption a = 0.1, Petzold phase function, and bottom boundary black (reflectance = 0). Then we will input that as the bottom boundary for another run of 5m depth with the same optical properties. The result should be the same as a 10m run with black bottom boundary. We will verify that it is and then modify the upper layer to get a layered media result.

Runs to characterise the BRDF (GUI)

The basic procedure is the same as described on this page: BRDF of a material with isotropic phase function, but with a few important changes. Assuming you are able to successfully follow the procedure on that page, do this:

1) Set the interface properties to 'None'. In the parameters file the parameter is 'iface_type = absent'.

Error creating thumbnail: Unable to save thumbnail to destination


2) Set the medium optical properties. In particular we'll use Petzold's phase function and not an isotropic phase function, because Petzold's phase function is forward peaked and so should induce more directionality into the BRDF and be a clearer test.

Error creating thumbnail: Unable to save thumbnail to destination


3) Set the depth to 5m.

Error creating thumbnail: Unable to save thumbnail to destination


4) To generate the BRDF the lower boundary for the bottom layer will be black, i.e. the lower boundary of the whole system (the two layers) is black.

Error creating thumbnail: Unable to save thumbnail to destination


5) Now everything that has been set will be constant and we need to do 10 runs varying the direction of the incident light. That means ten runs where zenith angle is 0, 10, 20, 30, 40, 50, 60, 70, 80 and 87.5. The name of the run should be changed each time, For example 'run_theta0', 'run_theta10', 'run_theta20' ... 'run_theta_87p5'. Note the other parameters: azimuth of zero and cosine parameter of 1, diffuse ratio 0. These set all the incident light to be in a single quad at azimuth position zero. If these are not set correctly reflectool will report an error later when building the BRDF file.

So just perform ten runs varying changing the items highlighted below.

Error creating thumbnail: Unable to save thumbnail to destination


To generate the files from a script as described on this page: Command line running (Linux) the parameters file would look like the below. The sky files and interface file need to be pre-prepared which is most easily done by GUI runs as described above. In the below I have assumed the sky files have been renamed based on the theta value as 'input0_rd_HL18x24_1', 'input10_rd_HL18x24_1', etc. and the interface file has been renamed 'iface_absent_rdd_HL18x24_1'. It is slightly confusing that these are referred to as 'sky' and 'water_surface' in the parameters, as in this context they are really just incident light and interface. So, for the ten runs the options under 'name = run_theta30' and 'sky_fp = ...' should be changed for each run.

name = run_theta30

band_spec_fp = bands1.bsf

partition = sphere
vn = 18
hn = 24
theta_points = 0,5,15,25,35,45,55,65,75,85,90,95,105,115,125,135,145,155,165,175,180

depth = 5
sample_point_distance = 1
sample_point_delta_distance = 0.01

sky_fp = input30_rd_HL18x24_1

water_surface_fp = iface_absent_rdd_HL18x24_1

pf_fp = pf_rdd_HL18x24_1

atten_data = 0.3
absorp_data = 0.1

bottom_reflec_diffuse_data = 0

report_save_fp = report.txt

verbose = 6