834 |
|
<p> |
835 |
|
|
836 |
|
<dt> |
837 |
+ |
<a NAME="WGMDfunc"> |
838 |
+ |
<b>WGMDfunc</b> |
839 |
+ |
</a> |
840 |
+ |
|
841 |
+ |
<dd> |
842 |
+ |
WGMDfunc is a more programmable version of <a HREF="#Trans2">trans2</a>, |
843 |
+ |
with separate modifier paths and variables to control each component. |
844 |
+ |
(WGMD stands for Ward-Geisler-Moroder-Duer, which is the basis for |
845 |
+ |
this empirical model, similar to previous ones beside Ashik2.) |
846 |
+ |
The specification of this material is given below. |
847 |
+ |
<pre> |
848 |
+ |
mod WGMDfunc id |
849 |
+ |
13+ rs_mod rs rs_urough rs_vrough |
850 |
+ |
ts_mod ts ts_urough ts_vrough |
851 |
+ |
td_mod |
852 |
+ |
ux uy uz funcfile transform |
853 |
+ |
0 |
854 |
+ |
9+ rfdif gfdif bfdif |
855 |
+ |
rbdif gbdif bbdif |
856 |
+ |
rtdif gtdif btdif |
857 |
+ |
A10 .. |
858 |
+ |
</pre> |
859 |
+ |
|
860 |
+ |
The sum of specular reflectance (<I>rs</I>), specular transmittance (<I>ts</I>), |
861 |
+ |
diffuse reflectance (<I>rfdif gfdif bfdif</I> for front and <I>rbdif gbdif bbdif</I> for back) |
862 |
+ |
and diffuse transmittance (<I>rtdif gtdif btdif</I>) should be less than 1 for each |
863 |
+ |
channel. |
864 |
+ |
|
865 |
+ |
<p> |
866 |
+ |
|
867 |
+ |
Unique to this material, separate modifier channels are |
868 |
+ |
provided for each component. |
869 |
+ |
The main modifier is used on the diffuse reflectance, both |
870 |
+ |
front and back. |
871 |
+ |
The <I>rs_mod</I> modifier is used for specular reflectance. |
872 |
+ |
If "void" is given for <I>rs_mod</I>, |
873 |
+ |
then the specular reflection color will be white. |
874 |
+ |
The special "inherit" keyword may also be given, in which case |
875 |
+ |
specular reflectance will share the main modifier. |
876 |
+ |
This behavior is replicated for the specular transmittance modifier |
877 |
+ |
<I>ts_mod</I>, which also has its own independent roughness expressions. |
878 |
+ |
Finally, the diffuse transmittance modifier is given as |
879 |
+ |
<I>td_mod</I>, which may also be "void" or "inherit". |
880 |
+ |
Note that any spectra or color for specular components must be |
881 |
+ |
carried by the named modifier(s). |
882 |
+ |
|
883 |
+ |
<p> |
884 |
+ |
|
885 |
+ |
The main advantage to this material over |
886 |
+ |
<a HREF="#BRTDfunc">BRTDfunc</a> and |
887 |
+ |
other programmable types described below is that the specular sampling is |
888 |
+ |
well-defined, so that all components are fully computed. |
889 |
+ |
|
890 |
+ |
<p> |
891 |
+ |
|
892 |
+ |
<dt> |
893 |
|
<a NAME="Dielectric"> |
894 |
|
<b>Dielectric</b> |
895 |
|
</a> |
1596 |
|
|
1597 |
|
<pre> |
1598 |
|
mod specfunc id |
1599 |
< |
2+ sval funcfile transform |
1599 |
> |
2+ sfunc funcfile transform |
1600 |
|
0 |
1601 |
|
2+ nmA nmB A3 .. |
1602 |
|
</pre> |
1608 |
|
This function is fed a wavelenth sample |
1609 |
|
between nmA and nmB as its only argument, |
1610 |
|
and it returns the corresponding spectral intensity. |
1611 |
+ |
|
1612 |
+ |
<dt> |
1613 |
+ |
<a NAME="Specdata"> |
1614 |
+ |
<b>Specdata</b> |
1615 |
+ |
</a> |
1616 |
+ |
|
1617 |
+ |
<dd> |
1618 |
+ |
Specdata is like brightdata and colordata, but with more |
1619 |
+ |
than 3 specular samples. |
1620 |
+ |
|
1621 |
+ |
<pre> |
1622 |
+ |
mod specdata id |
1623 |
+ |
3+n+ |
1624 |
+ |
func datafile |
1625 |
+ |
funcfile x1 x2 .. xn transform |
1626 |
+ |
0 |
1627 |
+ |
m A1 A2 .. Am |
1628 |
+ |
</pre> |
1629 |
+ |
|
1630 |
+ |
<p> |
1631 |
+ |
The data file must have one more dimension than the coordinate |
1632 |
+ |
variable count, as this final dimension corresponds to the covered |
1633 |
+ |
spectrum. |
1634 |
+ |
The starting and ending wavelengths are specified in "datafile" |
1635 |
+ |
as well as the number of spectral samples. |
1636 |
+ |
The function "func" will be called with two parameters, the |
1637 |
+ |
interpolated spectral value for the current coordinate and the |
1638 |
+ |
associated wavelength. |
1639 |
+ |
If the spectrum is broken into 12 components, then 12 calls |
1640 |
+ |
will be made to "func" for the relevant ray evaluation. |
1641 |
+ |
|
1642 |
+ |
<dt> |
1643 |
+ |
<a NAME="Specpict"> |
1644 |
+ |
<b>Specpict</b> |
1645 |
+ |
</a> |
1646 |
+ |
|
1647 |
+ |
<dd> |
1648 |
+ |
Specpict is a special case of specdata, where the pattern is |
1649 |
+ |
a hyperspectral image stored in the common-exponent file format. |
1650 |
+ |
The dimensions of the image data are determined by the picture |
1651 |
+ |
just as with the colorpict primitive. |
1652 |
+ |
|
1653 |
+ |
<pre> |
1654 |
+ |
mod specpict id |
1655 |
+ |
5+ |
1656 |
+ |
func specfile |
1657 |
+ |
funcfile u v transform |
1658 |
+ |
0 |
1659 |
+ |
m A1 A2 .. Am |
1660 |
+ |
</pre> |
1661 |
+ |
|
1662 |
+ |
<p> |
1663 |
+ |
The function "func" is called with the interpolated pixel value |
1664 |
+ |
and the wavelength sample in nanometers, the same as specdata, |
1665 |
+ |
with as many calls made as there are components in "specfile". |
1666 |
|
|
1667 |
|
</dl> |
1668 |
|
|