1 |
greg |
1.3 |
.\" RCSid $Id: bsdf2ttree.1,v 1.2 2013/08/02 20:56:19 greg Exp $ |
2 |
greg |
1.1 |
.TH BSDF2TTREE 1 4/24/2013 RADIANCE |
3 |
|
|
.SH NAME |
4 |
|
|
bsdf2ttree - generate XML tensor tree description of a BSDF |
5 |
|
|
.SH SYNOPSIS |
6 |
|
|
.B bsdf2ttree |
7 |
|
|
[ |
8 |
|
|
.B "\-g Nlog2" |
9 |
|
|
][ |
10 |
greg |
1.3 |
.B "\-t pctcull" |
11 |
|
|
][ |
12 |
|
|
.B "\-l maxlobes" |
13 |
greg |
1.1 |
] |
14 |
|
|
[ |
15 |
|
|
.B "bsdf.sir .." |
16 |
|
|
] |
17 |
|
|
.br |
18 |
|
|
or |
19 |
|
|
.br |
20 |
|
|
.B bsdf2ttree |
21 |
|
|
.B "\-t{3|4}" |
22 |
|
|
[ |
23 |
|
|
.B "\-g Nlog2" |
24 |
|
|
][ |
25 |
greg |
1.3 |
.B "\-t pctcull" |
26 |
greg |
1.1 |
][ |
27 |
|
|
.B "{+|-}forward" |
28 |
|
|
][ |
29 |
|
|
.B "{+|-}backward" |
30 |
|
|
][ |
31 |
greg |
1.3 |
.B "\-e expr" |
32 |
greg |
1.1 |
][ |
33 |
greg |
1.3 |
.B "\-f file" |
34 |
greg |
1.1 |
] |
35 |
|
|
.B bsdf_func |
36 |
|
|
.SH DESCRIPTION |
37 |
|
|
.I Bsdf2ttree |
38 |
|
|
produces a tensor tree representation of a |
39 |
|
|
bidirectional scattering distribution function (BSDF) |
40 |
|
|
based on an intermediate representation (in the first form) or |
41 |
|
|
a functional description (in the second form). |
42 |
|
|
A complete XML description is written to the standard output, |
43 |
|
|
which is normally redirected to a file. |
44 |
|
|
.PP |
45 |
|
|
The maximum resolution of the tensor tree may be controlled by the |
46 |
|
|
.I \-g |
47 |
|
|
option, which defaults to a value of 6. |
48 |
|
|
This corresponds to a peak resolution of 2^6 (64) in each dimension. |
49 |
|
|
Due to memory and time constraints, it is not recommended to set |
50 |
|
|
.I \-g |
51 |
|
|
higher than 7, which corresponds to a 128x128x128x128 initial sampling, |
52 |
|
|
or 268 million values. |
53 |
|
|
.PP |
54 |
|
|
The initial sampling is pared down by the percentage specified with the |
55 |
|
|
.I \-t |
56 |
|
|
option, which defaults to 90. |
57 |
|
|
Setting this parameter to -1 turns culling off entirely, which may be |
58 |
|
|
useful for comparisons. |
59 |
|
|
.PP |
60 |
|
|
The first invocation form takes a intermediate scattering representation |
61 |
|
|
as produced by |
62 |
|
|
.I pabopto2bsdf(1) |
63 |
|
|
or similar, and produces a tensor tree representation with as many |
64 |
|
|
components as there are independent input distributions. |
65 |
|
|
Each intermediate scattering file contains one of |
66 |
|
|
the four components, and if the first component |
67 |
|
|
is isotropic, all components must be isotropic. |
68 |
|
|
A similar rule holds for anisotropic inputs. |
69 |
greg |
1.3 |
The |
70 |
|
|
.I \-l |
71 |
|
|
option may be used to specify the maximum number of lobes in any |
72 |
|
|
interpolated radial basis function. |
73 |
|
|
The default value is 15000, which generally keeps the interpolation tractable. |
74 |
|
|
Setting the value to 0 turns off this limit. |
75 |
greg |
1.1 |
.PP |
76 |
|
|
In the second invocation form, |
77 |
|
|
.I bsdf2ttree |
78 |
|
|
takes a functional specification of a BSDF. |
79 |
greg |
1.2 |
The named function should accept 6 parameters corresponding to the |
80 |
greg |
1.1 |
normalized incident and exiting vectors, respectively. |
81 |
|
|
By convention, these vectors point away from the surface, and a positive |
82 |
|
|
Z-component corresponds to the front side. |
83 |
|
|
The Y-component corresponds to the "up" orientation of the surface, |
84 |
|
|
as specified in the eventual scene description that references the XML |
85 |
|
|
output. |
86 |
greg |
1.2 |
If the function only takes 3 parameters, then the variables "Dx", "Dy", |
87 |
|
|
and "Dz" will be assigned to the reverse of the outgoing direction at |
88 |
|
|
each evaluation. |
89 |
|
|
(I.e., the vector will point into the surface and |
90 |
|
|
Dz will be negative on the front side.)\0 |
91 |
|
|
This simplifies conversion of functional BSDF specifications using the |
92 |
|
|
legacy material primitives "plasfunc", "metfunc", and "transfunc". |
93 |
greg |
1.1 |
.PP |
94 |
|
|
The function is defined by one or more |
95 |
|
|
.I \-e |
96 |
|
|
and |
97 |
|
|
.I \-f |
98 |
|
|
options, and should obey both Helmholtz reciprocity and |
99 |
|
|
integrate to less than 1 over each projected incident hemisphere |
100 |
|
|
for energy conservation. |
101 |
|
|
If the |
102 |
|
|
.I \-t3 |
103 |
|
|
option is specified, the defined function is assumed to be isotropic. |
104 |
|
|
If the |
105 |
|
|
.I \-t4 |
106 |
|
|
option is given, the function is assumed to be anisotropic. |
107 |
|
|
.PP |
108 |
|
|
Similar to the |
109 |
|
|
.I genBSDF(1) |
110 |
|
|
command, |
111 |
|
|
the |
112 |
|
|
.I \+backward |
113 |
|
|
option (default) specifies that rays arriving from the front side of |
114 |
|
|
the surface will be tested for reflection and transmission. |
115 |
|
|
If both forward and backward (front and back) distributions are needed, the |
116 |
|
|
.I \+forward |
117 |
|
|
option may be given. |
118 |
|
|
To turn off the backward components, use the |
119 |
|
|
.I \-backward |
120 |
|
|
option. |
121 |
|
|
Computing both incident hemispheres takes about twice as long as one, but |
122 |
|
|
is recommended when rays will be impinging from either side. |
123 |
|
|
.SH EXAMPLE |
124 |
|
|
To take two components of an intermediate BSDF representation and create |
125 |
|
|
a high-resolution tensor tree with 85% culling: |
126 |
|
|
.IP "" .2i |
127 |
|
|
bsdf2ttree -g 7 -t 85 transmitted.sir reflected.sir > combined.xml |
128 |
|
|
.PP |
129 |
|
|
To create a low-res BSDF corresponding to a one-sided, |
130 |
|
|
isotropic Phong distribution: |
131 |
|
|
.IP "" .2i |
132 |
|
|
bsdf2ttree -g 5 -t3 -e 'phong(ix,iy,iz,ox,oy,oz) = if(iz, .1+((iz+oz)/sqrt((ix+ox)^2+(iy+oy)^2+(iz+oz)^2))^50, 0)' phong > phong.xml |
133 |
|
|
.SH AUTHOR |
134 |
|
|
Greg Ward |
135 |
|
|
.SH "SEE ALSO" |
136 |
|
|
bsdf2klems(1), icalc(1), genBSDF(1), pkgBSDF(1) |