ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/doc/man/man1/bsdf2ttree.1
Revision: 1.8
Committed: Mon May 18 20:08:57 2020 UTC (5 years ago) by greg
Branch: MAIN
CVS Tags: rad5R3
Changes since 1.7: +18 -1 lines
Log Message:
Added -n and -s options to bsdf2ttree to control super-sampling

File Contents

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