1 |
greg |
1.8 |
.\" RCSid "$Id: rcontrib.1,v 1.7 2013/11/01 15:32:58 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 |
greg |
1.6 |
The default value is one, meaning a full record will be produced for |
105 |
greg |
1.1 |
each input ray. |
106 |
greg |
1.6 |
For values greater than one, contributions will be averaged together |
107 |
greg |
1.1 |
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 |
greg |
1.6 |
Note that output flushing via zero-direction rays is disabled with |
117 |
|
|
.I \-c |
118 |
|
|
set to zero. |
119 |
greg |
1.1 |
.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 |
greg |
1.3 |
.I Rcontrib |
132 |
greg |
1.4 |
sends the accumulated rays tallies |
133 |
|
|
to one or more destinations according to the given |
134 |
greg |
1.1 |
.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 |
greg |
1.5 |
The number of bins must be specified in advance with the |
163 |
greg |
1.1 |
.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 |
greg |
1.6 |
Since bin numbers start from zero, the bin count is always equal to |
173 |
|
|
the last bin plus one. |
174 |
greg |
1.1 |
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 |
greg |
1.6 |
is zero, when they control the resolution string |
189 |
greg |
1.1 |
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 |
greg |
1.8 |
For a single bin, you may specify |
207 |
|
|
.I "\-b 0", |
208 |
|
|
which is the default. |
209 |
greg |
1.1 |
This mechanism allows the user to define precise regions or directions |
210 |
|
|
they wish to accumulate, such as the Tregenza sky discretization, |
211 |
|
|
which would be otherwise impossible to specify |
212 |
|
|
as a set of RADIANCE primitives. |
213 |
|
|
The rules and predefined functions available for these expressions are |
214 |
|
|
described in the |
215 |
|
|
.I rcalc(1) |
216 |
|
|
man page. |
217 |
greg |
1.8 |
Like |
218 |
greg |
1.1 |
.I rcalc, |
219 |
|
|
.I rcontrib |
220 |
|
|
will search the RADIANCE library directories for each file given in a |
221 |
|
|
.I \-f |
222 |
|
|
option. |
223 |
|
|
.PP |
224 |
|
|
If no |
225 |
|
|
.I \-o |
226 |
|
|
specification is given, results are written on the standard output in order |
227 |
|
|
of modifier (as given on the command line) then bin number. |
228 |
|
|
Concatenated data is also sent to a single destination (i.e., an initial |
229 |
|
|
.I \-o |
230 |
|
|
specification without formatting strings). |
231 |
|
|
If a "%s" format appears but no "%d" in the |
232 |
|
|
.I \-o |
233 |
|
|
specification, then each modifier will have its own output file, with |
234 |
|
|
multiple values per record in the case of a non-zero |
235 |
|
|
.I \-b |
236 |
|
|
definition. |
237 |
|
|
If a "%d" format appears but no "%s", then each bin will get its own |
238 |
|
|
output file, with modifiers output in order in each record. |
239 |
|
|
For text output, each RGB coefficient triple is separated by a tab, |
240 |
|
|
with a newline at the end of each ray record. |
241 |
|
|
For binary output formats, there is no such delimiter to mark |
242 |
|
|
the end of each record. |
243 |
|
|
.PP |
244 |
|
|
Input and output format defaults to plain text, where each ray's |
245 |
|
|
origin and direction (6 real values) are given on input, |
246 |
|
|
and one line is produced per output file per ray. |
247 |
|
|
Alternative data representations may be specified by the |
248 |
|
|
.I \-f[io] |
249 |
|
|
option, which is described in the |
250 |
|
|
.I rtrace |
251 |
|
|
man page along with the associated |
252 |
|
|
.I \-x |
253 |
|
|
and |
254 |
|
|
.I \-y |
255 |
|
|
resolution settings. |
256 |
|
|
In particular, the color ('c') output data representation |
257 |
|
|
together with positive dimensions for |
258 |
|
|
.I \-x |
259 |
|
|
and |
260 |
|
|
.I \-y |
261 |
|
|
will produce an uncompressed RADIANCE picture, |
262 |
|
|
suitable for manipulation with |
263 |
|
|
.I pcomb(1) |
264 |
|
|
and related tools. |
265 |
|
|
.PP |
266 |
|
|
Options may be given on the command line and/or read from the |
267 |
|
|
environment and/or read from a file. |
268 |
|
|
A command argument beginning with a dollar sign ('$') is immediately |
269 |
|
|
replaced by the contents of the given environment variable. |
270 |
|
|
A command argument beginning with an at sign ('@') is immediately |
271 |
|
|
replaced by the contents of the given file. |
272 |
|
|
.SH EXAMPLES |
273 |
|
|
To compute the proportional contributions from sources modified |
274 |
|
|
by "light1" vs. "light2" on a set of illuminance values: |
275 |
|
|
.IP "" .2i |
276 |
|
|
rcontrib \-I+ @render.opt \-o c_%s.dat \-m light1 \-m light2 scene.oct < test.dat |
277 |
|
|
.PP |
278 |
|
|
To generate a pair of images corresponding to these two lights' |
279 |
|
|
contributions: |
280 |
|
|
.IP "" .2i |
281 |
|
|
vwrays \-ff \-x 1024 \-y 1024 \-vf best.vf | |
282 |
|
|
rcontrib \-ffc `vwrays \-d \-x 1024 \-y 1024 \-vf best.vf` |
283 |
|
|
@render.opt \-o c_%s.hdr \-m light1 \-m light2 scene.oct |
284 |
|
|
.PP |
285 |
|
|
These images may then be recombined using the desired outputs |
286 |
|
|
of light1 and light2: |
287 |
|
|
.IP "" .2i |
288 |
|
|
pcomb \-c 100 90 75 c_light1.hdr \-c 50 55 57 c_light2.hdr > combined.hdr |
289 |
|
|
.PP |
290 |
|
|
To compute an array of illuminance contributions according to a Tregenza sky: |
291 |
|
|
.IP "" .2i |
292 |
greg |
1.7 |
rcontrib \-I+ \-f tregenza.cal \-b tbin \-bn Ntbins \-o sky.dat \-m skyglow |
293 |
|
|
\-b 0 \-o ground.dat \-m groundglow @render.opt scene.oct < test.dat |
294 |
greg |
1.1 |
.SH ENVIRONMENT |
295 |
|
|
RAYPATH path to search for \-f and \-M files |
296 |
|
|
.SH AUTHOR |
297 |
|
|
Greg Ward |
298 |
|
|
.SH "SEE ALSO" |
299 |
|
|
cnt(1), genklemsamp(1), getinfo(1), pcomb(1), pfilt(1), ra_rgbe(1), |
300 |
|
|
rcalc(1), rpict(1), rsensor(1), rtrace(1), total(1), vwrays(1), ximage(1) |