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