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