home *** CD-ROM | disk | FTP | other *** search
/ Encyclopedia of Graphics File Formats Companion / GFF_CD.ISO / formats / radiance / spec / imaging.txt < prev    next >
Text File  |  1994-06-01  |  41KB  |  1,172 lines

  1.                         The RADIANCE 2.2
  2.                     Synthetic Imaging System
  3.  
  4.  
  5.                             Greg Ward
  6.                   Lawrence Berkeley Laboratory
  7.                          1 Cyclotron Rd.
  8.                        Berkeley, CA 94720
  9.                          (510) 486-4757
  10.  
  11.  
  12. 1. Introduction
  13.  
  14.      RADIANCE was developed as a research tool for predicting the
  15. distribution of visible radiation in illuminated spaces. It takes
  16. as input a three-dimensional geometric model of the physical
  17. environment, and produces a map of spectral radiance values in a
  18. color image. The technique of ray-tracing follows light backwards
  19. from the image plane to the source(s). Because it can produce
  20. realistic images from a simple description, RADIANCE has a wide
  21. range of applications in graphic arts, lighting design,
  22. computer-aided engineering and architecture.
  23.  
  24.      The diagram in Figure 1 shows the flow between programs
  25. (boxes) and data (ovals). The central program is rpict, which
  26. produces a picture from a scene description. Rview is a variation
  27. of rpict that computes and displays images interactively.
  28.  
  29.      A scene description file lists the surfaces and materials
  30. that make up a specific environment. The current surface types
  31. are spheres, polygons, cones, and cylinders. They can be made
  32. from materials such as plastic, metal, and glass. Light sources
  33. can be distant disks as well as local spheres, discs and
  34. polygons.
  35.  
  36.      From a three-dimensional scene description and a specified
  37. view, rpict produces a two-dimensional image. A picture file is a
  38. compressed binary representation of the pixels in the image. This
  39. picture can be scaled in size and brightness, anti-aliased, and
  40. sent to a graphics output device.
  41.  
  42.      A header in each picture file lists the program(s) and
  43. parameters that produced it. This is useful for identifying a
  44. picture without having to display it. The information can be read
  45. by the program getinfo.
  46.  
  47.  
  48. 2. Scene Description
  49.  
  50.      A scene description file represents a three-dimensional
  51. physical environment in Cartesian (rectilinear) world
  52. coordinates. It is stored as ascii text, with the following basic
  53. format:
  54.  
  55.      # comment
  56.  
  57.      modifier PM identifier n S1 S2 S3 .. Sn
  58.      0
  59.  
  60.      m R1 R2 R3 .. Rm
  61.  
  62.      modifier alias identifier reference
  63.  
  64.      ! command
  65.  
  66. A comment line begins with a pound sign,`#'.
  67.  
  68.      The scene description primitives all have the same general
  69. format, and can be either surfaces or modifiers. A primitive has
  70. a modifier, a type, and an identifier. A modifier is either the
  71. identifier of a previously defined primitive, or "void"+. An
  72. identifier can be any string (ie. sequence of non-blank
  73. characters). The arguments associated with a primitive can be
  74. strings or real numbers. The first integer following the
  75. identifier is the number of string arguments, and it is followed
  76. by the arguments themselves (separated by white space). The next
  77. integer is the number of integer arguments, and is followed by
  78. the integer arguments. (There are currently no primitives that
  79. use them, however.) The next integer is the real argument count,
  80. and it is followed by the real arguments.
  81.  
  82.      An alias gets its type and arguments from a previously
  83. defined primitive. This is useful when the same material is used
  84. with a different modifier, or as a convenient naming mechanism.
  85. Surfaces cannot be aliased.
  86.  
  87.      A line beginning with an exclamation point, `!', is
  88. interpreted as a command. It is executed by the shell, and its
  89. output is read as input to the program. The command must not try
  90. to read from its standard input, or confusion will result. A
  91. command may be continued over multiple lines using a backslash,
  92. `\', to escape the newline.
  93.  
  94.      Blank space is generally ignored, except as a separator. The
  95. exception is the newline character after a command or comment.
  96. Commands, comments and primitives may appear in any combination,
  97. so long as they are not intermingled.
  98.  
  99.  
  100. 2.1. Primitive Types
  101.  
  102.      Primitives can be surfaces, materials, textures or patterns.
  103. Modifiers can be materials, textures or patterns. Simple surfaces
  104. must have one material in their modifier list.
  105.  
  106. +The most recent definition of a modifier is the one used, and
  107. later definitions do not cause relinking of loaded primitives.
  108. Thus, the same identifier may be used repeatedly, and each new
  109. definition will apply to the primitives following it.
  110.  
  111.  
  112. 2.1.1. Surfaces
  113.  
  114.      A scene description will consist mostly of surfaces. The
  115. basic types are given below.
  116.  
  117. Source
  118.  
  119.      A source is not really a surface, but a solid angle. It is
  120. used for specifying light sources that are very distant. The
  121. direction to the center of the source and the number of degrees
  122. subtended by its disk are given as follows:
  123.  
  124.      mod source id
  125.      0
  126.      0
  127.      4 xdir ydir zdir angle
  128.  
  129. Sphere
  130.  
  131.      A sphere is given by its center and radius:
  132.  
  133.      mod sphere id
  134.      0
  135.      0
  136.      4 xcent ycent zcent radius
  137.  
  138. Bubble
  139.  
  140.      A bubble is simply a sphere whose surface normal points
  141. inward.
  142.  
  143. Polygon
  144.  
  145.      A polygon is given by a list of three-dimensional vertices,
  146. which are ordered counter-clockwise as viewed from the front side
  147. (into the surface normal). The last vertex is automatically
  148. connected to the first. Holes are represented in polygons as
  149. interior vertices connected to the outer perimeter by coincident
  150. edges (seams).
  151.  
  152.      mod polygon id
  153.      0
  154.      0
  155.      3n
  156.  
  157.      x1     y1    z1
  158.      x2     y2    z2
  159.      ...
  160.      xn     yn    zn
  161.  
  162. Cone
  163.  
  164.      A cone is a megaphone-shaped object. It is truncated by two
  165. planes perpendicular to its axis, and one of its ends may come to
  166. a point. It is given as two axis endpoints, and the starting and
  167. ending radii:
  168.  
  169.      mod cone id
  170.      0
  171.      0
  172.      8
  173.  
  174.           x0     y0    z0
  175.           x1     y1    z1
  176.           r0     r1
  177.  
  178. Cup
  179.  
  180.      A cup is an inverted cone (ie. has an inward surface
  181. normal).
  182.  
  183. Cylinder
  184.  
  185.      A cylinder is like a cone, but its starting and ending radii
  186. are equal.
  187.  
  188.      mod cylinder id
  189.      0
  190.      0
  191.      7
  192.  
  193.           x0     y0      z0
  194.           x1     y1      z1
  195.           rad
  196.  
  197. Tube
  198.  
  199.      A tube is an inverted cylinder.
  200.  
  201. Ring
  202.  
  203.      A ring is a circular disk given by its center, surface
  204. normal, and inner and outer radii:
  205.  
  206.      mod ring id
  207.      0
  208.      0
  209.      8
  210.           xcent ycent zcent
  211.           xdir  ydir  zdir
  212.           r0    r1
  213.  
  214. Instance
  215.  
  216.      An instance is a compound surface, given by the contents of
  217. an octree file (created by oconv).
  218.  
  219.      mod instance id
  220.      1+ octree transform
  221.      0
  222.      0
  223.  
  224. If the modifier is "void", then surfaces will use the modifiers
  225. given in the original description. Otherwise, the modifier
  226. specified is used in their place. The transform moves the octree
  227. to the desired location in the scene. Multiple instances using
  228. the same octree take little extra memory, hence very complex
  229. descriptions can be rendered using this primitive.
  230.  
  231.      There are a number of important limitations to be aware of
  232. when using instances. First, the scene description used to
  233. generate the octree must stand on its own, without referring to
  234. modifiers in the parent description. This is necessary for oconv
  235. to create the octree. Second, light sources in the octree will
  236. not be incorporated correctly in the calculation, and they are
  237. not recommended. Finally, there is no advantage (other than
  238. convenience) to using a single instance of an octree, or an
  239. octree containing only a few surfaces. An xform command on the
  240. subordinate description is prefered in such cases.
  241.  
  242. 2.1.2. Materials
  243.  
  244.      A material defines the way light interacts with a surface.
  245. The basic types are given below.
  246.  
  247. Light
  248.  
  249.      Light is the basic material for self-luminous surfaces (ie.
  250. light sources). In addition to the source surface type, spheres,
  251. discs (rings with zero inner radius), cylinders (provided they
  252. are long enough), and polygons can act as light sources. Polygons
  253. work best when they are rectangular. Cones cannot be used at this
  254. time. A pattern may be used to specify a light output
  255. distribution. Light is defined simply as a RGB radiance value
  256. (watts/rad2/m2):
  257.  
  258.      mod light id
  259.      0
  260.      0
  261.      3 red green blue
  262.  
  263. Illum
  264.  
  265.      Illum is used for secondary light sources with broad
  266. distributions. A secondary light source is treated like any other
  267. light source, except when viewed directly. It then acts like it
  268. is made of a different material, or becomes invisible. Secondary
  269. sources are useful when modeling windows or brightly illuminated
  270. surfaces.
  271.  
  272.      mod illum id
  273.      1 material
  274.      0
  275.      3 red green blue
  276.  
  277. Glow
  278.  
  279.      Glow is used for surfaces that are self-luminous, but
  280. limited in their effect. In addition to the radiance value, a
  281. maximum radius for shadow testing is given:
  282.  
  283.      mod glow id
  284.      0
  285.      0
  286.      4 red green blue maxrad
  287.  
  288. If maxrad is zero, then the surface will never be tested for
  289. shadow, although it may participate in an interreflection
  290. calculation. If maxrad is negative, then the surface will never
  291. contribute to scene illumination. Glow sources will never
  292. illuminate objects on the other side of an illum surface. This
  293. provides a convenient way to illuminate local light fixture
  294. geometry without overlighting nearby objects.
  295.  
  296. Spotlight
  297.  
  298.      Spotlight is used for self-luminous surfaces having directed
  299. output. As well as radiance, the full cone angle (in degrees) and
  300. orientation (output direction) vector are given. The length of
  301. the orientation vector is the distance of the effective focus
  302. behind the source center (ie. the local length).
  303.  
  304.      mod spotlight id
  305.      0
  306.      0
  307.      7 red green blue angle xdir ydir zdir
  308.  
  309. Mirror
  310.  
  311.      Mirror is used for planar surfaces that produce secondary
  312. source reflections. This material should be used sparingly, as it
  313. may cause the light source calculation to blow up if it is
  314. applied to many small surfaces. This material is only supported
  315. for flat surfaces such as polygons and rings. The arguments are
  316. simply the RGB reflectance values, which should be between 0 and
  317. 1. An optional string argument may be used like the illum type to
  318. specify a different material to be used for shading non-source
  319. rays.
  320.  
  321.      mod mirror id
  322.      1 material
  323.      0
  324.      3 red green blue
  325.  
  326. Prism1
  327.  
  328.      The prism 1 material is for general light redirection from
  329. prismatic glazings, generating secondary light sources. It can
  330. only be used to modify a planar surface (ie. a polygon or disk)
  331. and should not result in either light concentration or
  332. scattering. The new direction of the ray can be on either side of
  333. the material, and the definitions must have the correct
  334. bidirectional properties to work properly with secondary light
  335. sources. The arguments give the coefficient for the redirected
  336. light and its direction.
  337.  
  338.      mod prism 1 id
  339.      5+ coef dx dy dz functile transform
  340.      0
  341.      n A1 A2 .. An
  342.  
  343. The new direction variables dx, dy and dz need not produce a
  344. normalized vector. For convenience, the variables DxA, DyA and
  345. DzA are defined as the normalized direction to the target light
  346. source. See section 2.2.1 on function files for further
  347. information.
  348.  
  349. Prism2
  350.  
  351.      The material prism2 is identical to prism1 except that it
  352. provides for two ray redirections rather than one.
  353.  
  354.      mod direct1 id
  355.      9+ coefl dx1 dy1 dz1 coef2 dx2 dy2 dz2 functile transform
  356.      0
  357.      n A1 A2 .. An
  358.  
  359. Plastic
  360.  
  361.      Plastic is a material with uncolored highlights. It is given
  362. by its RGB reflectance, its fraction of specularity, and its
  363. roughness value. Roughness is specified as the rms slope of
  364. surface facets. A value of O corresponds to a perfectly smooth
  365. surface, and a value of 1 would be a very rough surface.
  366. Specularity fractions greater than 0.1 and roughness values
  367. greater than 0.2 are not very realistic. (A pattern modifying
  368. plastic will affect the material color.)
  369.  
  370.      mod plastic id
  371.      0
  372.      0
  373.      5 red green blue spec rough
  374.  
  375. Metal
  376.  
  377.      Metal is similar to plastic, but specular highlights are
  378. modified by the material color. Specularity of metals is usually
  379. .9 or greater. As for plastic, roughness values above .2 are
  380. uncommon.
  381.  
  382. Trans
  383.  
  384.      Trans is a translucent material, similar to plastic. The
  385. transmissivity is the fraction of penetrating light that travels
  386. all the way through the material. The transmitted specular
  387. component is the fraction of transmitted light that is not
  388. diffusely scattered. Transmitted and diffusely reflected light is
  389. modified by the material color. Translucent objects are
  390. infinitely thin.
  391.  
  392.      mod trans id
  393.      0
  394.      0
  395.      7 red green blue spec rough trans tspec
  396.  
  397. Plastic2
  398.  
  399.      Plastic2 is similar to plastic, but with anisotropic
  400. roughness. This means that highlights in the surface will appear
  401. elliptical rather than round. The orientation of the anisotropy
  402. is determined by the unnormalized direction vector ux uy uz.
  403. These three expressions (separated by white space) are evaluated
  404. in the context of the function file functile. If no function file
  405. is required (ie. no special variables or functions are required),
  406. a period (`.') may be given in its place. (See the discussion of
  407. Function Files in the Auxiliary Files section). The urough value
  408. defines the roughness along the u vector given projected onto the
  409. surface. The vrough value defines the roughness perpendicular to
  410. this vector. Note that the highlight will be narrower in the
  411. direction of the smaller roughness value. Roughness values of
  412. zero are not allowed for efficiency reasons since the behavior
  413. would be the same as regular plastic in that case.
  414.  
  415.       mod plastic2 id
  416.       4+ ux uy uz funcfile transform
  417.       0
  418.       6 red green blue spec urough vrough
  419.  
  420. Metal2
  421.  
  422.      Metal2 is the same as plastic2, except that the highlights
  423. are modified by the material color.
  424.  
  425. Trans2
  426.  
  427.      Trans2 is the anisotropic version of trans. The string
  428. arguments are the same as for plastic2, and the
  429. real arguments are the same as for trans but with an additional
  430. roughness value.
  431.  
  432.      mod trans2 id
  433.      4+ ux uy uz funcfile transform
  434.      0
  435.      8 red green blue spec urough vrough trans tspec
  436.  
  437. Dielectric
  438.  
  439.      A dielectric material is transparent, and it refracts light
  440. as well as reflecting it. Its behavior is determined by the index
  441. of refraction and transmissivity in each wavelength band per unit
  442. length. Common glass has a index of refraction (n) around 1.5,
  443. and a transmissivity of roughly 0.92 over an inch. An additional
  444. number, the Hartmann constant, describes how the index of
  445. refraction changes as a function of wavelength. It is usually
  446. zero. (A pattern modifies only the refracted value.)
  447.  
  448.      mod dielectric id
  449.      0
  450.      0
  451.      5 rtn gtn btn n hc
  452.  
  453. Interface
  454.  
  455.      An interface is a boundary between two dielectrics. The
  456. first transmissivities and refractive index are for the inside;
  457. the second ones are for the outside. Ordinary dielectrics are
  458. surrounded by a vacuum (1 1 1 1).
  459.  
  460.      mod interface id
  461.      0
  462.      0
  463.      8 rtn1 gtn1 btn1 n1 rtn2 gtn2 btn2 n2
  464.  
  465. Glass
  466.  
  467.      Glass is similar to dielectric, but it is optimized for thin
  468. glass surfaces (n = 1.52). One transmitted ray and one reflected
  469. ray is produced. By using a single surface is in place of two,
  470. internal reflections are avoided. The surface orientation is
  471. irrelevant, as it is for plastic, metal, and trans. The only
  472. specification required is the transmissivity at normal incidence.
  473. To compute transmissivity (tn) from transmittance (Tn) use:
  474.  
  475. tn =
  476. (sqrt(.8402528435+.0072522239*Tn*Tn)-.9166530661)/.0036261119/Tn
  477.  
  478. Standard 88% transmittance glass has a transmissivity of 0.96. (A
  479. pattern modifying glass will affect the transmissivity.) If a
  480. fourth real argument is given, it is interpreted as the index of
  481. refraction to use instead of 1.52.
  482.  
  483.      mod glass id
  484.      0
  485.      0
  486.      3 rtn gtn btn
  487.  
  488. Plasfunc
  489.  
  490.      Plasfunc in used for the procedural definition of
  491. plastic-like materials with arbitrary bidirectional reflectance
  492. distribution functions (BRDF's). The arguments to this material
  493. include the color and specularity, as well as the function
  494. defining the specular distribution and the auxiliary file where
  495. it may be found.
  496.  
  497.      mod plasfunc id
  498.      2+ refl funcfile transform
  499.      0
  500.      4+ red green blue spec A5 ..
  501.  
  502. The function refl must take three arguments, the x, y and z
  503. direction towards the incident light, and should integrate to 1
  504. over the projected hemisphere. At least four real arguments must
  505. be given, and these are made available along with any additional
  506. values to the reflectance function. Currently, only the
  507. contribution from direct light sources is considered in the
  508. specular calculation.
  509.  
  510. Metfunc
  511.  
  512.      Metfunc is identical to plasfunc and takes the same
  513. arguments, but the specular component is multiplied also by the
  514. material color.
  515.  
  516. Transfunc
  517.  
  518.      Transfunc is similar to plasfunc but with an arbitrary
  519. bidirectional transmittance distribution as well as a reflectance
  520. distribution. Both reflectance and transmittance are specified
  521. with the same function.
  522.  
  523.      mod transfunc id
  524.      2+ refl funcfile transform
  525.      0
  526.      4+ red green blue rspec trans tspec A7 ..
  527.  
  528. Where trans is the total light transmitted and tspec is the
  529. non-Lambertian fraction of transmitted light. The function refl
  530. should integrate to 1 over each projected hemisphere.
  531.  
  532. BRTDfunc
  533.  
  534.      The material BRTDfunc gives the maximum flexibility over
  535. surface reflectance and transmittance, providing for
  536. spectrally-dependent specular rays and reflectance and
  537. transmittance distribution functions.
  538.  
  539.      mod BRTDfunc id
  540.      10+ rrefl grefl brefl
  541.           rtrns gtrns btrns
  542.           rbrtd gbrtd bbrtd
  543.           funcfile transform
  544.      0
  545.      6+ red green blue rspec trans tspec A7 ..
  546.  
  547. The variables rrefl, grefl and brefl specify the color
  548. coefficients for the ideal specular (mirror) reflection of the
  549. surface. These values are not modified by rspec, thus the diffuse
  550. reflectances red, green and blue implicitly exclude the mirrored
  551. specular component and should be set accordingly. Similarly, the
  552. variables rtrns, gtrns and btrns specify the color coefficients
  553. for the transmitted direction. These values are modified by the
  554. total transmittance, trans, but not by tspec. The functions
  555. rbrtd, gbrtd and bbrtd take the direction to the incident light
  556. and compute the color coefficient for the non-Lambertian part of
  557. reflection and transmission. These functions are modified by
  558. rspec and tspec appropriately, and they are expected to integrate
  559. to 1 over each projected hemisphere.
  560.  
  561. Plasdata
  562.  
  563.      Plasdata is used for arbitrary BRDF's that are most
  564. conveniently given as interpolated data. The arguments to this
  565. material are the data file and coordinate index functions, as
  566. well as a function to optionally modify the data values.
  567.  
  568.      mod plasdata id
  569.      3+n+
  570.           func datafile
  571.           funcfile x1 x2 .. xn transform
  572.      0
  573.      4+ red green blue spec A5 ..
  574.  
  575. The coordinate indices (x1, x2, etc.) are themselves functions of
  576. the x, y and z direction to the incident light. The data function
  577. (func) takes a single variable, which is the interpolated value
  578. from the n-dimensional data file.
  579.  
  580. Metdata
  581.  
  582.      As metfunc is to plasfunc, metdata is to plasdata. Metdata
  583. takes the same arguments as plasdata, but the specular component
  584. is modified by the given material color.
  585.  
  586. Transdata
  587.  
  588.      Transdata is like plasdata but the specification includes
  589. transmittance as well as reflectance. The parameters are as
  590. follows.
  591.  
  592.      mod transdata id
  593.      3+n+
  594.           func datafile
  595.           funcfile x1 x2 .. xn transform
  596.      0
  597.      4+ red green blue rspec trans tspec A7 ..
  598.  
  599. Antimatter
  600.  
  601.      Antimatter is a material that can "subtract" volumes from
  602. other volumes. A ray passing into an antimatter object becomes
  603. blind to all the specified modifiers:
  604.  
  605.      mod antimatter id
  606.      N mod1 mod2 .. modN
  607.      0
  608.      0
  609.  
  610. The first modifier will be used to shade the area leaving the
  611. antimatter volume and entering the regular volume. If mod1 is
  612. void, the antimatter volume is completely invisible. Antimatter
  613. does not work properly with the material type "trans", and
  614. multiple antimatter surfaces should be disjoint. The viewpoint
  615. must be outside all volumes concerned for a correct rendering.
  616.  
  617. 2.1.3. Textures
  618.  
  619.      A texture is a perturbation of the surface normal, and is
  620. given by either a function or data.
  621.  
  622. Texfunc
  623.  
  624.      A texfunc uses an auxiliary function file to specify a
  625. procedural texture:
  626.  
  627.      mod texfunc id
  628.      4+ xpert ypert zpert funcfile transform
  629.      0
  630.      n A1 A2.. An
  631.  
  632. Texdata
  633.      A texdata texture uses three data files to get the surface
  634. normal perturbations. The variables xfunc, yfunc and zfunc take
  635. three arguments each from the interpolated values in xdfname,
  636. ydfname and zdfname.
  637.  
  638.      mod texdata id
  639.      8+ xfunc yfunc zfunc xdfname ydfname zdfname vfname x0 x1 .. 
  640.        xf
  641.      0
  642.      n A1 A2.. An
  643.  
  644.  
  645. 2.1.4. Patterns
  646.  
  647. Patterns are used to modify the reflectance of materials. The
  648. basic types are given below.
  649.  
  650. Colorfunc
  651.  
  652.      A colorfunc is a procedurally defined color pattern. It is
  653. specified as follows:
  654.  
  655.      mod colorfunc id
  656.      4+ red green blue funcfile transform
  657.      0
  658.      n A1 A2 .. An
  659.  
  660. Brightfunc
  661.  
  662.      A brightfunc is the same as a colorfunc, except it is
  663. monochromatic.
  664.  
  665.  
  666.      mod brightfunc id
  667.      2+ refl funcfile transform
  668.      0
  669.      n A1 A2 .. An
  670.  
  671. Colordata
  672.  
  673.      Colordata uses an interpolated data map to modify a
  674. material's color. The map is n-dimensional, and is stored in
  675. three auxiliary files, one for each color. The coordinates used
  676. to look up and interpolate the data are defined in another
  677. auxiliary file. The interpolated data values are modified by
  678. functions of one or three variables. If the functions are of one
  679. variable, then they are passed the corresponding color component
  680. (red or green or blue). If the functions are of three variables,
  681. then they are passed the original red, green, and blue values as
  682. parameters.
  683.  
  684.      mod colordata id
  685.      7+n+
  686.           rfunc gfunc bfunc rdatafile gdatafile bdatafile
  687.           funcfile x1 x2 .. xn transform
  688.      0
  689.      m A1 A2 .. Am
  690.  
  691. Brightdata
  692.  
  693.      Brightdata is like colordata, except monochromatic.
  694.  
  695.      mod brightdata id
  696.      3+n+
  697.           func datafile
  698.           funcfile x1 x2 .. xn transform
  699.      0
  700.      m A1 A2 .. Am
  701.  
  702. Colorpict
  703.  
  704.      Colorpict is a special case of colordata, where the pattern
  705. is a two-dimensional image stored in the RADIANCE picture format.
  706. The dimensions of the image data are determined by the picture
  707. such that the smaller dimension is always 1, and the other is the
  708. ratio between the larger and the smaller. For example, a 500x338
  709. picture would have coordinates (u,v) in the rectangle between
  710. (0,0) and (1.48,1).
  711.  
  712.      mod colorpict id
  713.      7+
  714.           rfunc gfunc bfunc pictfile
  715.           funcfile u v transform
  716.      0
  717.      m A1 A2 .. Am
  718.  
  719.  
  720. Colortext
  721.  
  722.      Colortext is dichromatic writing in a polygonal font. The
  723. font is defined in an auxiliary file, such as helvet.fnt. The
  724. text itself is also specified in a separate file, or can be part
  725. of the material arguments. The character size, orientation,
  726. aspect ratio and slant is determined by right and down motion
  727. vectors. The upper left origin for the text block as well as the
  728. foreground and background colors must also be given.
  729.  
  730.      mod colortext id
  731.      2 fontfile textfile
  732.      0
  733.      15+
  734.           Ox Oy Oz
  735.           Rx Ry Rz
  736.           Dx Dy Dz
  737.           rfore gfore bfore
  738.           rback gback bback
  739.           [spacing]
  740.  
  741. or:
  742.  
  743.      mod colortext id
  744.      2+N fontfile. This is a line with N words ...
  745.      0
  746.      15+
  747.           Ox Oy Oz
  748.           Rx Ry Rz
  749.           Dx Dy Dz
  750.           rfore gfore bfore
  751.           rback gback bback
  752.           [spacing]
  753.  
  754. Brighttext
  755.  
  756.      Brighttext is like colortext, but the writing is
  757. monochromatic.
  758.  
  759.      mod brighttext id
  760.      2 fontfile textfile
  761.      0
  762.      11+
  763.           Ox Oy Oz
  764.           Rx Ry Rz
  765.           Dx Dy Dz
  766.           foreground background
  767.           [spacing]
  768.  
  769. or:
  770.  
  771.      mod brighttext id
  772.      2+N fontfile. This is a line with N words ...
  773.      0
  774.      11+
  775.           Ox Oy Oz
  776.           Rx Ry Rz
  777.           Dx Dy Dz
  778.           foreground background
  779.           [spacing]
  780.  
  781. By default, a uniform spacing algorithm is used that guarantees
  782. every character will appear in a precisely determined position.
  783. Unfortunately, such a scheme results in rather unattractive and
  784. difficult to read text with most fonts. The optional spacing
  785. value defines the distance between characters for proportional
  786. spacing. A positive value selects a spacing algorithm that
  787. preserves right margins and indentation, but does not provide the
  788. ultimate in proportionally spaced text. A negative value insures
  789. that characters are properly spaced, but the placement of words
  790. then varies unpredictably. The choice depends on the relative
  791. importance of spacing versus formatting. When presenting a
  792. section of formatted text, a positive spacing value is usually
  793. preferred. A single line of text will often be accompanied by a
  794. negative spacing value. A section of text meant to depict a
  795. picture, perhaps using a special purpose font such as
  796. hexbit4x1.fnt, calls for uniform spacing. Reasonable magnitudes
  797. for proportional spacing are between 0.1 (for tightly spaced
  798. characters) and 0.3 (for wide spacing).
  799.  
  800. 2.1.5. Mixtures
  801.  
  802.      A mixture is a blend of one or more textures and patterns.
  803. The basic types are given below.
  804.  
  805. Mixfunc
  806.  
  807.      A mixfunc mixes two modifiers procedurally. It is specified
  808. as follows:
  809.  
  810.      mod mixfunc id
  811.      4+ foreground background vname funcfile transform
  812.      0
  813.      n A1 A2 .. An
  814.  
  815. Foreground and background are modifier names that must be
  816. uniquely defined in the scene description. Vname is the
  817. coefficient defined in funcfile that determines the influence of
  818. foreground. The background coefficient is always (1-vname). Since
  819. the references are not resolved until runtime, the last
  820. definitions of the modifier id's will be used. This can result in
  821. modifier loops, which are detected by the renderer.
  822.  
  823. Mixdata
  824.  
  825.      Mixdata combines two modifiers using an auxiliary data file:
  826.  
  827.      mod mixdata id
  828.      5+n+
  829.           foreground background func datafile
  830.           funcfile x1 x2 .. xn transform
  831.      0
  832.      m A1 A2 .. Am
  833.  
  834. Mixtext
  835.  
  836.      Mixtext uses one modifier for the text foreground, and one
  837. for the background:
  838.  
  839.      mod mixtext id
  840.      4 foreground background fontfile textfile
  841.      0
  842.      9+
  843.           Ox Oy Oz
  844.           Rx Ry Rz
  845.           Dx Dy Dz
  846.           [spacing]
  847.  
  848. or:
  849.  
  850.      mod mixtext id
  851.      4+N
  852.           foreground background fontfile
  853.           This is a line with N words ...
  854.      0
  855.      9+
  856.           Ox Oy Oz
  857.           Rx Ry Rz
  858.           Dx Dy Dz
  859.           [spacing]
  860.  
  861. 2.2. Auxiliary Files
  862.  
  863.      Auxiliary files used in textures and patterns are accessed
  864. by the programs during image generation. These files may be
  865. located in the working directory, or in a library directory. The
  866. environment variable RAYPATH can be assigned an alternate set of
  867. search directories. Following is a brief description of some
  868. common file types.
  869.  
  870. 2.2.1. Function Files
  871.  
  872.      A function file contains the definitions of variables,
  873. functions and constants used by a primitive. The transformation
  874. that accompanies the file name contains the necessary rotations,
  875. translations and scalings to bring the coordinates of the
  876. function file into agreement with the world coordinates. The
  877. transformation specification is the same as for the xform
  878. command. An example function file is given below:
  879.  
  880.      {
  881.           This is a comment, enclosed in curly braces.
  882.           {Comments can be nested.}
  883.      }
  884.                {standard expressions use +,-,*,/,^,(,)}
  885.      vname = Ny * func(A1);
  886.                {constants are defined with a colon}
  887.      const: sqrt(PI/2);
  888.                {user-defined functions add to library}
  889.      func(x) = 5+ A1*sin(x/3);
  890.                {functions may be passed and recursive}
  891.      rfunc(f,x) = if(x,f(x),f(-x)*rfunc(f,x+1));
  892.                {constant functions may also be defined}
  893.      cfunc(x): 10*x/sqrt(x);
  894.  
  895. Many variables and functions are already defined by the program,
  896. and they are listed in the file rayinit.cal.
  897. The following variables are particularly important:
  898.  
  899.      Dx, Dy, Dz     -incident ray direction
  900.      Px, Py, Pz     -intersection point
  901.      Nx, Ny, Nz     -surface normal at intersection point
  902.      Rdot           -cosine between ray and normal
  903.      arg(0)         -number of real arguments
  904.      arg(i)         - i'th real argument
  905.  
  906. For BRDF types, the following variables are defined as well:
  907.  
  908.      NxP, NyP, Nzp          -perturbed surface normal
  909.      RdotP          - perturbed dot product
  910.      CrP, CgP, CbP          -perturbed material color
  911.  
  912. A unique context is set up for each file so that the same
  913. variable may appear in different function files without conflict.
  914. The variables listed above and any others defined in rayinit.cal
  915. are available globally. If no file is needed by a given primitive
  916. because all the required variables are global, a period (`.') can
  917. be given in place of the file name. It is also possible to give
  918. an expression instead of a straight variable name in a scene
  919. file, although such expressions should be kept simple as they
  920. cannot contain any white space. Also, functions (requiring
  921. parameters) must be given as names and not as expressions.
  922.  
  923.      Constant expressions are used as an optimization in function
  924. files. They are replaced wherever they occur in an expression by
  925. their value. Constant expressions are evaluated only once, so
  926. they must not contain any variables or values that can change,
  927. such as the ray variables Px and Ny or the primitive argument
  928. function arg(). All the math library functions such as sqrt() and
  929. cos() have the constant attribute, so they will be replaced by
  930. immediate values whenever they are given constant arguments.
  931. Thus, the subexpression cos(PI*sqrt(2)) is immediately replaced
  932. by its value, -.266255342, and does not cause any additional
  933. overhead in the calculation.
  934.  
  935.      It is generally a good idea to define constants and
  936. variables before they are referred to in a function file.
  937. Although evaluation does not take place until later, the
  938. interpreter does variable scoping and constant subexpression
  939. evaluation based on what it has compiled already. For example, a
  940. variable that is defined globally in rayinit.cal then referenced
  941. in the local context of a function file cannot subsequently be
  942. redefined in the same file because the compiler has already
  943. determined the scope of the referenced variable as global. To
  944. avoid such conflicts, one can state the scope of a variable
  945. explicitly by preceding the variable name with a context mark (a
  946. back-quote) for a local variable, or following the name with a
  947. context mark for a global variable.
  948.  
  949. 2.2.2. Data Files
  950.  
  951.      Data files contain n-dimensional arrays of real numbers used
  952. for interpolation. Typically, definitions in a function file
  953. determine how to index and use interpolated data values. The
  954. basic data file format is as follows:
  955.  
  956.      N
  957.      beg1 end1 m1
  958.      0 0 m2 x2.1 x2.2 x2.3 x2.4 .. x2.m2
  959.      ...
  960.      begN endN mN
  961.      DATA, later dimensions changing faster.
  962.  
  963. N is the number of dimensions. For each dimension, the beginning
  964. and ending coordinate values and the dimension size is given.
  965. Alternatively, individual coordinate values can be given when the
  966. points are not evenly spaced. These values must either be
  967. increasing or decreasing monotonically. The data is m1*m2* ...
  968. *mN real numbers in ascii form. Comments are not allowed in data
  969. files.
  970.  
  971. 2.2.3. Font Files
  972.  
  973.      A font file lists the polygons which make up a character
  974. set. There are no comments, and all numbers are decimal integers:
  975.  
  976.      code n
  977.           x0 y0
  978.           x1 y1
  979.           ...
  980.           xn yn
  981.      ...
  982.  
  983. The ascii codes can appear in any order. N is the number of
  984. vertices, and the last is automatically connected to the first.
  985. Separate polygonal sections are joined by coincident sides. The
  986. character coordinate system is a square with lower left corner at
  987. (0,0), lower right at (255,0) and upper right at (255,255).
  988.  
  989. 2.3. Generators
  990.  
  991.      A generator is any program that produces a scene description
  992. as its output. They usually appear as commands in a scene
  993. description file. An example of a simple generator is genbox.
  994. Genbox takes the arguments of width, height and depth to produce
  995. a parallelepiped description. Genrev is a more sophisticated
  996. generator that produces an object of rotation from parametric
  997. functions for radius and axis position. Gensurf tessellates a
  998. surface defined by the parametric functions x(s,t), y(s,t), and
  999. z(s,t). Genworm links cylinders and spheres along a curve. Gensky
  1000. produces a sun and sky distribution corresponding to a given time
  1001. and date.
  1002.  
  1003.      Xform is a program that transforms a scene description from
  1004. one coordinate space to another. Xform does rotation,
  1005. translation, scaling, and mirroring.
  1006.  
  1007.  
  1008. 3. Image Generation
  1009.  
  1010.      Once the scene has been described in three-dimensions, it is
  1011. possible to generate a two-dimensional image from a given
  1012. perspective.
  1013.  
  1014.      The image generating programs use an octree to efficiently
  1015. trace rays through the scene. An octree subdivides space into
  1016. nested octants which contain sets of surfaces. In RADIANCE, an
  1017. octree is created from a scene description by oconv. The details
  1018. of this process are not important, but the octree will serve as
  1019. input to the ray-tracing programs and directs the use of a scene
  1020. description.
  1021.  
  1022.      Rview is ray-tracing program for viewing a scene
  1023. interactively. When the user specifies a new perspective, rview
  1024. quickly displays a rough image on the terminal, then
  1025. progressively increases the resolution as the user looks on. He
  1026. can select a particular section of the image to improve, or move
  1027. to a different view and start over. This mode of interaction is
  1028. useful for debugging scenes as well as determining the best view
  1029. for a final image.
  1030.  
  1031.      Rpict produces a high-resolution picture of a scene from a
  1032. particular perspective. This program features adaptive sampling,
  1033. crash recovery and progress reporting, all of which are important
  1034. for time-consuming images.
  1035.  
  1036.      A number of filters are available for manipulating picture
  1037. files. Pfilt sets the exposure and performs anti-aliasing.
  1038. Pcompos composites (cuts and pastes) pictures. Pvalue converts a
  1039. picture to and from alternate forms.
  1040.  
  1041.      Currently only a few graphics output devices are supported.
  1042. Tttyimage produces a crude character representation of an image
  1043. on a dumb terminal. Aedimage produces output on an AED 512
  1044. graphics terminal, and ximage produces an image on an X-window
  1045. server. Output is also available on certain dot-matrix printers
  1046. and the Dicomed film recorder. The list of supported output
  1047. devices is expected to grow as the system is made more widely
  1048. available.
  1049.  
  1050.  
  1051. 4. Acknowledgements
  1052.  
  1053.      This work was supported by the Assistant Secretary of
  1054. Conservation and Renewable Energy, Office of Building Energy
  1055. Research and Development, Buildings Equipment Division of the
  1056. U.S. Department of Energy under Contract No. DE-AC03-76SF00098.
  1057.  
  1058.      Additional work was sponsored by the Swiss federal
  1059. government under the Swiss LUMEN Project and was carried out in
  1060. the Laboratoire d'Energie Solaire (LESO Group) at the Ecole
  1061. Polytechnique Federale de Lausanne (EPFL University) in Lausanne,
  1062. Switzerland.
  1063.  
  1064.  
  1065. 5. References
  1066.  
  1067. Ward, G., "Measuring and Modeling Anisotropic Reflection,"
  1068. Computer Graphics, Chicago, July 1992.
  1069.  
  1070. Ward, G., P. Heckbert, "Irradiance Gradients," Third Annual
  1071. Eurographics Workshop on Rendering, to be published by
  1072. Springer-Verlag, held in Bristol, UK, May 1992.
  1073.  
  1074. Ward, G., "Adaptive Shadow Testing for Ray Tracing," Second
  1075. Annual Eurographics Workshop on Rendering, to be published by
  1076. Springer-Verlag, held in Barcelona, SPAIN, May 1991.
  1077.  
  1078. Ward, G., "Visualization," Lighting Design and Application, Vol.
  1079. 20, No. 6, June 1990.
  1080.  
  1081. Ward, G., F. Rubinstein, R. Clear, "A Ray Tracing Solution for
  1082. Diffuse Interreflection," Computer Graphics, Vol. 22, No. 4,
  1083. August 1988.
  1084.  
  1085. Ward, G., F. Rubinstein, "A New Technique for Computer Simulation
  1086. of Illuminated Spaces," Journal of the Illuminating Engineering
  1087. Society, Vol. 17, No. 1, Winter 1988.
  1088.  
  1089. ra_pict (1)    - convert Radiance pictures to Macintosh PICT
  1090.                    files
  1091. aedimage (1)   - RADIANCE driver for AED 512 color graphics
  1092.                    terminal
  1093. arch2rad (1)   - convert Architrion text file to RADIANCE
  1094.                    description
  1095. calc (1)       - calculator
  1096. cnt (1)        - index counter
  1097. dayfact (1)    - compute illuminance and daylight factor on
  1098.                    workplane
  1099. ev (1)         - evaluate expressions
  1100. falsecolor (1) - make a false color RADIANCE picture
  1101. findglare (1)  - locate glare sources in a RADIANCE scene
  1102. genbox (1)     - generate a RADIANCE description of a box
  1103. genprism (1)   - generate a RADIANCE description of a prism
  1104. genrev (1)     - generate a RADIANCE description  of surface of
  1105.                    revolution
  1106. gensky (1)     - generate a RADIANCE description of the sky
  1107. gensurf (1)    - generate a RADIANCE description of a curved
  1108.                    surface
  1109. genworm (1)    - generate a RADIANCE description of a functional
  1110.                    worm
  1111. getbbox (1)    - compute bounding box for RADIANCE scene
  1112. getinfo (1)    - get header information from a RADIANCE file
  1113. glare (1)      - perform glare and visual comfort calculations
  1114. glarendx (1)   - calculate glare index
  1115. ies2rad (1)    - convert IES luminaire data to RADIANCE
  1116.                    description
  1117. lam (1)        - laminate lines of multiple files
  1118. lampcolor (1)  - compute spectral radiance for diffuse emitter
  1119. lookamb (1)    - examine ambient file values
  1120. mkillum (1)    - compute illum sources for a RADIANCE scene
  1121.                    description
  1122. neat (1)       - neaten up output columns
  1123. normpat (1)    - normalize RADIANCE pictures for use as patterns.
  1124. oconv (1)      - create an octree from a RADIANCE scene
  1125.                    description
  1126. pcomb (1)      - combine RADIANCE pictures.
  1127. pcompos (1)    - composite RADIANCE pictures.
  1128. pextrem (1)    - find minimum and maximum values in RADIANCE
  1129.                    picture
  1130. pfilt (1)      - filter a RADIANCE picture
  1131. pflip (1)      - flip a RADIANCE picture.
  1132. pinterp (1)    - interpolate/extrapolate view from pictures
  1133. protate (1)    - rotate a RADIANCE picture.
  1134. psign (1)      - produce a RADIANCE picture from text.
  1135. pvalue (1)     - convert RADIANCE picture  to/from  alternate
  1136.                    formats
  1137. ra_bn (1)      - convert RADIANCE picture to/from Barneyscan
  1138.                    image
  1139. ra_pixar (1)   - convert RADIANCE picture to/from PIXAR picture
  1140. ra_ppm (1)     - convert RADIANCE picture to/from a Poskanzer
  1141.                    Portable Pix
  1142. ra_pr (1)      - convert RADIANCE picture to/from pixrect
  1143.                    rasterfile
  1144. ra_pr24 (1)    - convert RADIANCE picture to/from 24-bit
  1145.                    rasterfile
  1146. ra_ps (1)      - convert RADIANCE picture to a PostScript ASCII
  1147.                    file
  1148. ra-rgbe (1)    - change run-length encoding of a RADIANCE picture
  1149. ra_t16 (1)     - convert RADIANCE picture to/from Targa 16 or
  1150.                    24-bit image
  1151. ra_t8 (1)      - convert RADIANCE picture to/from Targa 8-bit
  1152.                    image file
  1153. ra_tiff (1)    - convert RADIANCE picture to/from a TIFF color or
  1154.                    greyscal
  1155. rcalc (1)      - record calculator
  1156. replmarks (1)  - replace triangular markers in a RADIANCE scene
  1157.                    description
  1158. rpict (1)      - generate a RADIANCE picture
  1159. rpiece (1)     - render pieces of a RADIANCE picture
  1160. rtrace (1)     - trace rays in RADIANCE scene
  1161. rview (1)      - generate RADIANCE images interactively
  1162. thf2rad (1)    - convert GDS things file to RADIANCE description
  1163. total (1)      - sum up columns
  1164. ttyimage (1)   - RADIANCE driver for X window system
  1165. vgaimage  (1)  - RADIANCE picture display program for VGA
  1166. xform (1)      - transform a RADIANCE scene description
  1167. xglaresrc (1)  - display glare sources under X11
  1168. ximage (1)     - RADIANCE driver for X window system
  1169. xshowtrace (1) - interactively show rays traced on RADIANCE image
  1170.                    under X1
  1171.  
  1172.