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