| 1 |
.\" RCSid "$Id: rtcontrib.1,v 1.23 2010/09/26 15:51:14 greg Exp $"
|
| 2 |
.TH RTCONTRIB 1 5/25/05 RADIANCE
|
| 3 |
.SH NAME
|
| 4 |
rtcontrib - compute contribution coefficients in a RADIANCE scene
|
| 5 |
.SH SYNOPSIS
|
| 6 |
.B rtcontrib
|
| 7 |
[
|
| 8 |
.B "\-n nprocs"
|
| 9 |
][
|
| 10 |
.B \-V
|
| 11 |
][
|
| 12 |
.B "\-c count"
|
| 13 |
][
|
| 14 |
.B \-fo
|
| 15 |
|
|
| 16 |
.B \-r
|
| 17 |
][
|
| 18 |
.B "\-e expr"
|
| 19 |
][
|
| 20 |
.B "\-f source"
|
| 21 |
][
|
| 22 |
.B "\-o ospec"
|
| 23 |
][
|
| 24 |
.B "\-b binv"
|
| 25 |
][
|
| 26 |
.B "\-bn nbins"
|
| 27 |
]
|
| 28 |
{
|
| 29 |
.B "\-m mod | \-M file"
|
| 30 |
}
|
| 31 |
..
|
| 32 |
[
|
| 33 |
.B $EVAR
|
| 34 |
]
|
| 35 |
[
|
| 36 |
.B @file
|
| 37 |
]
|
| 38 |
[
|
| 39 |
rtrace options
|
| 40 |
]
|
| 41 |
.B octree
|
| 42 |
.br
|
| 43 |
.B "rtcontrib [ options ] \-defaults"
|
| 44 |
.SH DESCRIPTION
|
| 45 |
.I Rtcontrib
|
| 46 |
computes ray coefficients
|
| 47 |
for objects whose modifiers are named in one or more
|
| 48 |
.I \-m
|
| 49 |
settings.
|
| 50 |
These modifiers are usually materials associated with
|
| 51 |
light sources or sky domes, and must directly modify some geometric
|
| 52 |
primitives to be considered in the output.
|
| 53 |
A modifier list may also be read from a file using the
|
| 54 |
.I \-M
|
| 55 |
option.
|
| 56 |
The RAYPATH environment variable determines directories to search for
|
| 57 |
this file.
|
| 58 |
(No search takes place if a file name begins with a '.', '/' or '~'
|
| 59 |
character.)\0
|
| 60 |
.PP
|
| 61 |
If the
|
| 62 |
.I \-n
|
| 63 |
option is specified with a value greater than 1, multiple
|
| 64 |
.I rtrace
|
| 65 |
processes will be used to accelerate computation on a shared
|
| 66 |
memory machine.
|
| 67 |
Note that there is no benefit to using more processes
|
| 68 |
than there are local CPUs available to do the work, and the
|
| 69 |
.I rtcontrib
|
| 70 |
process itself may use a considerable amount of CPU time.
|
| 71 |
.PP
|
| 72 |
By setting the boolean
|
| 73 |
.I \-V
|
| 74 |
option, you may instruct
|
| 75 |
.I rtcontrib
|
| 76 |
to report the contribution from each material rather than the ray
|
| 77 |
coefficient.
|
| 78 |
This is particularly useful for light sources with directional output
|
| 79 |
distributions, whose value would otherwise be lost in the shuffle.
|
| 80 |
With the default
|
| 81 |
.I -V-
|
| 82 |
setting, the output of rtcontrib is a coefficient that must be multiplied
|
| 83 |
by the radiance of each material to arrive at a final contribution.
|
| 84 |
This is more convenient for computing daylight coefficeints, or cases
|
| 85 |
where the actual radiance is not desired.
|
| 86 |
Use the
|
| 87 |
.I -V+
|
| 88 |
setting when you wish to simply sum together contributions
|
| 89 |
(with possible adjustment factors) to obtain a final radiance value.
|
| 90 |
Combined with the
|
| 91 |
.I \-i
|
| 92 |
or
|
| 93 |
.I \-I
|
| 94 |
option, irradiance contributions are reported by
|
| 95 |
.I \-V+
|
| 96 |
rather than radiance, and
|
| 97 |
.I \-V-
|
| 98 |
coefficients contain an additonal factor of PI.
|
| 99 |
.PP
|
| 100 |
The
|
| 101 |
.I \-c
|
| 102 |
option tells
|
| 103 |
.I rtcontrib
|
| 104 |
how many rays to accumulate for each record.
|
| 105 |
The default value is 1, meaning a full record will be produced for
|
| 106 |
each input ray.
|
| 107 |
For values greater than 1, contributions will be averaged together
|
| 108 |
over the given number of input rays.
|
| 109 |
If set to zero, only a single record will be produced at the very
|
| 110 |
end, corresponding to the sum of all rays given on the input
|
| 111 |
(rather than the average).
|
| 112 |
This is equivalent to passing all the output records through a program like
|
| 113 |
.I total(1)
|
| 114 |
to sum RGB values together, but is much more efficient.
|
| 115 |
Using this option, it is possible to reverse sampling, sending rays from
|
| 116 |
a parallel source such as the sun to a diffuse surface, for example.
|
| 117 |
Note that output flushing via zero-direction rays is disabled
|
| 118 |
for accumulated evaluations.
|
| 119 |
.PP
|
| 120 |
The output of
|
| 121 |
.I rtcontrib
|
| 122 |
has many potential uses.
|
| 123 |
Source contributions can be used as components in linear combination to
|
| 124 |
reproduce any desired variation, e.g., simulating lighting controls or
|
| 125 |
changing sky conditions via daylight coefficients.
|
| 126 |
More generally,
|
| 127 |
.I rtcontrib
|
| 128 |
can be used to compute arbitrary input-output relationships in optical
|
| 129 |
systems, such as luminaires, light pipes, and shading devices.
|
| 130 |
.PP
|
| 131 |
.I Rtcontrib
|
| 132 |
calls
|
| 133 |
.I rtrace(1)
|
| 134 |
with the \-oTW (or \-oTV) option to calculate the daughter ray
|
| 135 |
contributions for each input ray, and the output tallies
|
| 136 |
are sent to one or more destinations according to the given
|
| 137 |
.I \-o
|
| 138 |
specification.
|
| 139 |
If a destination begins with an exclamation mark ('!'), then
|
| 140 |
a pipe is opened to a command and data is sent to its standard input.
|
| 141 |
Otherwise, the destination is treated as a file.
|
| 142 |
An existing file of the same name will not be clobbered, unless the
|
| 143 |
.I \-fo
|
| 144 |
option is given.
|
| 145 |
If instead the
|
| 146 |
.I \-r
|
| 147 |
option is specified, data recovery is attempted on existing files.
|
| 148 |
(If
|
| 149 |
.I "\-c 0"
|
| 150 |
is used together with the
|
| 151 |
.I \-r
|
| 152 |
option, existing files are read in and new ray evaluations are added
|
| 153 |
to the previous results, providing a convenient means for
|
| 154 |
progressive simulation.)\0
|
| 155 |
If an output specification contains a "%s" format, this will be
|
| 156 |
replaced by the modifier name.
|
| 157 |
The
|
| 158 |
.I \-b
|
| 159 |
option may be used to further define
|
| 160 |
a "bin number" within each object if finer resolution is needed, and
|
| 161 |
this will be applied to a "%d" format in the output file
|
| 162 |
specification if present.
|
| 163 |
The actual bin number is computed at run time based on ray direction
|
| 164 |
and surface intersection, as described below.
|
| 165 |
If the number of bins is known in advance, it should be specified with the
|
| 166 |
.I \-bn
|
| 167 |
option, and this is critical for output files containing multiple values
|
| 168 |
per record.
|
| 169 |
A variable or constant name may be given for this parameter if
|
| 170 |
it has been defined via a previous
|
| 171 |
.I \-f
|
| 172 |
or
|
| 173 |
.I \-e
|
| 174 |
option.
|
| 175 |
Since bin numbers start from 0, the bin count is always equal to
|
| 176 |
the last bin plus 1.
|
| 177 |
Set the this value to 0 if the bin count is unknown (the default).
|
| 178 |
The most recent
|
| 179 |
.I \-b,
|
| 180 |
.I \-bn
|
| 181 |
and
|
| 182 |
.I \-o
|
| 183 |
options to the left of each
|
| 184 |
.I \-m
|
| 185 |
setting are the ones used for that modifier.
|
| 186 |
The ordering of other options is unimportant, except for
|
| 187 |
.I \-x
|
| 188 |
and
|
| 189 |
.I \-y
|
| 190 |
if the
|
| 191 |
.I \-c
|
| 192 |
is 0, when they control the resolution string
|
| 193 |
produced in the corresponding output.
|
| 194 |
.PP
|
| 195 |
If a
|
| 196 |
.I \-b
|
| 197 |
expression is defined for a particular modifier,
|
| 198 |
the bin number will be evaluated at run time for each
|
| 199 |
ray contribution from
|
| 200 |
.I rtrace.
|
| 201 |
Specifically, each ray's world intersection point will be assigned to
|
| 202 |
the variables Px, Py, and Pz, and the normalized ray direction
|
| 203 |
will be assigned to Dx, Dy, and Dz.
|
| 204 |
These parameters may be combined with definitions given in
|
| 205 |
.I \-e
|
| 206 |
arguments and files read using the
|
| 207 |
.I \-f
|
| 208 |
option.
|
| 209 |
The computed bin value will be
|
| 210 |
rounded to the nearest whole number.
|
| 211 |
This mechanism allows the user to define precise regions or directions
|
| 212 |
they wish to accumulate, such as the Tregenza sky discretization,
|
| 213 |
which would be otherwise impossible to specify
|
| 214 |
as a set of RADIANCE primitives.
|
| 215 |
The rules and predefined functions available for these expressions are
|
| 216 |
described in the
|
| 217 |
.I rcalc(1)
|
| 218 |
man page.
|
| 219 |
Unlike
|
| 220 |
.I rcalc,
|
| 221 |
.I rtcontrib
|
| 222 |
will search the RADIANCE library directories for each file given in a
|
| 223 |
.I \-f
|
| 224 |
option.
|
| 225 |
.PP
|
| 226 |
If no
|
| 227 |
.I \-o
|
| 228 |
specification is given, results are written on the standard output in order
|
| 229 |
of modifier (as given on the command line) then bin number.
|
| 230 |
Concatenated data is also sent to a single destination (i.e., an initial
|
| 231 |
.I \-o
|
| 232 |
specification without formatting strings).
|
| 233 |
If a "%s" format appears but no "%d" in the
|
| 234 |
.I \-o
|
| 235 |
specification, then each modifier will have its own output file, with
|
| 236 |
multiple values per record in the case of a non-zero
|
| 237 |
.I \-b
|
| 238 |
definition.
|
| 239 |
If a "%d" format appears but no "%s", then each bin will get its own
|
| 240 |
output file, with modifiers output in order in each record.
|
| 241 |
For text output, each RGB coefficient triple is separated by a tab,
|
| 242 |
with a newline at the end of each ray record.
|
| 243 |
For binary output formats, there is no such delimiter to mark
|
| 244 |
the end of each record.
|
| 245 |
.PP
|
| 246 |
Input and output format defaults to plain text, where each ray's
|
| 247 |
origin and direction (6 real values) are given on input,
|
| 248 |
and one line is produced per output file per ray.
|
| 249 |
Alternative data representations may be specified by the
|
| 250 |
.I \-f[io]
|
| 251 |
option, which is described in the
|
| 252 |
.I rtrace
|
| 253 |
man page along with the associated
|
| 254 |
.I \-x
|
| 255 |
and
|
| 256 |
.I \-y
|
| 257 |
resolution settings.
|
| 258 |
In particular, the color ('c') output data representation
|
| 259 |
together with positive dimensions for
|
| 260 |
.I \-x
|
| 261 |
and
|
| 262 |
.I \-y
|
| 263 |
will produce an uncompressed RADIANCE picture,
|
| 264 |
suitable for manipulation with
|
| 265 |
.I pcomb(1)
|
| 266 |
and related tools.
|
| 267 |
.PP
|
| 268 |
Options may be given on the command line and/or read from the
|
| 269 |
environment and/or read from a file.
|
| 270 |
A command argument beginning with a dollar sign ('$') is immediately
|
| 271 |
replaced by the contents of the given environment variable.
|
| 272 |
A command argument beginning with an at sign ('@') is immediately
|
| 273 |
replaced by the contents of the given file.
|
| 274 |
.SH EXAMPLES
|
| 275 |
To compute the proportional contributions from sources modified
|
| 276 |
by "light1" vs. "light2" on a set of illuminance values:
|
| 277 |
.IP "" .2i
|
| 278 |
rtcontrib \-I+ @render.opt \-o c_%s.dat \-m light1 \-m light2 scene.oct < test.dat
|
| 279 |
.PP
|
| 280 |
To generate a pair of images corresponding to these two lights'
|
| 281 |
contributions:
|
| 282 |
.IP "" .2i
|
| 283 |
vwrays \-ff \-x 1024 \-y 1024 \-vf best.vf |
|
| 284 |
rtcontrib \-ffc `vwrays \-d \-x 1024 \-y 1024 \-vf best.vf`
|
| 285 |
@render.opt \-o c_%s.hdr \-m light1 \-m light2 scene.oct
|
| 286 |
.PP
|
| 287 |
These images may then be recombined using the desired outputs
|
| 288 |
of light1 and light2:
|
| 289 |
.IP "" .2i
|
| 290 |
pcomb \-c 100 90 75 c_light1.hdr \-c 50 55 57 c_light2.hdr > combined.hdr
|
| 291 |
.PP
|
| 292 |
To compute an array of illuminance contributions according to a Tregenza sky:
|
| 293 |
.IP "" .2i
|
| 294 |
rtcontrib \-I+ \-b tbin \-o sky.dat \-m skyglow \-b 0 \-o ground.dat \-m groundglow
|
| 295 |
@render.opt \-f tregenza.cal scene.oct < test.dat
|
| 296 |
.SH ENVIRONMENT
|
| 297 |
RAYPATH path to search for \-f and \-M files
|
| 298 |
.SH AUTHOR
|
| 299 |
Greg Ward
|
| 300 |
.SH "SEE ALSO"
|
| 301 |
cnt(1), genklemsamp(1), getinfo(1), pcomb(1), pfilt(1), ra_rgbe(1),
|
| 302 |
rcalc(1), rpict(1), rsensor(1), rtrace(1), total(1), vwrays(1), ximage(1)
|