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.34 by greg, Thu Nov 16 21:57:39 2023 UTC vs.
Revision 1.42 by greg, Fri May 30 16:35:52 2025 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 580 | Line 586 | This is only appropriate if the surface hides other (m
586          3 red green blue
587   </pre>
588  
589 +        While alternate materials that are reflective will appear as normal,
590 +        indirect rays will use the mirror's reflectance rather than the
591 +        alternate type.
592 +        Transmitting materials are an exception, where both transmission and
593 +        reflection will use the alternate type for all rays not specifically
594 +        targeting virtual light sources.
595 +        In this case, it is important that any reflections be purely specular
596 +        (mirror-like) and equal to the mirror's reflectivity
597 +        to maintain a valid result.
598 +        A pure diffuse reflection may be added if desired.
599 +
600   <p>
601  
602 +        The mirror material type reflects light sources only from the front side
603 +        of a surface, regardless of any alternate material.
604 +        If virtual source generation is desired on both sides, two coincident
605 +        surfaces with opposite normal orientations may be employed to achieve
606 +        this effect.
607 +        The reflectance and alternate material type may be
608 +        different for the overlapped surfaces,
609 +        and the two sides will behave accordingly.
610 +
611 + <p>
612 +
613   <dt>
614          <a NAME="Prism1">
615          <b>Prism1</b>
# Line 603 | Line 631 | This is only appropriate if the surface hides other (m
631          n A1 A2 .. An
632   </pre>
633  
634 + <p>
635 +
636          The new direction variables dx, dy and dz need not produce a normalized  vector.  
637          For convenience, the variables DxA, DyA and DzA are defined as the normalized direction to the  target  light  source.  
638          See <a HREF="#Function">section 2.2.1</a> on function files for further information.
# Line 646 | Line 676 | This is only appropriate if the surface hides other (m
676          3  source1  mirror1&gt;source10  mirror2&gt;mirror1&gt;source3
677   </pre>
678  
679 + <p>
680   Normally, only one source is given per mist material, and there is an
681   upper limit of 32 to the total number of active scattering sources.
682   The extinction coefficient, if given, is added the the global
# Line 666 | Line 697 | forward direction, as fit by the Henyey-Greenstein fun
697          P(theta) = (1 - g*g) / (1 + g*g - 2*g*cos(theta))^1.5
698   </pre>
699  
700 + <p>
701 +
702   A perfectly isotropic scattering medium has a g parameter of 0, and
703   a highly directional material has a g parameter close to 1.
704   Fits to the g parameter may be found along with typical extinction
# Line 680 | Line 713 | cloud types in USGS meteorological tables.
713          0|3|6|7 [ rext gext bext [ ralb galb balb [ g ] ] ]
714   </pre>
715  
716 + <p>
717 +
718   There are two usual uses of the mist type.
719   One is to surround a beam from a spotlight or laser so that it is
720   visible during rendering.
# Line 834 | Line 869 | unless the line integrals consider enclosed geometry.
869   <p>
870  
871   <dt>
872 +        <a NAME="WGMDfunc">
873 +        <b>WGMDfunc</b>
874 +        </a>
875 +
876 + <dd>
877 +        WGMDfunc is a more programmable version of <a HREF="#Trans2">trans2</a>,
878 +        with separate modifier paths and variables to control each component.
879 +        (WGMD stands for Ward-Geisler-Moroder-Duer, which is the basis for
880 +        this empirical model, similar to previous ones beside Ashik2.)
881 +        The specification of this material is given below.
882 + <pre>
883 +        mod WGMDfunc id
884 +        13+ rs_mod  rs  rs_urough rs_vrough
885 +            ts_mod  ts  ts_urough ts_vrough
886 +            td_mod
887 +            ux uy uz  funcfile  transform
888 +        0
889 +        9+  rfdif gfdif bfdif
890 +            rbdif gbdif bbdif
891 +            rtdif gtdif btdif
892 +            A10 ..
893 + </pre>
894 +
895 + <p>
896 +
897 + The sum of specular reflectance (<I>rs</I>), specular transmittance (<I>ts</I>),
898 + diffuse reflectance (<I>rfdif gfdif bfdif</I> for front and <I>rbdif gbdif bbdif</I> for back)
899 + and diffuse transmittance (<I>rtdif gtdif btdif</I>) should be less than 1 for each
900 + channel.
901 +
902 + <p>
903 +
904 + Unique to this material, separate modifier channels are
905 + provided for each component.
906 + The main modifier is used on the diffuse reflectance, both
907 + front and back.
908 + The <I>rs_mod</I> modifier is used for specular reflectance.
909 + If "void" is given for <I>rs_mod</I>,
910 + then the specular reflection color will be white.
911 + The special "inherit" keyword may also be given, in which case
912 + specular reflectance will share the main modifier.
913 + This behavior is replicated for the specular transmittance modifier
914 + <I>ts_mod</I>, which also has its own independent roughness expressions.
915 + Finally, the diffuse transmittance modifier is given as
916 + <I>td_mod</I>, which may also be "void" or "inherit".
917 + Note that any spectra or color for specular components must be
918 + carried by the named modifier(s).
919 +
920 + <p>
921 +
922 + The main advantage to this material over
923 + <a HREF="#BRTDfunc">BRTDfunc</a> and
924 + other programmable types described below is that the specular sampling is
925 + well-defined, so that all components are fully computed.
926 +
927 + <p>
928 +
929 + <dt>
930          <a NAME="Dielectric">
931          <b>Dielectric</b>
932          </a>
# Line 894 | Line 987 | unless the line integrals consider enclosed geometry.
987          tn = (sqrt(.8402528435+.0072522239*Tn*Tn)-.9166530661)/.0036261119/Tn
988   </pre>
989  
990 + <p>
991 +
992          Standard 88% transmittance glass  has  a  transmissivity  of 0.96.  
993          (A <a HREF="#Patterns">pattern</a> modifying glass will affect the transmissivity.)
994          If a fourth real argument is given,  it  is  interpreted as the index of refraction to use instead of 1.52.
# Line 925 | Line 1020 | unless the line integrals consider enclosed geometry.
1020          4+ red green blue spec A5 ..
1021   </pre>
1022  
1023 + <p>
1024 +
1025          The function refl takes four arguments, the x, y and z
1026          direction towards the incident light, and the solid angle
1027          subtended by the source.
# Line 966 | Line 1063 | unless the line integrals consider enclosed geometry.
1063          6+ red green blue rspec trans tspec A7 ..
1064   </pre>
1065  
1066 + <p>
1067 +
1068          Where trans is the total light transmitted and tspec is  the non-Lambertian  fraction of transmitted light.  
1069          The function brtd should integrate to 1 over each projected hemisphere.
1070  
# Line 993 | Line 1092 | unless the line integrals consider enclosed geometry.
1092               A10 ..
1093   </pre>
1094  
1095 + <p>
1096 +
1097          The variables rrefl, grefl and brefl specify the color coefficients  for  the ideal specular (mirror) reflection of the surface.  
1098          The variables rtrns, gtrns and btrns  specify  the color coefficients for the ideal specular transmission.  
1099          The functions rbrtd, gbrtd and bbrtd take the direction to the incident light (and its solid angle) and  
# Line 1037 | Line 1138 | unless the line integrals consider enclosed geometry.
1138          4+ red green blue spec A5 ..
1139   </pre>
1140  
1141 + <p>
1142 +
1143          The coordinate indices (x1, x2, etc.) are  themselves  functions  of  the  x,  y and z direction to the incident light, plus the solid angle
1144          subtended by the light source (usually ignored).
1145          The data function (func) takes five variables, the
# Line 1203 | Line 1306 | unless the line integrals consider enclosed geometry.
1306          0
1307   </pre>
1308  
1309 + <p>
1310 +
1311          The first modifier will also be used to shade  the  area  leaving the  antimatter  volume and entering the regular volume.  
1312          If mod1 is void, the antimatter volume is completely invisible.
1313          Antimatter  does  not  work  properly with the material type <a HREF="#Trans">&quot;trans&quot;</a>,
# Line 1257 | Line 1362 | A texture is a perturbation of the surface normal,  an
1362          n A1 A2 .. An
1363   </pre>
1364  
1365 + <p>
1366 +
1367   </dl>
1368  
1369   <p>
# Line 1396 | Line 1503 | A colorfunc is a procedurally  defined  color  pattern
1503                  [spacing]
1504   </pre>
1505  
1506 + <p>
1507 +
1508   or:
1509  
1510   <pre>
# Line 1433 | Line 1542 | or:
1542                  [spacing]
1543   </pre>
1544  
1545 + <p>
1546 +
1547   or:
1548  
1549   <pre>
# Line 1482 | Line 1593 | or:
1593   </pre>
1594  
1595   <p>
1596 <        The first two real arguments indicate the limits of the covered
1596 >        The first two real arguments indicate the extrema of the
1597          spectral range in nanometers.
1598 <        Subsequent real values correspond to multipliers in each wavelength band,
1488 <        where the first band goes from nmA to nmA+(nmB-nmA)/N, and N is the
1489 <        number of bands (i.e., the number of real arguments minus 2).
1598 >        Subsequent real values correspond to multipliers at each wavelength.
1599          The nmA wavelength may be greater or less than nmB,
1600          but they may not be equal, and their ordering matches
1601          the order of the spectral values.
# Line 1542 | Line 1651 | or:
1651  
1652   <pre>
1653          mod specfunc id
1654 <        2+ sval funcfile transform
1654 >        2+ sfunc funcfile transform
1655          0
1656          2+ nmA nmB A3 ..
1657   </pre>
# Line 1550 | Line 1659 | or:
1659   <p>
1660          Like the spectrum primitive, the wavelength range is specified
1661          in the first two real arguments, and additional real values are
1662 <        accessible to the sval function.
1662 >        set in the evaluation context.
1663          This function is fed a wavelenth sample
1664          between nmA and nmB as its only argument,
1665          and it returns the corresponding spectral intensity.
1666  
1667 + <dt>
1668 +       <a NAME="Specdata">
1669 +       <b>Specdata</b>
1670 +       </a>
1671 +
1672 + <dd>
1673 +        Specdata is like brightdata and colordata, but with more
1674 +        than 3 specular samples.
1675 +
1676 + <pre>
1677 +        mod specdata id
1678 +        3+n+
1679 +                func datafile
1680 +                funcfile x1 x2 .. xn transform
1681 +        0
1682 +        m A1 A2 .. Am
1683 + </pre>
1684 +
1685 + <p>
1686 +        The data file must have one more dimension than the coordinate
1687 +        variable count, as this final dimension corresponds to the covered
1688 +        spectrum.
1689 +        The starting and ending wavelengths are specified in "datafile"
1690 +        as well as the number of spectral samples.
1691 +        The function "func" will be called with two parameters, the
1692 +        interpolated spectral value for the current coordinate and the
1693 +        associated wavelength.
1694 +        If the spectrum is broken into 12 components, then 12 calls
1695 +        will be made to "func" for the relevant ray evaluation.
1696 +
1697 + <dt>
1698 +       <a NAME="Specpict">
1699 +       <b>Specpict</b>
1700 +       </a>
1701 +
1702 + <dd>
1703 +        Specpict is a special case of specdata, where the pattern is
1704 +        a hyperspectral image stored in the common-exponent file format.
1705 +        The dimensions of the image data are determined by the picture
1706 +        just as with the colorpict primitive.
1707 +
1708 + <pre>
1709 +        mod specpict id
1710 +        5+
1711 +                func specfile
1712 +                funcfile u v transform
1713 +        0
1714 +        m A1 A2 .. Am
1715 + </pre>
1716 +
1717 + <p>
1718 +        The function "func" is called with the interpolated pixel value
1719 +        and the wavelength sample in nanometers, the same as specdata,
1720 +        with as many calls made as there are components in "specfile".
1721 +
1722   </dl>
1723  
1724   <p>
# Line 1587 | Line 1751 | A mixfunc mixes  two  modifiers  procedurally.   It  i
1751          n A1 A2 .. An
1752   </pre>
1753  
1754 + <p>
1755 +
1756          Foreground and background are modifier names that must be
1757          defined earlier in the scene description.
1758          If one of these is a material, then
# Line 1615 | Line 1781 | A mixfunc mixes  two  modifiers  procedurally.   It  i
1781          m A1 A2 .. Am
1782   </pre>
1783  
1784 + <p>
1785 +
1786   <dt>
1787          <a NAME="Mixpict">
1788          <b>Mixpict</b>
# Line 1659 | Line 1827 | A mixfunc mixes  two  modifiers  procedurally.   It  i
1827                  [spacing]
1828   </pre>
1829  
1830 + <p>
1831 +
1832   or:
1833  
1834   <pre>
# Line 1674 | Line 1844 | or:
1844                  [spacing]
1845   </pre>
1846  
1847 + <p>
1848 +
1849   </dl>
1850  
1851   <p>
# Line 1718 | Line 1890 | An example function file is given below:
1890          cfunc(x) : 10*x / sqrt(x) ;
1891   </pre>
1892  
1893 + <p>
1894 +
1895   Many variables and functions are already defined by the program, and they are listed in the file rayinit.cal.  
1896   The following variables are particularly important:
1897  
# Line 1732 | Line 1906 | The following variables are particularly important:
1906                  arg(i)                  - i'th real argument
1907   </pre>
1908  
1909 + <p>
1910 +
1911   For mesh objects, the local surface coordinates are available:
1912  
1913   <pre>
1914                  Lu, Lv                  - local (u,v) coordinates
1915   </pre>
1916  
1917 + <p>
1918 +
1919   For BRDF types, the following variables are defined as well:
1920  
1921   <pre>
# Line 1746 | Line 1924 | For BRDF types, the following variables are defined as
1924                  CrP, CgP, CbP           - perturbed material color
1925   </pre>
1926  
1927 + <p>
1928 +
1929   A unique context is set up for each file so
1930   that  the  same variable may appear in different
1931   function files without conflict.  
# Line 1800 | Line 1980 | The basic data file format is as follows:
1980          DATA, later dimensions changing faster.
1981   </pre>
1982  
1983 + <p>
1984 +
1985   N is the number of  dimensions.  
1986   For  each  dimension,  the beginning  and  ending  coordinate  values and the dimension size is given.  
1987   Alternatively, individual coordinate  values can  be  given when the points are not evenly spaced.  
# Line 1828 | Line 2010 | All numbers are decimal integers:
2010           ...
2011   </pre>
2012  
2013 + <p>
2014 +
2015   The ASCII codes can appear in any order.  N is the number of vertices,  and  the  last  is automatically connected to the first.  
2016   Separate polygonal sections are joined by coincident sides.  
2017   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 2015 | Line 2199 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
2199   OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2200   SUCH DAMAGE.
2201   </pre>
2202 +
2203 + <p>
2204  
2205   <hr>
2206  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines