-
The files fit_o*.mat contain the fitted parameters for the BSDF, i.e., the equations in §5.4 of the thesis.
-
The files fitXZ8_o*.mat contain the fitted parameters for the moments of the spatial distribution, i.e., the equations in §5.3 of the thesis.
-
The numbers in the file names corresponds to the orders of scattering that where fitted (under the form n+1). fit_o1.mat contains the fitted parameters for order 2. fitXZ8_o6-8.mat contains the fitted parameters for the orders [7,9]. fit_o15p.mat contains the fitted parameters for the orders [16,∞], etc.
BSDF parameters
When you open the matlab files for the BSDF parameters (
fit_o*.mat), you will find the following variables in the workspace. All the variables follow the same "table of control points" format.
Peak value
-
The variable 'a' contains the fitted values for A1(n, z1, θ) (used in equation 5.48 in the thesis). It the I3D paper, it corresponds to A(t, μV). It is a table of control points. Each row of the table is a control point. Each control point has 3 values:
-
z1 (in meters)
-
θ (under the form -cos(θ) I believe, i.e., μV in the I3D paper)
-
A1
For example if you open fit_o2.mat, and read [50,-0.6,0.039801] in the 3rd row, that means A1( n=3, z1=50m, θ=cos-1(0.6) ) = 0.039801. And so on.
Note there is a discontinuity around θ=90°. That is normal and expected.
-
The variable 'x' contains the fitted values for A2(n, z1, θ') (used in equation 5.48 in the thesis). It the I3D paper, it corresponds to X(t, μL). Each control point has 3 values:
For example if you open fit_o2.mat, and read [50,0.2,1.904] in the 3rd row, that means A2( n=3, z1=50m, θ'=cos-1(0.2) ) = 1.904. And so on.
Note that A2 is normalized so that A2(n, z1, 0) = 1, as explained in the thesis. Also, θ' ranges from 0° to 90° (whereas θ ranges from 0° to 180°), which is normal since the slab can only be lit from above.
Peak location
-
The variable 'b1' contains the fitted values for B1(n, z1, θ) (used in equation 5.49 in the thesis). It the I3D paper, it corresponds to B1(t, μV). Each control point has 3 values:
-
z1 (in meters)
-
θ (under the form -cos(θ) I believe, i.e., μV in the I3D paper)
-
B1
For example if you open fit_o2.mat, and read [50,-0.6,9.2099] in the 3rd row, that means B1( n=3, z1=50m, θ=cos-1(0.6) ) = 9.2099. And so on.
-
The variable 'b2' contains the fitted values for B2(n, z1, θ') (used in equation 5.49 in the thesis). It the I3D paper, it corresponds to B2(t, μL). Each control point has 3 values:
-
z1 (in meters)
-
θ' (under the form cos(θ') I believe, i.e., μL in the I3D paper)
-
B2
For example if you open fit_o2.mat, and read [50,0.2,26.066] in the 3rd row, that means B2( n=3, z1=50m, θ=cos-1(0.2) ) = 26.066. And so on.
Broadness
-
The variable 'c' contains the fitted values for C(n, z1, θ) (used in equation 5.50 in the thesis). It the I3D paper, it corresponds to C(t, μV). Each control point has 3 values:
-
z1 (in meters)
-
θ (under the form -cos(θ) I believe, i.e., μV in the I3D paper)
-
C
For example if you open
fit_o2.mat, and read [50,-0.6,18.529] in the 3rd row, that means
C( n=3, z1=50m, θ=cos-1(0.6) ) = 18.529. And so on.
Logarithmic behavior
-
The variable 'd' contains the fitted values for D(n, z1, θ) (used in equation 5.51 in the thesis). It the I3D paper, it corresponds to D(t, μV). Each control point has 3 values:
-
z1 (in meters)
-
θ (under the form -cos(θ) I believe, i.e., μV in the I3D paper)
-
D
For example if you open
fit_o2.mat, and read [50,-0.6,631.07] in the 3rd row, that means
D( n=3, z1=50m, θ=cos-1(0.6) ) = 631.07. And so on.
Anisotropy
-
The variable 'p' contains the fitted values for P(n, Θ) (used in equation 5.52 in the thesis). It the I3D paper, it corresponds to P(θ). Each control point has 3 values:
-
z1 (in meters)
-
Θ (under the form cos(Θ) I believe)
-
P
Note there is an inconsistency here: although in the thesis and paper we say that
P does not depend on
z1, we have
z1 as a parameter in the tables. This is simply due to the fact that the fitting was done per slab thickness. If you observe the data, you will note that the values for
P are actually almost identical for a given
Θ, regardless of
z1. This is a nice validation of our assumption that
P does not depend on
z1. In consequence, to read the value for
P, you can either read the values of
P for an arbitrary
z1, or read
P for all values of
z1 and take the average. I think we did the latter.
For example if you open fit_o2.mat, and read
-
[50, -0.5, 2.2514] in the 3rd row,
-
[100, -0.5, 2.0483] in the 12th row,
-
[200, -0.5, 2.0575] in the 21st row,
-
[250, 0.5, 2.0711] in the 30th row,
-
[300, -0.5, 2.0132] in the 39th row,
-
[400, -0.5, 2.0722] in the 48th row and
-
[500, -0.5, 2.0974] in the 57th row,
that means
P( n=3, Θ=cos-1(0.5) ) = 2.0873. And so on.
Finally, note that there is no data for
P(n=[16,∞]
, Θ). This is normal: these orders are isotropic, therefore
P(n=[16,∞]
, Θ)=1 everywhere, as explained in the thesis.
-
I would also like to remind you that z' is the viewpoint depth: z'=z1-z (thesis p. 114).
-
Finally, bear in mind that P(n) (equation 5.26) is not at all the same function than P(n, Θ) (equation 5.52). Similarly, g in equations 5.11 and 5.17 is not the assymetry parameter of the phase function. This is just the result of a poor naming convention.
First moment
Matlab variable
|
Thesis function equivalent
|
Control points
|
I3D paper function equivalent
|
b
|
O(n, μ, μ') (eq.5.24)
|
Column 1&2: -μ (i.e., μV in the I3D paper), Column 3: μ', Column 4: O
|
N(μV, μL)
|
c
|
I(n, μ) (eq.5.19)
|
Column 1: -μ (i.e., μV in the I3D paper), Column 2: I
|
I(μV)
|
d
|
M(n, μ) (eq.5.23)
|
Column 1: -μ (i.e., μV in the I3D paper), Column 2: M
|
M(μV)
|
e
|
E(n, μ) (eq.5.15)
|
Column 1: -μ (i.e., μV in the I3D paper), Column 2: E
|
E(μV)
|
j
|
G(n, μ) (eq.5.20)
|
Column 1: -μ (i.e., μV in the I3D paper), Column 2: G
|
G(μV)
|
k
|
F(n, μ) (eq.5.16)
|
Column 1: -μ (i.e., μV in the I3D paper), Column 2: F
|
F(μV)
|
l
|
H(n, μ) (eq.5.18)
|
Column 1: -μ (i.e., μV in the I3D paper), Column 2: H
|
H(μV)
|
u
|
K(n, μ) (eq.5.21)
|
Column 1: -μ (i.e., μV in the I3D paper), Column 2: K
|
K(μV)
|
v
|
L(n, μ) (eq.5.22)
|
Column 1: -μ (i.e., μV in the I3D paper), Column 2: L
|
L(μV)
|
w
|
J(n, μ) (eq.5.20)
|
Column 1: -μ (i.e., μV in the I3D paper), Column 2: J
|
J(μV)
|
Second moment
The equation 5.25 in the thesis should be
σ(n, z1, z, θ, ψ, θ') = p + q z1 log(1 + rz') + s log(1 + tz1), n=[16,∞]
σ(n, z1, z, θ, ψ, θ') = Sa + Sb log(1 + Sc z'), n<16
With these equations, the data for
n=[16,∞] is not present in the matlab files. Here are the values:
P(n=[16,∞]
) = 171.0
Q(n=[16,∞]
) = 0.1645
R(n=[16,∞]
) = 0.002321
S(n=[16,∞]
) = 504.6956
T(n=[16,∞]
) = 0.00096153
For
n<16, the parameters
Sa, Sb, Sc are defined by the scalar variables
sa,
sb, and
sc in the matlab files.
Values outside the control points
The parameters have been fitted only for the given control points. To compute the value of a parameter outside the control points, you have to interpolate. The choice of the interpolation method is important, as it will give different results. We used the
linspace() matlab function to sample uniformly the domain, then interpolated using
interp1() for 1D data and
griddata() for 2D data. Although it is tempting to use a
cubic or
spline interpolation method to get smooth variations, these are bad choices as they result in overshoots. Thus we interpolated all the data using the
linear method, which gave satisfactory results. Care must be taken to interpolate finely enough so that the discontinuities are not smoothed out.