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.43 by greg, Tue Jul 22 19:43:59 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 1252 | Line 1357 | A texture is a perturbation of the surface normal,  an
1357  
1358   <pre>
1359          mod texdata id
1360 <        8+ xfunc yfunc zfunc xdfname ydfname zdfname vfname x0 x1 .. xf
1360 >        8+ xfunc yfunc zfunc xdfname ydfname zdfname funcfile x0 x1 .. xf
1361          0
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 1540 | 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 1553 | Line 1664 | or:
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 1585 | 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 1613 | 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 1657 | Line 1827 | A mixfunc mixes  two  modifiers  procedurally.   It  i
1827                  [spacing]
1828   </pre>
1829  
1830 + <p>
1831 +
1832   or:
1833  
1834   <pre>
# Line 1672 | Line 1844 | or:
1844                  [spacing]
1845   </pre>
1846  
1847 + <p>
1848 +
1849   </dl>
1850  
1851   <p>
# Line 1716 | 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 1730 | 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 1744 | 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 1798 | 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 1826 | 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 1964 | Line 2150 | or converted a standard image format using one of the
2150   </h2>
2151  
2152   <pre>
2153 < The Radiance Software License, Version 1.0
2153 > The Radiance Software License, Version 2.0
2154  
2155 < Copyright (c) 1990 - 2021 The Regents of the University of California,
2156 < through Lawrence Berkeley National Laboratory.   All rights reserved.
2155 > Radiance v6.0 Copyright (c) 1990 to 2025, The Regents of the University of
2156 > California, through Lawrence Berkeley National Laboratory (subject to receipt
2157 > of any required approvals from the U.S. Dept. of Energy).  All rights reserved.
2158  
2159   Redistribution and use in source and binary forms, with or without
2160 < modification, are permitted provided that the following conditions
1974 < are met:
2160 > modification, are permitted provided that the following conditions are met:
2161  
2162 < 1. Redistributions of source code must retain the above copyright
2163 <        notice, this list of conditions and the following disclaimer.
2162 > (1) Redistributions of source code must retain the above copyright notice,
2163 > this list of conditions and the following disclaimer.
2164  
2165 < 2. Redistributions in binary form must reproduce the above copyright
2166 <      notice, this list of conditions and the following disclaimer in
2167 <      the documentation and/or other materials provided with the
1982 <      distribution.
2165 > (2) Redistributions in binary form must reproduce the above copyright
2166 > notice, this list of conditions and the following disclaimer in the
2167 > documentation and/or other materials provided with the distribution.
2168  
2169 < 3. The end-user documentation included with the redistribution,
2170 <          if any, must include the following acknowledgment:
2171 <            &quot;This product includes Radiance software
2172 <                (<a HREF="http://radsite.lbl.gov/">http://radsite.lbl.gov/</a>)
1988 <                developed by the Lawrence Berkeley National Laboratory
1989 <              (<a HREF="http://www.lbl.gov/">http://www.lbl.gov/</a>).&quot;
1990 <      Alternately, this acknowledgment may appear in the software itself,
1991 <      if and wherever such third-party acknowledgments normally appear.
2169 > (3) Neither the name of the University of California, Lawrence Berkeley
2170 > National Laboratory, U.S. Dept. of Energy nor the names of its contributors
2171 > may be used to endorse or promote products derived from this software
2172 > without specific prior written permission.
2173  
2174 < 4. The names &quot;Radiance,&quot; &quot;Lawrence Berkeley National Laboratory&quot;
2175 <      and &quot;The Regents of the University of California&quot; must
2176 <      not be used to endorse or promote products derived from this
2177 <      software without prior written permission. For written
2178 <      permission, please contact [email protected].
2174 > THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
2175 > AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2176 > IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2177 > ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
2178 > LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2179 > CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2180 > SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2181 > INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2182 > CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2183 > ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2184 > POSSIBILITY OF SUCH DAMAGE.
2185  
2186 < 5. Products derived from this software may not be called &quot;Radiance&quot;,
2187 <      nor may &quot;Radiance&quot; appear in their name, without prior written
2188 <      permission of Lawrence Berkeley National Laboratory.
2189 <
2190 < THIS SOFTWARE IS PROVIDED ``AS IS&quot; AND ANY EXPRESSED OR IMPLIED
2191 < WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
2192 < OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
2193 < DISCLAIMED.   IN NO EVENT SHALL Lawrence Berkeley National Laboratory OR
2194 < ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2195 < SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2009 < LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
2010 < USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
2011 < ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
2012 < OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
2013 < OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2014 < SUCH DAMAGE.
2186 > You are under no obligation whatsoever to provide any bug fixes, patches,
2187 > or upgrades to the features, functionality or performance of the source
2188 > code ("Enhancements") to anyone; however, if you choose to make your
2189 > Enhancements available either publicly, or directly to Lawrence Berkeley
2190 > National Laboratory, without imposing a separate written license agreement
2191 > for such Enhancements, then you hereby grant the following license: a
2192 > non-exclusive, royalty-free perpetual license to install, use, modify,
2193 > prepare derivative works, incorporate into other computer software,
2194 > distribute, and sublicense such enhancements or derivative works thereof,
2195 > in binary and source code form.
2196   </pre>
2197 +
2198 + <p>
2199  
2200   <hr>
2201  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines