ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/doc/ray.html
(Generate patch)

Comparing ray/doc/ray.html (file contents):
Revision 1.36 by greg, Tue Dec 12 20:12:47 2023 UTC vs.
Revision 1.40 by greg, Fri Dec 13 18:17:17 2024 UTC

# Line 148 | Line 148 | It is stored as ASCII  text,  with  the  following bas
148           ...
149   </pre>
150  
151 + <p>
152 +
153   A comment line begins with a pound sign, `#'.
154  
155   <p>
# Line 394 | Line 396 | The basic types are given below.
396          0
397   </pre>
398  
399 + <p>
400          If the modifier is &quot;void&quot;, then surfaces will
401          use the modifiers  given  in  the  original  description.  
402          Otherwise, the modifier specified is used in their  place.  
# Line 438 | Line 441 | The basic types are given below.
441          0
442   </pre>
443  
444 + <p>
445 +
446          If the modifier is &quot;void&quot;, then surfaces will
447          use the modifiers  given  in  the  original  mesh description.  
448          Otherwise, the modifier specified is used in their  place.  
# Line 532 | Line 537 | A material defines the way light interacts with a  sur
537          4 red green blue maxrad
538   </pre>
539  
540 + <p>
541          If maxrad is zero, then the surface will never be tested for shadow,  although  it  may participate in an interreflection calculation.  
542          If maxrad is negative, then the  surface  will never  contribute  to scene illumination.  
543          Glow sources will never illuminate objects on the other side of an illum  surface.  
# Line 603 | Line 609 | This is only appropriate if the surface hides other (m
609          n A1 A2 .. An
610   </pre>
611  
612 + <p>
613 +
614          The new direction variables dx, dy and dz need not produce a normalized  vector.  
615          For convenience, the variables DxA, DyA and DzA are defined as the normalized direction to the  target  light  source.  
616          See <a HREF="#Function">section 2.2.1</a> on function files for further information.
# Line 646 | Line 654 | This is only appropriate if the surface hides other (m
654          3  source1  mirror1&gt;source10  mirror2&gt;mirror1&gt;source3
655   </pre>
656  
657 + <p>
658   Normally, only one source is given per mist material, and there is an
659   upper limit of 32 to the total number of active scattering sources.
660   The extinction coefficient, if given, is added the the global
# Line 666 | Line 675 | forward direction, as fit by the Henyey-Greenstein fun
675          P(theta) = (1 - g*g) / (1 + g*g - 2*g*cos(theta))^1.5
676   </pre>
677  
678 + <p>
679 +
680   A perfectly isotropic scattering medium has a g parameter of 0, and
681   a highly directional material has a g parameter close to 1.
682   Fits to the g parameter may be found along with typical extinction
# Line 680 | Line 691 | cloud types in USGS meteorological tables.
691          0|3|6|7 [ rext gext bext [ ralb galb balb [ g ] ] ]
692   </pre>
693  
694 + <p>
695 +
696   There are two usual uses of the mist type.
697   One is to surround a beam from a spotlight or laser so that it is
698   visible during rendering.
# Line 834 | Line 847 | unless the line integrals consider enclosed geometry.
847   <p>
848  
849   <dt>
850 +        <a NAME="WGMDfunc">
851 +        <b>WGMDfunc</b>
852 +        </a>
853 +
854 + <dd>
855 +        WGMDfunc is a more programmable version of <a HREF="#Trans2">trans2</a>,
856 +        with separate modifier paths and variables to control each component.
857 +        (WGMD stands for Ward-Geisler-Moroder-Duer, which is the basis for
858 +        this empirical model, similar to previous ones beside Ashik2.)
859 +        The specification of this material is given below.
860 + <pre>
861 +        mod WGMDfunc id
862 +        13+ rs_mod  rs  rs_urough rs_vrough
863 +            ts_mod  ts  ts_urough ts_vrough
864 +            td_mod
865 +            ux uy uz  funcfile  transform
866 +        0
867 +        9+  rfdif gfdif bfdif
868 +            rbdif gbdif bbdif
869 +            rtdif gtdif btdif
870 +            A10 ..
871 + </pre>
872 +
873 + <p>
874 +
875 + The sum of specular reflectance (<I>rs</I>), specular transmittance (<I>ts</I>),
876 + diffuse reflectance (<I>rfdif gfdif bfdif</I> for front and <I>rbdif gbdif bbdif</I> for back)
877 + and diffuse transmittance (<I>rtdif gtdif btdif</I>) should be less than 1 for each
878 + channel.
879 +
880 + <p>
881 +
882 + Unique to this material, separate modifier channels are
883 + provided for each component.
884 + The main modifier is used on the diffuse reflectance, both
885 + front and back.
886 + The <I>rs_mod</I> modifier is used for specular reflectance.
887 + If "void" is given for <I>rs_mod</I>,
888 + then the specular reflection color will be white.
889 + The special "inherit" keyword may also be given, in which case
890 + specular reflectance will share the main modifier.
891 + This behavior is replicated for the specular transmittance modifier
892 + <I>ts_mod</I>, which also has its own independent roughness expressions.
893 + Finally, the diffuse transmittance modifier is given as
894 + <I>td_mod</I>, which may also be "void" or "inherit".
895 + Note that any spectra or color for specular components must be
896 + carried by the named modifier(s).
897 +
898 + <p>
899 +
900 + The main advantage to this material over
901 + <a HREF="#BRTDfunc">BRTDfunc</a> and
902 + other programmable types described below is that the specular sampling is
903 + well-defined, so that all components are fully computed.
904 +
905 + <p>
906 +
907 + <dt>
908          <a NAME="Dielectric">
909          <b>Dielectric</b>
910          </a>
# Line 894 | Line 965 | unless the line integrals consider enclosed geometry.
965          tn = (sqrt(.8402528435+.0072522239*Tn*Tn)-.9166530661)/.0036261119/Tn
966   </pre>
967  
968 + <p>
969 +
970          Standard 88% transmittance glass  has  a  transmissivity  of 0.96.  
971          (A <a HREF="#Patterns">pattern</a> modifying glass will affect the transmissivity.)
972          If a fourth real argument is given,  it  is  interpreted as the index of refraction to use instead of 1.52.
# Line 925 | Line 998 | unless the line integrals consider enclosed geometry.
998          4+ red green blue spec A5 ..
999   </pre>
1000  
1001 + <p>
1002 +
1003          The function refl takes four arguments, the x, y and z
1004          direction towards the incident light, and the solid angle
1005          subtended by the source.
# Line 966 | Line 1041 | unless the line integrals consider enclosed geometry.
1041          6+ red green blue rspec trans tspec A7 ..
1042   </pre>
1043  
1044 + <p>
1045 +
1046          Where trans is the total light transmitted and tspec is  the non-Lambertian  fraction of transmitted light.  
1047          The function brtd should integrate to 1 over each projected hemisphere.
1048  
# Line 993 | Line 1070 | unless the line integrals consider enclosed geometry.
1070               A10 ..
1071   </pre>
1072  
1073 + <p>
1074 +
1075          The variables rrefl, grefl and brefl specify the color coefficients  for  the ideal specular (mirror) reflection of the surface.  
1076          The variables rtrns, gtrns and btrns  specify  the color coefficients for the ideal specular transmission.  
1077          The functions rbrtd, gbrtd and bbrtd take the direction to the incident light (and its solid angle) and  
# Line 1037 | Line 1116 | unless the line integrals consider enclosed geometry.
1116          4+ red green blue spec A5 ..
1117   </pre>
1118  
1119 + <p>
1120 +
1121          The coordinate indices (x1, x2, etc.) are  themselves  functions  of  the  x,  y and z direction to the incident light, plus the solid angle
1122          subtended by the light source (usually ignored).
1123          The data function (func) takes five variables, the
# Line 1203 | Line 1284 | unless the line integrals consider enclosed geometry.
1284          0
1285   </pre>
1286  
1287 + <p>
1288 +
1289          The first modifier will also be used to shade  the  area  leaving the  antimatter  volume and entering the regular volume.  
1290          If mod1 is void, the antimatter volume is completely invisible.
1291          Antimatter  does  not  work  properly with the material type <a HREF="#Trans">&quot;trans&quot;</a>,
# Line 1257 | Line 1340 | A texture is a perturbation of the surface normal,  an
1340          n A1 A2 .. An
1341   </pre>
1342  
1343 + <p>
1344 +
1345   </dl>
1346  
1347   <p>
# Line 1396 | Line 1481 | A colorfunc is a procedurally  defined  color  pattern
1481                  [spacing]
1482   </pre>
1483  
1484 + <p>
1485 +
1486   or:
1487  
1488   <pre>
# Line 1433 | Line 1520 | or:
1520                  [spacing]
1521   </pre>
1522  
1523 + <p>
1524 +
1525   or:
1526  
1527   <pre>
# Line 1540 | Line 1629 | or:
1629  
1630   <pre>
1631          mod specfunc id
1632 <        2+ sval funcfile transform
1632 >        2+ sfunc funcfile transform
1633          0
1634          2+ nmA nmB A3 ..
1635   </pre>
# Line 1553 | Line 1642 | or:
1642          between nmA and nmB as its only argument,
1643          and it returns the corresponding spectral intensity.
1644  
1645 + <dt>
1646 +       <a NAME="Specdata">
1647 +       <b>Specdata</b>
1648 +       </a>
1649 +
1650 + <dd>
1651 +        Specdata is like brightdata and colordata, but with more
1652 +        than 3 specular samples.
1653 +
1654 + <pre>
1655 +        mod specdata id
1656 +        3+n+
1657 +                func datafile
1658 +                funcfile x1 x2 .. xn transform
1659 +        0
1660 +        m A1 A2 .. Am
1661 + </pre>
1662 +
1663 + <p>
1664 +        The data file must have one more dimension than the coordinate
1665 +        variable count, as this final dimension corresponds to the covered
1666 +        spectrum.
1667 +        The starting and ending wavelengths are specified in "datafile"
1668 +        as well as the number of spectral samples.
1669 +        The function "func" will be called with two parameters, the
1670 +        interpolated spectral value for the current coordinate and the
1671 +        associated wavelength.
1672 +        If the spectrum is broken into 12 components, then 12 calls
1673 +        will be made to "func" for the relevant ray evaluation.
1674 +
1675 + <dt>
1676 +       <a NAME="Specpict">
1677 +       <b>Specpict</b>
1678 +       </a>
1679 +
1680 + <dd>
1681 +        Specpict is a special case of specdata, where the pattern is
1682 +        a hyperspectral image stored in the common-exponent file format.
1683 +        The dimensions of the image data are determined by the picture
1684 +        just as with the colorpict primitive.
1685 +
1686 + <pre>
1687 +        mod specpict id
1688 +        5+
1689 +                func specfile
1690 +                funcfile u v transform
1691 +        0
1692 +        m A1 A2 .. Am
1693 + </pre>
1694 +
1695 + <p>
1696 +        The function "func" is called with the interpolated pixel value
1697 +        and the wavelength sample in nanometers, the same as specdata,
1698 +        with as many calls made as there are components in "specfile".
1699 +
1700   </dl>
1701  
1702   <p>
# Line 1585 | Line 1729 | A mixfunc mixes  two  modifiers  procedurally.   It  i
1729          n A1 A2 .. An
1730   </pre>
1731  
1732 + <p>
1733 +
1734          Foreground and background are modifier names that must be
1735          defined earlier in the scene description.
1736          If one of these is a material, then
# Line 1613 | Line 1759 | A mixfunc mixes  two  modifiers  procedurally.   It  i
1759          m A1 A2 .. Am
1760   </pre>
1761  
1762 + <p>
1763 +
1764   <dt>
1765          <a NAME="Mixpict">
1766          <b>Mixpict</b>
# Line 1657 | Line 1805 | A mixfunc mixes  two  modifiers  procedurally.   It  i
1805                  [spacing]
1806   </pre>
1807  
1808 + <p>
1809 +
1810   or:
1811  
1812   <pre>
# Line 1672 | Line 1822 | or:
1822                  [spacing]
1823   </pre>
1824  
1825 + <p>
1826 +
1827   </dl>
1828  
1829   <p>
# Line 1716 | Line 1868 | An example function file is given below:
1868          cfunc(x) : 10*x / sqrt(x) ;
1869   </pre>
1870  
1871 + <p>
1872 +
1873   Many variables and functions are already defined by the program, and they are listed in the file rayinit.cal.  
1874   The following variables are particularly important:
1875  
# Line 1730 | Line 1884 | The following variables are particularly important:
1884                  arg(i)                  - i'th real argument
1885   </pre>
1886  
1887 + <p>
1888 +
1889   For mesh objects, the local surface coordinates are available:
1890  
1891   <pre>
1892                  Lu, Lv                  - local (u,v) coordinates
1893   </pre>
1894  
1895 + <p>
1896 +
1897   For BRDF types, the following variables are defined as well:
1898  
1899   <pre>
# Line 1744 | Line 1902 | For BRDF types, the following variables are defined as
1902                  CrP, CgP, CbP           - perturbed material color
1903   </pre>
1904  
1905 + <p>
1906 +
1907   A unique context is set up for each file so
1908   that  the  same variable may appear in different
1909   function files without conflict.  
# Line 1798 | Line 1958 | The basic data file format is as follows:
1958          DATA, later dimensions changing faster.
1959   </pre>
1960  
1961 + <p>
1962 +
1963   N is the number of  dimensions.  
1964   For  each  dimension,  the beginning  and  ending  coordinate  values and the dimension size is given.  
1965   Alternatively, individual coordinate  values can  be  given when the points are not evenly spaced.  
# Line 1826 | Line 1988 | All numbers are decimal integers:
1988           ...
1989   </pre>
1990  
1991 + <p>
1992 +
1993   The ASCII codes can appear in any order.  N is the number of vertices,  and  the  last  is automatically connected to the first.  
1994   Separate polygonal sections are joined by coincident sides.  
1995   The  character  coordinate  system is a square with lower left corner at (0,0), lower right at (255,0) and upper right at (255,255).
# Line 2013 | Line 2177 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
2177   OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2178   SUCH DAMAGE.
2179   </pre>
2180 +
2181 + <p>
2182  
2183   <hr>
2184  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines