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