ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/doc/man/man1/rcontrib.1
Revision: 1.5
Committed: Thu Jun 14 22:51:04 2012 UTC (12 years, 10 months ago) by greg
Branch: MAIN
Changes since 1.4: +2 -2 lines
Log Message:
Added -bn requirement

File Contents

# User Rev Content
1 greg 1.5 .\" RCSid "$Id: rcontrib.1,v 1.4 2012/06/14 22:49:34 greg Exp $"
2 greg 1.2 .TH RCONTRIB 1 5/25/05 RADIANCE
3 greg 1.1 .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 greg 1.3 .I Rcontrib
46 greg 1.1 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 1, meaning a full record will be produced for
105     each input ray.
106     For values greater than 1, 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
117     for accumulated evaluations.
118     .PP
119     The output of
120     .I rcontrib
121     has many potential uses.
122     Source contributions can be used as components in linear combination to
123     reproduce any desired variation, e.g., simulating lighting controls or
124     changing sky conditions via daylight coefficients.
125     More generally,
126     .I rcontrib
127     can be used to compute arbitrary input-output relationships in optical
128     systems, such as luminaires, light pipes, and shading devices.
129     .PP
130 greg 1.3 .I Rcontrib
131 greg 1.4 sends the accumulated rays tallies
132     to one or more destinations according to the given
133 greg 1.1 .I \-o
134     specification.
135     If a destination begins with an exclamation mark ('!'), then
136     a pipe is opened to a command and data is sent to its standard input.
137     Otherwise, the destination is treated as a file.
138     An existing file of the same name will not be clobbered, unless the
139     .I \-fo
140     option is given.
141     If instead the
142     .I \-r
143     option is specified, data recovery is attempted on existing files.
144     (If
145     .I "\-c 0"
146     is used together with the
147     .I \-r
148     option, existing files are read in and new ray evaluations are added
149     to the previous results, providing a convenient means for
150     progressive simulation.)\0
151     If an output specification contains a "%s" format, this will be
152     replaced by the modifier name.
153     The
154     .I \-b
155     option may be used to further define
156     a "bin number" within each object if finer resolution is needed, and
157     this will be applied to a "%d" format in the output file
158     specification if present.
159     The actual bin number is computed at run time based on ray direction
160     and surface intersection, as described below.
161 greg 1.5 The number of bins must be specified in advance with the
162 greg 1.1 .I \-bn
163     option, and this is critical for output files containing multiple values
164     per record.
165     A variable or constant name may be given for this parameter if
166     it has been defined via a previous
167     .I \-f
168     or
169     .I \-e
170     option.
171     Since bin numbers start from 0, the bin count is always equal to
172     the last bin plus 1.
173     Set the this value to 0 if the bin count is unknown (the default).
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 0, 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 greg 1.4 ray contribution.
196 greg 1.1 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     This mechanism allows the user to define precise regions or directions
207     they wish to accumulate, such as the Tregenza sky discretization,
208     which would be otherwise impossible to specify
209     as a set of RADIANCE primitives.
210     The rules and predefined functions available for these expressions are
211     described in the
212     .I rcalc(1)
213     man page.
214     Unlike
215     .I rcalc,
216     .I rcontrib
217     will search the RADIANCE library directories for each file given in a
218     .I \-f
219     option.
220     .PP
221     If no
222     .I \-o
223     specification is given, results are written on the standard output in order
224     of modifier (as given on the command line) then bin number.
225     Concatenated data is also sent to a single destination (i.e., an initial
226     .I \-o
227     specification without formatting strings).
228     If a "%s" format appears but no "%d" in the
229     .I \-o
230     specification, then each modifier will have its own output file, with
231     multiple values per record in the case of a non-zero
232     .I \-b
233     definition.
234     If a "%d" format appears but no "%s", then each bin will get its own
235     output file, with modifiers output in order in each record.
236     For text output, each RGB coefficient triple is separated by a tab,
237     with a newline at the end of each ray record.
238     For binary output formats, there is no such delimiter to mark
239     the end of each record.
240     .PP
241     Input and output format defaults to plain text, where each ray's
242     origin and direction (6 real values) are given on input,
243     and one line is produced per output file per ray.
244     Alternative data representations may be specified by the
245     .I \-f[io]
246     option, which is described in the
247     .I rtrace
248     man page along with the associated
249     .I \-x
250     and
251     .I \-y
252     resolution settings.
253     In particular, the color ('c') output data representation
254     together with positive dimensions for
255     .I \-x
256     and
257     .I \-y
258     will produce an uncompressed RADIANCE picture,
259     suitable for manipulation with
260     .I pcomb(1)
261     and related tools.
262     .PP
263     Options may be given on the command line and/or read from the
264     environment and/or read from a file.
265     A command argument beginning with a dollar sign ('$') is immediately
266     replaced by the contents of the given environment variable.
267     A command argument beginning with an at sign ('@') is immediately
268     replaced by the contents of the given file.
269     .SH EXAMPLES
270     To compute the proportional contributions from sources modified
271     by "light1" vs. "light2" on a set of illuminance values:
272     .IP "" .2i
273     rcontrib \-I+ @render.opt \-o c_%s.dat \-m light1 \-m light2 scene.oct < test.dat
274     .PP
275     To generate a pair of images corresponding to these two lights'
276     contributions:
277     .IP "" .2i
278     vwrays \-ff \-x 1024 \-y 1024 \-vf best.vf |
279     rcontrib \-ffc `vwrays \-d \-x 1024 \-y 1024 \-vf best.vf`
280     @render.opt \-o c_%s.hdr \-m light1 \-m light2 scene.oct
281     .PP
282     These images may then be recombined using the desired outputs
283     of light1 and light2:
284     .IP "" .2i
285     pcomb \-c 100 90 75 c_light1.hdr \-c 50 55 57 c_light2.hdr > combined.hdr
286     .PP
287     To compute an array of illuminance contributions according to a Tregenza sky:
288     .IP "" .2i
289     rcontrib \-I+ \-b tbin \-o sky.dat \-m skyglow \-b 0 \-o ground.dat \-m groundglow
290     @render.opt \-f tregenza.cal scene.oct < test.dat
291     .SH ENVIRONMENT
292     RAYPATH path to search for \-f and \-M files
293     .SH AUTHOR
294     Greg Ward
295     .SH "SEE ALSO"
296     cnt(1), genklemsamp(1), getinfo(1), pcomb(1), pfilt(1), ra_rgbe(1),
297     rcalc(1), rpict(1), rsensor(1), rtrace(1), total(1), vwrays(1), ximage(1)