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