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