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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines