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