ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/doc/man/man1/rtcontrib.1
Revision: 1.13
Committed: Thu Oct 6 16:28:59 2005 UTC (18 years, 7 months ago) by greg
Branch: MAIN
Changes since 1.12: +6 -3 lines
Log Message:
Fixes in new rtcontrib -bn option

File Contents

# User Rev Content
1 greg 1.13 .\" RCSid "$Id: rtcontrib.1,v 1.12 2005/10/06 05:49:44 greg Exp $"
2 greg 1.3 .TH RTCONTRIB 1 5/25/05 RADIANCE
3 greg 1.1 .SH NAME
4 greg 1.5 rtcontrib - compute contribution coefficients in a RADIANCE scene
5 greg 1.1 .SH SYNOPSIS
6     .B rtcontrib
7     [
8     .B "\-n nprocs"
9     ][
10 greg 1.8 .B \-r
11     ][
12 greg 1.1 .B "\-e expr"
13     ][
14     .B "\-f source"
15     ][
16 greg 1.7 .B "\-o ospec"
17 greg 1.1 ][
18     .B "\-b binv"
19 greg 1.12 ][
20     .B "\-bn nbins"
21 greg 1.1 ]
22 greg 1.9 {
23     .B "\-m mod | \-M file"
24     }
25     ..
26 greg 1.1 [
27     .B $EVAR
28     ]
29     [
30     .B @file
31     ]
32     [
33     rtrace options
34     ]
35     .B octree
36 greg 1.4 .br
37     .B "rtcontrib [ options ] \-defaults"
38 greg 1.1 .SH DESCRIPTION
39     .I Rtcontrib
40     computes ray contributions (i.e., color coefficients)
41     for objects whose modifiers are named in one or more
42     .I \-m
43     settings.
44 greg 1.2 These modifiers are usually materials associated with
45     light sources or sky domes, and must directly modify some geometric
46     primitives to be considered in the output.
47 greg 1.9 A modifier list may also be read from a file using the
48     .I \-M
49     option.
50 greg 1.10 The RAYPATH environment variable determines directories to search for
51     this file.
52     (No search takes place if a file name begins with a '.', '/' or '~'
53     character.)\0
54 greg 1.9 .PP
55 greg 1.3 The output of
56     .I rtcontrib
57     has many potential uses.
58     Source contributions can be used as components in linear combination to
59 greg 1.1 reproduce any desired variation, e.g., simulating lighting controls or
60     changing sky conditions via daylight coefficients.
61     More generally,
62     .I rtcontrib
63 greg 1.3 can be used to compute arbitrary input-output relationships in optical
64     systems, such as luminaires, light pipes, and shading devices.
65 greg 1.1 .PP
66 greg 1.2 .I Rtcontrib
67     calls
68     .I rtrace(1)
69 greg 1.5 with the -oTW option to calculate the daughter ray
70     contributions for each input ray, and the output tallies
71 greg 1.7 are sent to one or more destinations according to the given
72 greg 1.1 .I \-o
73     specification.
74 greg 1.7 If a destination begins with an exclamation mark ('!'), then
75     a pipe is opened to a command and data is sent to its standard input.
76     Otherwise, the destination is treated as a file.
77 greg 1.8 An existing file of the same name is clobbered, unless the
78     .I \-r
79     option is specified, in which case data recovery is attempted.
80 greg 1.2 If an output specification contains a "%s" format, this will be
81 greg 1.1 replaced by the modifier name.
82     The
83     .I \-b
84     option may be used to further define
85 greg 1.2 a "bin number" within each object if finer resolution is needed, and
86     this will be applied to a "%d" format in the output file
87 greg 1.1 specification if present.
88 greg 1.3 The actual bin number is computed at run time based on ray direction
89     and surface intersection, as described below.
90 greg 1.12 If the number of bins is known in advance, it should be specified with the
91     .I \-bn
92 greg 1.13 option, and this is critical for output files containing multiple values
93     per record.
94     Since bin numbers start from 0, the bin count is always equal to
95     the last bin plus 1.
96     Set the this value to 0 if the bin count is unknown (the default).
97 greg 1.1 The most recent
98 greg 1.12 .I \-b,
99     .I \-bn
100 greg 1.1 and
101     .I \-o
102 greg 1.2 options to the left of each
103 greg 1.1 .I \-m
104 greg 1.2 setting affect only that modifier.
105     (The ordering of other options is unimportant.)\0
106 greg 1.1 .PP
107 greg 1.2 If a
108     .I \-b
109     expression is defined for a particular modifier,
110     the bin number will be evaluated at run time for each
111     ray contribution from
112     .I rtrace.
113     Specifically, each ray's world intersection point will be assigned to
114     the variables Px, Py, and Pz, and the normalized ray direction
115     will be assigned to Dx, Dy, and Dz.
116     These parameters may be combined with definitions given in
117     .I \-e
118 greg 1.3 arguments and files read using the
119 greg 1.2 .I \-f
120 greg 1.3 option.
121     The computed bin value will be
122 greg 1.2 rounded to the nearest whole number.
123     This mechanism allows the user to define precise regions or directions
124     they wish to accumulate, such as the Tregenza sky discretization,
125     which would be otherwise impossible to specify
126     as a set of RADIANCE primitives.
127 greg 1.3 The rules and predefined functions available for these expressions are
128     described in the
129     .I rcalc(1)
130     man page.
131 greg 1.6 Unlike
132     .I rcalc,
133     .I rtcontrib
134     will search the RADIANCE library directories for each file given in a
135     .I \-f
136     option.
137 greg 1.1 .PP
138     If no
139     .I \-o
140     specification is given, results are written on the standard output in order
141     of modifier (as given on the command line) then bin number.
142 greg 1.7 Concatenated data is also sent to a single destination (i.e., an initial
143 greg 1.2 .I \-o
144     specification without formatting strings).
145 greg 1.1 If a "%s" format appears but no "%d" in the
146     .I \-o
147     specification, then each modifier will have its own output file, with
148     multiple values per record in the case of a non-zero
149     .I \-b
150     definition.
151     If a "%d" format appears but no "%s", then each bin will get its own
152     output file, with modifiers output in order in each record.
153     For text output, each RGB coefficient triple is separated by a tab,
154     with a newline at the end of each ray record.
155     For binary output formats, there is no such delimiter to mark
156     the end of each record.
157     .PP
158 greg 1.2 Input and output format defaults to plain text, where each ray's
159     origin and direction (6 real values) are given on input,
160     and one line is produced per output file per ray.
161     Alternative data representations may be specified by the
162     .I \-f[io]
163     option, which is described in the
164     .I rtrace
165     man page along with the associated
166     .I \-x
167     and
168     .I \-y
169     resolution settings.
170     In particular, the color ('c') output data representation
171     together with positive dimensions for
172     .I \-x
173     and
174     .I \-y
175     will produce an uncompressed RADIANCE picture,
176     suitable for manipulation with
177     .I pcomb(1)
178     and related tools.
179 greg 1.1 .PP
180     If the
181     .I \-n
182     option is specified with a value greater than 1, multiple
183 greg 1.2 .I rtrace
184 greg 1.1 processes will be used to accelerate computation on a shared
185     memory machine.
186     Note that there is no benefit to using more processes
187 greg 1.2 than there are local CPUs available to do the work, and the
188     .I rtcontrib
189     process itself may use a considerable amount of CPU time.
190 greg 1.1 .PP
191     Options may be given on the command line and/or read from the
192     environment and/or read from a file.
193     A command argument beginning with a dollar sign ('$') is immediately
194     replaced by the contents of the given environment variable.
195     A command argument beginning with an at sign ('@') is immediately
196     replaced by the contents of the given file.
197 greg 1.2 .SH EXAMPLES
198     To compute the proportional contributions from sources modified
199     by "light1" vs. "light2" on a set of illuminance values:
200 greg 1.1 .IP "" .2i
201 greg 1.2 rtcontrib -I+ @render.opt -o c_%s.dat -m light1 -m light2 scene.oct < test.dat
202     .PP
203     To generate a pair of images corresponding to these two lights'
204     contributions:
205 greg 1.1 .IP "" .2i
206 greg 1.2 vwrays -ff -x 1024 -y 1024 -vf best.vf |
207     rtcontrib -ffc `vwrays -d -x 1024 -y 1024 -vf best.vf`
208     @render.opt -o c_%s.pic -m light1 -m light2 scene.oct
209     .PP
210     These images may then be recombined using the desired outputs
211     of light1 and light2:
212 greg 1.1 .IP "" .2i
213 greg 1.2 pcomb -c 100 90 75 c_light1.pic -c 50 55 57 c_light2.pic > combined.pic
214 greg 1.1 .PP
215 greg 1.2 To compute an array of illuminance contributions according to a Tregenza sky:
216     .IP "" .2i
217 greg 1.11 rtcontrib -I+ -b tbin -o sky.dat -m skyglow -b 0 -o ground.dat -m groundglow
218 greg 1.2 @render.opt -f tregenza.cal scene.oct < test.dat
219 greg 1.6 .SH ENVIRONMENT
220 greg 1.10 RAYPATH path to search for -f and -M files
221 greg 1.1 .SH AUTHOR
222     Greg Ward
223     .SH "SEE ALSO"
224     cnt(1), getinfo(1), pcomb(1), pfilt(1), ra_rgbe(1),
225     rcalc(1), rpict(1), rtrace(1), vwrays(1), ximage(1)