ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/doc/man/man1/bsdf2klems.1
Revision: 1.4
Committed: Wed Mar 12 21:15:31 2014 UTC (10 years, 3 months ago) by greg
Branch: MAIN
CVS Tags: rad4R2P2, rad4R2, rad4R2P1
Changes since 1.3: +14 -1 lines
Log Message:
Disabled DEBUG statements in BSDF programs and added progress bars

File Contents

# Content
1 .\" RCSid $Id: bsdf2klems.1,v 1.3 2013/09/26 17:05:00 greg Exp $
2 .TH BSDF2KLEMS 1 4/24/2013 RADIANCE
3 .SH NAME
4 bsdf2klems - generate XML Klems matrix description of a BSDF
5 .SH SYNOPSIS
6 .B bsdf2klems
7 [
8 .B "\-n spp"
9 ][
10 .B "\-h|\-q"
11 ][
12 .B "\-pC"
13 ][
14 .B "\-l maxlobes"
15 ]
16 [
17 .B "bsdf.sir .."
18 ]
19 .br
20 or
21 .br
22 .B bsdf2klems
23 [
24 .B "\-n spp"
25 ][
26 .B "\-h|\-q"
27 ][
28 .B "\-pC"
29 ]
30 .B bsdf_in.xml
31 .br
32 or
33 .br
34 .B bsdf2klems
35 [
36 .B "\-n spp"
37 ][
38 .B "\-h|\-q"
39 ][
40 .B "\-pC"
41 ][
42 .B "{+|-}forward"
43 ][
44 .B "{+|-}backward"
45 ][
46 .B "\-e expr"
47 ][
48 .B "\-f file"
49 ]
50 .B bsdf_func
51 .SH DESCRIPTION
52 .I Bsdf2klems
53 produces a Klems matrix representation of a
54 bidirectional scattering distribution function (BSDF)
55 based on an intermediate representation (in the first form),
56 an input XML representation (in the second form),
57 or a functional description (in the third form).
58 A complete XML description is written to the standard output,
59 which is normally redirected to a file.
60 .PP
61 The Klems matrix representation divides the input and output
62 hemisphere into a default 145 patches.
63 The
64 .I \-h
65 option may be used to reduce this number to 73 patches per hemisphere.
66 The
67 .I \-q
68 option may be used to reduce this number to 41 patches.
69 Neither option is recommended unless the distribution is known to
70 be approximately diffuse.
71 .PP
72 The
73 .I \-p
74 option by itself turns off the progress bar, whose length may be set
75 by an immediately following integer argument.
76 (The default progress bar length is 79 characters.)\0
77 .PP
78 The
79 .I \-l
80 option may be used to specify the maximum number of lobes in any
81 interpolated radial basis function.
82 The default value is 15000, which generally keeps the interpolation tractable.
83 Setting the value to 0 turns off this limit.
84 .PP
85 Normally, multiple samples are taken from random points on each input
86 and output patch to improve accuracy.
87 The number of samples to take for each input-output patch pair may
88 be controlled using the
89 .I \-n
90 option, which defaults to 256.
91 .PP
92 The first invocation form takes a intermediate scattering representation
93 as produced by
94 .I pabopto2bsdf(1)
95 or similar, and produces a Klems representation with as many
96 components as there are independent input distributions.
97 Each intermediate scattering file contains one of
98 the four components, and if the first component
99 is isotropic, all components must be isotropic.
100 A similar rule holds for anisotropic inputs.
101 Only the center of each incident patches is sampled, due to
102 the time required to interpolate incident positions.
103 .PP
104 In the second invocation form, an input XML representation
105 is resampled to produce the desired Klems matrix representation.
106 This is primarily used to convert a tensor tree representation
107 into a matrix for annual daylighting simulations.
108 Any components in the input are reproduced on output, and inline
109 geometric descriptions are passed unchanged.
110 .PP
111 In the third invocation form,
112 .I bsdf2klems
113 takes a functional specification of a BSDF.
114 The named function should accept 6 parameters corresponding to the
115 normalized incident and exiting vectors, respectively.
116 By convention, these vectors point away from the surface, and a positive
117 Z-component corresponds to the front side.
118 The Y-component corresponds to the "up" orientation of the surface,
119 as specified in the eventual scene description that references the XML
120 output.
121 If the function only takes 3 parameters, then the variables "Dx", "Dy",
122 and "Dz" will be assigned to the reverse of the outgoing direction at
123 each evaluation.
124 (I.e., the vector will point into the surface and
125 Dz will be negative on the front side.)\0
126 This simplifies conversion of functional BSDF specifications using the
127 legacy material primitives "plasfunc", "metfunc", and "transfunc".
128 .PP
129 The function is defined by one or more
130 .I \-e
131 and
132 .I \-f
133 options, and should obey both Helmholtz reciprocity and
134 integrate to less than 1 over each projected incident hemisphere
135 for energy conservation.
136 .PP
137 Similar to the
138 .I genBSDF(1)
139 command,
140 the
141 .I \+backward
142 option (default) specifies that rays arriving from the front side of
143 the surface will be tested for reflection and transmission.
144 If both forward and backward (front and back) distributions are needed, the
145 .I \+forward
146 option may be given.
147 To turn off the backward components, use the
148 .I \-backward
149 option.
150 Computing both incident hemispheres takes about twice as long as one, but
151 is recommended when rays will be impinging from either side.
152 .SH EXAMPLE
153 To take two components of an intermediate BSDF representation and create
154 a full Klems matrix representation:
155 .IP "" .2i
156 bsdf2klems transmitted.sir reflected.sir > combined.xml
157 .PP
158 To reduce a tensor tree representation into a half-Klems matrix representation:
159 .IP "" .2i
160 bsdf2klems -h ttree.xml > klems_half.xml
161 .PP
162 To create a low-res BSDF corresponding to a one-sided,
163 isotropic Phong distribution:
164 .IP "" .2i
165 bsdf2klems -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
166 .SH AUTHOR
167 Greg Ward
168 .SH "SEE ALSO"
169 bsdf2ttree(1), dctimestep(1), icalc(1), gendaymtx(1), genklemsamp(1),
170 genskyvec(1), mkillum(1), genBSDF(1), pkgBSDF(1), rcontrib(1), rtrace(1)