| 1 |
|
.\" RCSid "$Id$" |
| 2 |
< |
.TH RPIECE 1 5/25/05 RADIANCE |
| 2 |
> |
.TH RTCONTRIB 1 5/25/05 RADIANCE |
| 3 |
|
.SH NAME |
| 4 |
< |
rtcontrib - compute contributions in a RADIANCE scene |
| 4 |
> |
rtcontrib - compute contribution coefficients in a RADIANCE scene |
| 5 |
|
.SH SYNOPSIS |
| 6 |
|
.B rtcontrib |
| 7 |
|
[ |
| 8 |
|
.B "\-n nprocs" |
| 9 |
|
][ |
| 10 |
+ |
.B \-r |
| 11 |
+ |
][ |
| 12 |
|
.B "\-e expr" |
| 13 |
|
][ |
| 14 |
|
.B "\-f source" |
| 15 |
|
][ |
| 16 |
< |
.B "\-o fspec" |
| 16 |
> |
.B "\-o ospec" |
| 17 |
|
][ |
| 18 |
|
.B "\-b binv" |
| 19 |
|
] |
| 20 |
+ |
.B "\-m mod .." |
| 21 |
|
[ |
| 22 |
|
.B $EVAR |
| 23 |
|
] |
| 27 |
|
[ |
| 28 |
|
rtrace options |
| 29 |
|
] |
| 27 |
– |
.B "\-m mod .." |
| 30 |
|
.B octree |
| 31 |
+ |
.br |
| 32 |
+ |
.B "rtcontrib [ options ] \-defaults" |
| 33 |
|
.SH DESCRIPTION |
| 34 |
|
.I Rtcontrib |
| 35 |
|
computes ray contributions (i.e., color coefficients) |
| 36 |
|
for objects whose modifiers are named in one or more |
| 37 |
|
.I \-m |
| 38 |
|
settings. |
| 39 |
< |
These modifiers are usually materials associated with specific |
| 40 |
< |
light sources, though they could correspond to intermediate objects as well. |
| 41 |
< |
The resulting contributions may then be used in linear combination to |
| 39 |
> |
These modifiers are usually materials associated with |
| 40 |
> |
light sources or sky domes, and must directly modify some geometric |
| 41 |
> |
primitives to be considered in the output. |
| 42 |
> |
The output of |
| 43 |
> |
.I rtcontrib |
| 44 |
> |
has many potential uses. |
| 45 |
> |
Source contributions can be used as components in linear combination to |
| 46 |
|
reproduce any desired variation, e.g., simulating lighting controls or |
| 47 |
|
changing sky conditions via daylight coefficients. |
| 48 |
|
More generally, |
| 49 |
|
.I rtcontrib |
| 50 |
< |
can compute general input-output relationships in optical |
| 51 |
< |
systems, such as light pipes and shading devices. |
| 50 |
> |
can be used to compute arbitrary input-output relationships in optical |
| 51 |
> |
systems, such as luminaires, light pipes, and shading devices. |
| 52 |
|
.PP |
| 53 |
< |
.I Rtrace(1) |
| 54 |
< |
is called to calculate the contributions for each input ray, |
| 55 |
< |
and the output tallies are sent to one or more files according to the |
| 53 |
> |
.I Rtcontrib |
| 54 |
> |
calls |
| 55 |
> |
.I rtrace(1) |
| 56 |
> |
with the -oTW option to calculate the daughter ray |
| 57 |
> |
contributions for each input ray, and the output tallies |
| 58 |
> |
are sent to one or more destinations according to the given |
| 59 |
|
.I \-o |
| 60 |
|
specification. |
| 61 |
< |
If the output file specification contains a "%s" format, this will be |
| 61 |
> |
If a destination begins with an exclamation mark ('!'), then |
| 62 |
> |
a pipe is opened to a command and data is sent to its standard input. |
| 63 |
> |
Otherwise, the destination is treated as a file. |
| 64 |
> |
An existing file of the same name is clobbered, unless the |
| 65 |
> |
.I \-r |
| 66 |
> |
option is specified, in which case data recovery is attempted. |
| 67 |
> |
If an output specification contains a "%s" format, this will be |
| 68 |
|
replaced by the modifier name. |
| 69 |
|
The |
| 70 |
|
.I \-b |
| 71 |
|
option may be used to further define |
| 72 |
< |
a "bin number" within each object if finer resolution is desired, and |
| 73 |
< |
will be applied to a "%d" format in the output file |
| 72 |
> |
a "bin number" within each object if finer resolution is needed, and |
| 73 |
> |
this will be applied to a "%d" format in the output file |
| 74 |
|
specification if present. |
| 75 |
< |
(The actual bin number is computed at run time based on ray direction |
| 76 |
< |
and surface intersection, as described below.)\0 |
| 75 |
> |
The actual bin number is computed at run time based on ray direction |
| 76 |
> |
and surface intersection, as described below. |
| 77 |
|
The most recent |
| 78 |
|
.I \-b |
| 79 |
|
and |
| 80 |
|
.I \-o |
| 81 |
< |
options (to the left) of each |
| 81 |
> |
options to the left of each |
| 82 |
|
.I \-m |
| 83 |
< |
setting affect only that modifier, and the ordering |
| 84 |
< |
of other options is unimportant. |
| 83 |
> |
setting affect only that modifier. |
| 84 |
> |
(The ordering of other options is unimportant.)\0 |
| 85 |
|
.PP |
| 86 |
< |
Input and output format defaults to plain text, where each ray's |
| 87 |
< |
origin and direction (6 real values) must appear together per |
| 88 |
< |
line of input, and one line of output is produced per output file |
| 89 |
< |
file per ray. |
| 90 |
< |
Alternative input and output formats may be specified using the |
| 91 |
< |
.I \-f[io] |
| 92 |
< |
option, which is explained in the |
| 93 |
< |
.I rtrace |
| 94 |
< |
man page along with the associated |
| 95 |
< |
.I \-x |
| 96 |
< |
and |
| 97 |
< |
.I \-y |
| 98 |
< |
resolution settings. |
| 99 |
< |
In particular, the 'c' output setting |
| 100 |
< |
together with positive dimensions for |
| 101 |
< |
.I \-x |
| 102 |
< |
and |
| 103 |
< |
.I \-y |
| 104 |
< |
will produce an uncompressed RADIANCE picture, |
| 105 |
< |
suitable for manipulation with |
| 106 |
< |
.I pcomb(1) |
| 107 |
< |
and related tools. |
| 86 |
> |
If a |
| 87 |
> |
.I \-b |
| 88 |
> |
expression is defined for a particular modifier, |
| 89 |
> |
the bin number will be evaluated at run time for each |
| 90 |
> |
ray contribution from |
| 91 |
> |
.I rtrace. |
| 92 |
> |
Specifically, each ray's world intersection point will be assigned to |
| 93 |
> |
the variables Px, Py, and Pz, and the normalized ray direction |
| 94 |
> |
will be assigned to Dx, Dy, and Dz. |
| 95 |
> |
These parameters may be combined with definitions given in |
| 96 |
> |
.I \-e |
| 97 |
> |
arguments and files read using the |
| 98 |
> |
.I \-f |
| 99 |
> |
option. |
| 100 |
> |
The computed bin value will be |
| 101 |
> |
rounded to the nearest whole number. |
| 102 |
> |
This mechanism allows the user to define precise regions or directions |
| 103 |
> |
they wish to accumulate, such as the Tregenza sky discretization, |
| 104 |
> |
which would be otherwise impossible to specify |
| 105 |
> |
as a set of RADIANCE primitives. |
| 106 |
> |
The rules and predefined functions available for these expressions are |
| 107 |
> |
described in the |
| 108 |
> |
.I rcalc(1) |
| 109 |
> |
man page. |
| 110 |
> |
Unlike |
| 111 |
> |
.I rcalc, |
| 112 |
> |
.I rtcontrib |
| 113 |
> |
will search the RADIANCE library directories for each file given in a |
| 114 |
> |
.I \-f |
| 115 |
> |
option. |
| 116 |
> |
(No search takes place if a file name begins with a '.', '/' or '~' |
| 117 |
> |
character.)\0 |
| 118 |
|
.PP |
| 119 |
|
If no |
| 120 |
|
.I \-o |
| 121 |
|
specification is given, results are written on the standard output in order |
| 122 |
|
of modifier (as given on the command line) then bin number. |
| 123 |
< |
The same format is used for a simple file name specification |
| 124 |
< |
without any embedded "%s" or "%d" formats. |
| 123 |
> |
Concatenated data is also sent to a single destination (i.e., an initial |
| 124 |
> |
.I \-o |
| 125 |
> |
specification without formatting strings). |
| 126 |
|
If a "%s" format appears but no "%d" in the |
| 127 |
|
.I \-o |
| 128 |
|
specification, then each modifier will have its own output file, with |
| 136 |
|
For binary output formats, there is no such delimiter to mark |
| 137 |
|
the end of each record. |
| 138 |
|
.PP |
| 139 |
< |
If a |
| 140 |
< |
.I \-b |
| 141 |
< |
expression is defined for a particular modifier, |
| 142 |
< |
the bin number will be evaluated at run time for each |
| 143 |
< |
ray contribution from |
| 144 |
< |
.I rtrace. |
| 145 |
< |
Specifically, each ray's world intersection point will be assigned to |
| 146 |
< |
the variables Px, Py, and Pz, and the normalized ray direction |
| 147 |
< |
will be assigned to Dx, Dy, and Dz. |
| 148 |
< |
These ray parameters may be combined with any definitions given in |
| 149 |
< |
.I \-e |
| 150 |
< |
options, or any files read in from |
| 151 |
< |
.I \-f |
| 152 |
< |
options, to compute the bin, which will be |
| 153 |
< |
rounded to the closest whole number. |
| 154 |
< |
This mechanism allows the user to define precise regions (or directions) |
| 155 |
< |
they wish to accumulate, such as the Tregenza sky grid, which would be |
| 156 |
< |
otherwise impossible to specify as a set of RADIANCE primitives. |
| 139 |
> |
Input and output format defaults to plain text, where each ray's |
| 140 |
> |
origin and direction (6 real values) are given on input, |
| 141 |
> |
and one line is produced per output file per ray. |
| 142 |
> |
Alternative data representations may be specified by the |
| 143 |
> |
.I \-f[io] |
| 144 |
> |
option, which is described in the |
| 145 |
> |
.I rtrace |
| 146 |
> |
man page along with the associated |
| 147 |
> |
.I \-x |
| 148 |
> |
and |
| 149 |
> |
.I \-y |
| 150 |
> |
resolution settings. |
| 151 |
> |
In particular, the color ('c') output data representation |
| 152 |
> |
together with positive dimensions for |
| 153 |
> |
.I \-x |
| 154 |
> |
and |
| 155 |
> |
.I \-y |
| 156 |
> |
will produce an uncompressed RADIANCE picture, |
| 157 |
> |
suitable for manipulation with |
| 158 |
> |
.I pcomb(1) |
| 159 |
> |
and related tools. |
| 160 |
|
.PP |
| 161 |
|
If the |
| 162 |
|
.I \-n |
| 163 |
|
option is specified with a value greater than 1, multiple |
| 164 |
< |
.I rtrace(1) |
| 164 |
> |
.I rtrace |
| 165 |
|
processes will be used to accelerate computation on a shared |
| 166 |
|
memory machine. |
| 167 |
|
Note that there is no benefit to using more processes |
| 168 |
< |
than there are local CPUs available to do the work. |
| 168 |
> |
than there are local CPUs available to do the work, and the |
| 169 |
> |
.I rtcontrib |
| 170 |
> |
process itself may use a considerable amount of CPU time. |
| 171 |
|
.PP |
| 172 |
|
Options may be given on the command line and/or read from the |
| 173 |
|
environment and/or read from a file. |
| 175 |
|
replaced by the contents of the given environment variable. |
| 176 |
|
A command argument beginning with an at sign ('@') is immediately |
| 177 |
|
replaced by the contents of the given file. |
| 178 |
< |
.SH EXAMPLE |
| 179 |
< |
First |
| 180 |
< |
.I rpiece |
| 148 |
< |
process is started on the machine "goober": |
| 178 |
> |
.SH EXAMPLES |
| 179 |
> |
To compute the proportional contributions from sources modified |
| 180 |
> |
by "light1" vs. "light2" on a set of illuminance values: |
| 181 |
|
.IP "" .2i |
| 182 |
< |
goober% echo 1 8 > syncfile |
| 151 |
< |
.br |
| 152 |
< |
goober% echo -F syncfile -x 1024 -y 1024 -vf view -o picture octree > args |
| 153 |
< |
.br |
| 154 |
< |
goober% rpiece @args & |
| 182 |
> |
rtcontrib -I+ @render.opt -o c_%s.dat -m light1 -m light2 scene.oct < test.dat |
| 183 |
|
.PP |
| 184 |
< |
Second |
| 185 |
< |
.I rpiece |
| 158 |
< |
processes is started on the machine "sucker": |
| 184 |
> |
To generate a pair of images corresponding to these two lights' |
| 185 |
> |
contributions: |
| 186 |
|
.IP "" .2i |
| 187 |
< |
sucker% rpiece @args & |
| 188 |
< |
.SH NOTES |
| 189 |
< |
Due to NFS file buffering, the network lock manager is employed to |
| 163 |
< |
guarantee consistency in the output file even though non-overlapping |
| 164 |
< |
writes are used. |
| 165 |
< |
This would tend to slow the process down if |
| 166 |
< |
.I rpiece |
| 167 |
< |
were to wait for this I/O to complete before starting on the next |
| 168 |
< |
piece, so |
| 169 |
< |
.I rpiece |
| 170 |
< |
forks separate processes to hang around waiting for I/O completion. |
| 171 |
< |
The number of processes thus designated is set by the MAXFORK macro |
| 172 |
< |
in the program (compiled in the src/util directory). |
| 173 |
< |
If the fork call is slow on a system, it may actually be better to |
| 174 |
< |
set MAXFORK to zero. |
| 175 |
< |
In other cases, the network lock manager may be so slow that this |
| 176 |
< |
value should be increased to get the best utilization. |
| 187 |
> |
vwrays -ff -x 1024 -y 1024 -vf best.vf | |
| 188 |
> |
rtcontrib -ffc `vwrays -d -x 1024 -y 1024 -vf best.vf` |
| 189 |
> |
@render.opt -o c_%s.pic -m light1 -m light2 scene.oct |
| 190 |
|
.PP |
| 191 |
< |
The output picture is not run-length encoded, and can be quite |
| 192 |
< |
large. |
| 180 |
< |
The approximate size (in kilobytes) can be computed by the simple |
| 181 |
< |
formula: |
| 191 |
> |
These images may then be recombined using the desired outputs |
| 192 |
> |
of light1 and light2: |
| 193 |
|
.IP "" .2i |
| 194 |
< |
filesize = xres*yres/256 |
| 194 |
> |
pcomb -c 100 90 75 c_light1.pic -c 50 55 57 c_light2.pic > combined.pic |
| 195 |
|
.PP |
| 196 |
< |
Make sure that there is enough space on the filesystem to hold the |
| 197 |
< |
entire picture before beginning. |
| 198 |
< |
Once the picture is finished, the |
| 199 |
< |
.I ra_rgbe(1) |
| 200 |
< |
program with the -r option may be used to convert to a run-length |
| 201 |
< |
encoded picture for more efficient storage, although |
| 191 |
< |
.I pfilt(1) |
| 192 |
< |
or any of the other Radiance picture filters will do the same |
| 193 |
< |
thing. |
| 194 |
< |
.PP |
| 195 |
< |
The ALRM signal may be used to gracefully terminate an |
| 196 |
< |
.I rpiece |
| 197 |
< |
process after it finishes the current piece. |
| 198 |
< |
This permits other currently running or subsequently started |
| 199 |
< |
.I rpiece |
| 200 |
< |
process(es) to continue rendering the picture without loss. |
| 201 |
< |
The |
| 202 |
< |
.I \-T |
| 203 |
< |
option will send the ALRM signal to |
| 204 |
< |
.I rpiece |
| 205 |
< |
after the specified number of (decimal) hours. |
| 206 |
< |
This is the best way to force a time limit on the computation, |
| 207 |
< |
since information will not be lost, though the process may continue |
| 208 |
< |
for some time afterwards to finish its current piece. |
| 209 |
< |
.SH BUGS |
| 210 |
< |
This program may not work on some systems whose NFS lock manager is |
| 211 |
< |
unreliable. |
| 212 |
< |
In particular, some System V derivative UNIX systems often have |
| 213 |
< |
problems with the network lock manager. |
| 214 |
< |
If the output is scrambled or rpict aborts with some ambient file |
| 215 |
< |
related problem, you should just remove the ambient file and go |
| 216 |
< |
back to normal rendering. |
| 196 |
> |
To compute an array of illuminance contributions according to a Tregenza sky: |
| 197 |
> |
.IP "" .2i |
| 198 |
> |
rtcontrib -b tbin -o sky.dat -m skyglow -b 0 -o ground.dat -m groundglow |
| 199 |
> |
@render.opt -f tregenza.cal scene.oct < test.dat |
| 200 |
> |
.SH ENVIRONMENT |
| 201 |
> |
RAYPATH path to search for -f files |
| 202 |
|
.SH AUTHOR |
| 203 |
|
Greg Ward |
| 204 |
|
.SH "SEE ALSO" |