1 |
|
.\" RCSid "$Id$" |
2 |
|
.\" Print using the -ms macro package |
3 |
< |
.DA 5/11/2023 |
3 |
> |
.DA 12/09/2024 |
4 |
|
.LP |
5 |
< |
.tl """Copyright \(co 2023 Regents, University of California |
5 |
> |
.tl """Copyright \(co 2024 Regents, University of California |
6 |
|
.sp 2 |
7 |
|
.TL |
8 |
|
The |
639 |
|
8 dred dgrn dblu sred sgrn sblu u-power v-power |
640 |
|
.DE |
641 |
|
.LP |
642 |
+ |
.UL WGMDfunc |
643 |
+ |
.PP |
644 |
+ |
WGMDfunc is a more programmable version of trans2, |
645 |
+ |
with separate modifier paths and variables to control each component. |
646 |
+ |
(WGMD stands for Ward-Geisler-Moroder-Duer, which is the basis for |
647 |
+ |
this empirical model, similar to the previous ones beside Ashik2.)\0 |
648 |
+ |
The specification of this material is given below. |
649 |
+ |
.DS |
650 |
+ |
mod WGMDfunc id |
651 |
+ |
13+ rs_mod rs rs_urough rs_vrough |
652 |
+ |
ts_mod ts ts_urough ts_vrough |
653 |
+ |
td_mod |
654 |
+ |
ux uy uz funcfile transform |
655 |
+ |
0 |
656 |
+ |
9+ rfdif gfdif bfdif |
657 |
+ |
rbdif gbdif bbdif |
658 |
+ |
rtdif gtdif btdif |
659 |
+ |
A10 .. |
660 |
+ |
.DE |
661 |
+ |
The sum of specular reflectance ( |
662 |
+ |
.I rs |
663 |
+ |
), specular transmittance ( |
664 |
+ |
.I ts |
665 |
+ |
), diffuse reflectance ( |
666 |
+ |
.I "rfdif gfdif bfdif" |
667 |
+ |
for front and |
668 |
+ |
.I "rbdif gbdif bbdif" |
669 |
+ |
for back) |
670 |
+ |
and diffuse transmittance ( |
671 |
+ |
.I "rtdif gtdif btdif" |
672 |
+ |
) should be less than 1 for each |
673 |
+ |
channel. |
674 |
+ |
.PP |
675 |
+ |
Unique to this material, separate modifier channels are |
676 |
+ |
provided for each component. |
677 |
+ |
The main modifier is used on the diffuse reflectance, both |
678 |
+ |
front and back. |
679 |
+ |
The |
680 |
+ |
.I rs_mod |
681 |
+ |
modifier is used for specular reflectance. |
682 |
+ |
If "void" is given for |
683 |
+ |
.I rs_mod, |
684 |
+ |
then the specular reflection color will be white. |
685 |
+ |
The special "inherit" keyword may also be given, in which case |
686 |
+ |
specular reflectance will share the main modifier. |
687 |
+ |
This behavior is replicated for the specular transmittance modifier |
688 |
+ |
.I ts_mod, |
689 |
+ |
which has its own independent roughness expressions. |
690 |
+ |
Finally, the diffuse transmittance modifier is given as |
691 |
+ |
.I td_mod, |
692 |
+ |
which may also be "void" or "inherit". |
693 |
+ |
Note that any spectra or color for specular components must be |
694 |
+ |
carried by the named modifier(s). |
695 |
+ |
.PP |
696 |
+ |
The main advantage to this material over BRTDfunc and |
697 |
+ |
other programmable types described below is that the specular sampling is |
698 |
+ |
well-defined, so that all components are fully computed. |
699 |
+ |
.LP |
700 |
|
.UL Dielectric |
701 |
|
.PP |
702 |
|
A dielectric material is transparent, and it refracts light |
1252 |
|
font such as hexbit4x1.fnt, calls for uniform spacing. |
1253 |
|
Reasonable magnitudes for proportional spacing are |
1254 |
|
between 0.1 (for tightly spaced characters) and 0.3 (for wide spacing). |
1255 |
+ |
.LP |
1256 |
+ |
.UL Spectrum |
1257 |
+ |
.PP |
1258 |
+ |
The spectrum primitive is the most basic type for introducing spectral |
1259 |
+ |
color to a material. |
1260 |
+ |
Since materials only provide RGB parameters, spectral patterns |
1261 |
+ |
are the only way to superimpose wavelength-dependent behavior. |
1262 |
+ |
.DS |
1263 |
+ |
mod spectrum id |
1264 |
+ |
0 |
1265 |
+ |
0 |
1266 |
+ |
5+ nmA nmB s1 s2 .. sN |
1267 |
+ |
.DE |
1268 |
+ |
The first two real arguments indicate the extrema of the |
1269 |
+ |
spectral range in nanometers. |
1270 |
+ |
Subsequent real values correspond to multipliers at each wavelength. |
1271 |
+ |
The nmA wavelength may be greater or less than nmB, |
1272 |
+ |
but they may not be equal, and their ordering matches |
1273 |
+ |
the order of the spectral values. |
1274 |
+ |
A minimum of 3 values must be given, which would act |
1275 |
+ |
more or less the same as a constant RGB multiplier. |
1276 |
+ |
As with RGB values, spectral quantities normally range between 0 |
1277 |
+ |
and 1 at each wavelength, or average to 1.0 against a standard |
1278 |
+ |
sensitivity functions such as V(lambda). |
1279 |
+ |
The best results obtain when the spectral range and number |
1280 |
+ |
of samples match rendering options, though resampling will handle |
1281 |
+ |
any differences, zero-filling wavelenths outside the nmA to nmB |
1282 |
+ |
range. |
1283 |
+ |
A warning will be issued if the given wavelength range does not |
1284 |
+ |
adequately cover the visible spectrum. |
1285 |
+ |
.LP |
1286 |
+ |
.UL Specfile |
1287 |
+ |
.PP |
1288 |
+ |
The specfile primitive is equivalent to the spectrum type, but |
1289 |
+ |
the wavelength range and values are contained in a 1-dimensional |
1290 |
+ |
data file. |
1291 |
+ |
This may be a more convenient way to specify a spectral color, |
1292 |
+ |
especially one corresponding to a standard illuminant such as D65 |
1293 |
+ |
or a library of measured spectra. |
1294 |
+ |
.DS |
1295 |
+ |
mod specfile id |
1296 |
+ |
1 datafile |
1297 |
+ |
0 |
1298 |
+ |
0 |
1299 |
+ |
.DE |
1300 |
+ |
As with the spectrum type, rendering wavelengths outside the defined |
1301 |
+ |
range will be zero-filled. |
1302 |
+ |
Unlike the spectrum type, the file may contain non-uniform samples. |
1303 |
+ |
.LP |
1304 |
+ |
.UL Specfunc |
1305 |
+ |
.PP |
1306 |
+ |
The specfunc primitive offers dynamic control over a spectral |
1307 |
+ |
pattern, similar to the colorfunc type. |
1308 |
+ |
.DS |
1309 |
+ |
mod specfunc id |
1310 |
+ |
2+ sfunc funcfile transform |
1311 |
+ |
0 |
1312 |
+ |
2+ nmA nmB A3 .. |
1313 |
+ |
.DE |
1314 |
+ |
Like the spectrum primitive, the wavelength range is specified |
1315 |
+ |
in the first two real arguments, and additional real values are |
1316 |
+ |
set in the evaluation context. |
1317 |
+ |
This function is fed a wavelenth sample |
1318 |
+ |
between nmA and nmB as its only argument, |
1319 |
+ |
and it returns the corresponding spectral intensity. |
1320 |
+ |
.LP |
1321 |
+ |
.UL Specdata |
1322 |
+ |
.PP |
1323 |
+ |
Specdata is like brightdata and colordata, but with more |
1324 |
+ |
than 3 specular samples. |
1325 |
+ |
.DS |
1326 |
+ |
mod specdata id |
1327 |
+ |
3+n+ |
1328 |
+ |
func datafile |
1329 |
+ |
funcfile x1 x2 .. xn transform |
1330 |
+ |
0 |
1331 |
+ |
m A1 A2 .. Am |
1332 |
+ |
.DE |
1333 |
+ |
The data file must have one more dimension than the coordinate |
1334 |
+ |
variable count, as this final dimension corresponds to the covered |
1335 |
+ |
spectrum. |
1336 |
+ |
The starting and ending wavelengths are specified in "datafile" |
1337 |
+ |
as well as the number of spectral samples. |
1338 |
+ |
The function "func" will be called with two parameters, the |
1339 |
+ |
interpolated spectral value for the current coordinate and the |
1340 |
+ |
associated wavelength. |
1341 |
+ |
If the spectrum is broken into 12 components, then 12 calls |
1342 |
+ |
will be made to "func" for the relevant ray evaluation. |
1343 |
+ |
.LP |
1344 |
+ |
.UL Specpict |
1345 |
+ |
.PP |
1346 |
+ |
Specpict is a special case of specdata, where the pattern is |
1347 |
+ |
a hyperspectral image stored in the common-exponent file format. |
1348 |
+ |
The dimensions of the image data are determined by the picture |
1349 |
+ |
just as with the colorpict primitive. |
1350 |
+ |
.DS |
1351 |
+ |
mod specpict id |
1352 |
+ |
5+ |
1353 |
+ |
func specfile |
1354 |
+ |
funcfile u v transform |
1355 |
+ |
0 |
1356 |
+ |
m A1 A2 .. Am |
1357 |
+ |
.DE |
1358 |
+ |
The function "func" is called with the interpolated pixel value |
1359 |
+ |
and the wavelength sample in nanometers, the same as specdata, |
1360 |
+ |
with as many calls made as there are components in "specfile". |
1361 |
|
.NH 3 |
1362 |
|
Mixtures |
1363 |
|
.PP |