ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/doc/man/man1/rcontrib.1
Revision: 1.9
Committed: Sat Jul 19 00:07:03 2014 UTC (10 years, 10 months ago) by greg
Branch: MAIN
Changes since 1.8: +2 -1 lines
Log Message:
Silently ignore negative bin values.

File Contents

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