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

  1.                         RADIANCE Tutorial
  2.  
  3.                             Greg Ward
  4.                    Lawrence Berkeley Laboratory
  5.  
  6.  
  7. 1. Introduction
  8.  
  9. RADIANCE is a lighting simulation program that synthesizes images
  10. from 3-dimensional geometric models of physical spaces. The input
  11. model describes each surface's shape, size, location and
  12. composition. A model may contain many thousands of surfaces, and
  13. is often produced by a separate CAD program. In addition to
  14. arbitrary (planar) polygons, RADIANCE directly models spheres and
  15. cones. Generator programs are provided for the creation of more
  16. complex shapes from these basic surface primitives. Examples
  17. include boxes, prisms and surfaces of revolution. A
  18. transformation utility permits the simple duplication of objects
  19. and hierarchical construction of a scene.
  20.  
  21. This tutorial assumes a certain familiarity with the UNIX
  22. operating system and its text editing facilities. Ask your system
  23. administrator for a basic introduction.
  24.  
  25. The RADIANCE reference manual will be required to understand the
  26. following examples of scene creation and program interaction.
  27. Text in italics is user input.
  28.  
  29.  
  30. 2. Input of a Simple Room
  31.  
  32. In this example, we will use a text editor to create the input
  33. for a simple room containing a box, a ball, and a light source.
  34. In most applications, a CAD system would be used to describe a
  35. scene's geometry, which would then be combined with surface
  36. materials, light fixtures, and (optionally) furniture. To get a
  37. more intimate understanding of the input to RADIANCE, we will
  38. start without the advantages of a CAD program or an object
  39. library.
  40.  
  41. The scene we will be working towards is shown in Figure 1. It is
  42. usually helpful to start with a simple drawing showing the
  43. coordinate axis and the relative locations of major surfaces.
  44.  
  45. The minimum input required to get an image is a source of
  46. illumination and an object to reflect light to the "camera".* We
  47. will begin with two spheres, one emissive and one reflective.
  48. First we define the materials, then the spheres themselves.
  49. Actually, the order is only important insofar as each modifier
  50. definition (i.e. material) must appear before its first
  51. reference. (Consult the RADIANCE manual for an explanation of the
  52. primitive types and their parameters.) Start your favorite text
  53. editor ("vi" in this example) to create the following file called
  54. "room.rad":
  55.  
  56.  
  57. *In fact, a RADIANCE renderer can be thought of an invisible
  58. camera in a simulated world.
  59.  
  60.      % vi room.rad
  61.  
  62.      #
  63.      # My first scene.
  64.      #
  65.  
  66.      # this is the material for my light source:
  67.  
  68.      void light bright
  69.      0
  70.      0
  71.      3 100 100 100
  72.  
  73.      # this is the material for my test ball:
  74.  
  75.      void plastic red_plastic
  76.      0
  77.      0
  78.      5 .7 .05 .05 .05 .05
  79.  
  80.      # here is the light source:
  81.  
  82.      bright sphere fixture
  83.      0
  84.      0
  85.      4 2 1 1.5 .125
  86.  
  87.      # here is the ball:
  88.  
  89.      red_plastic sphere ball
  90.      0
  91.      0
  92.      4 .7 1.125 .625 .125
  93.  
  94. Now that we have a simple scene description, we can look at it
  95. with the interactive viewing program, rview. First, however, we
  96. must create the "octree" file that will be used to accelerate the
  97. rendering process. To accomplish this, type the following
  98. command:
  99.  
  100.      % oconv room.rad > test.oct
  101.  
  102. Note that the suffixes ".rad" and ".oct" are not enforced by the
  103. program, but are merely a convenience to aid the user in
  104. identifying files later. The command getinfo can be used to get
  105. information on the origin of binary (unviewable) files created by
  106. RADIANCE utilities. Try entering the command:
  107.  
  108.      % getinfo test.oct
  109.  
  110. The usefulness of such a function will be apparent when you find
  111. yourself with a dozen files named "test.pic".
  112.  
  113. To make an image of our scene, we must select a suitable set of
  114. view parameters telling RADIANCE where to point its camera. To
  115. simplify our example, we will use the same starting position for
  116. all our renderings, and change views only once rview is started:
  117.  
  118.      % rview -vp 2.25 .375 1 -vd -.25 .125 -.125 -av .5.5.5
  119.           test.oct
  120.  
  121. The "-vp" option gives the view point, and the "-vd" option gives
  122. the view direction vector. The "-av" option specifies the amount
  123. of light globally present in the scene, permitting portions of
  124. the scene that are not illuminated directly to be visible. Rview
  125. has many more options, and their default values may be discovered
  126. using:
  127.  
  128.      % rview -defaults
  129.  
  130. You should start to see an image of a red ball forming on your
  131. scene. Take this opportunity to try each of rview's commands, as
  132. described in the manual. If you make a mistake in a view
  133. specification, use the last command to get back to where you
  134. were. It is probably a good idea to save your favorite view using
  135. the rview command:
  136.  
  137.      : view default.vp
  138.  
  139. You can create any number of "viewfiles" with this command, and
  140. retrieve them with:
  141.  
  142.      :last viewfile
  143.  
  144. If you look around enough, you may even be able to see the light
  145. source itself. Unlike many rendering programs, the light sources
  146. in RADIANCE are visible objects. This illustrates the philosophy
  147. behind the program, which is the simulation of physical spaces.
  148. Since it is not possible to create an invisible light source in
  149. reality, there is no reason to do it in simulation.
  150.  
  151. Still, there is no guarantee that the user will create physically
  152. meaningful descriptions. For example, we have just floated a red
  153. ball next to a light source somewhere in intergalactic space. In
  154. the interest of making this scene more realistic, let's enclose
  155. the light and ball in a room by adding the following text to
  156. "room.rad":
  157.  
  158.      % vi room.rad
  159.  
  160.      # the wall material:
  161.  
  162.      void plastic gray_paint
  163.      0
  164.      0
  165.      5 .5 .5 .5 0 0
  166.  
  167. # a box shaped room:
  168.  
  169. !genbox gray_paint room 3 2 1.75 -i
  170.  
  171. The generator program genbox is just a command that produces a
  172. RADIANCE description, and it is executed when the file is read.
  173. It is more convenient than specifying the coordinates of four
  174. vertices for each of six polygons, and can be changed later quite
  175. easily. (See the manual genbox page for further details.)
  176.  
  177. You can now look at the modified scene, but remember first to
  178. regenerate the octree:
  179.  
  180.           % oconv room.rad > test.oct
  181.           % rview -vf default.vp-av .5 .5 .5 test.oct
  182.  
  183. This is better, but our ball and light source are still floating,
  184. which is an unrealistic condition for most rooms. Let's put a box
  185. under the table, and a rod to suspend the light from the ceiling:
  186.  
  187.      # a shiny blue box:
  188.  
  189.      void plastic blue_plastic
  190.      0
  191.      0
  192.      5 .1 .1 .6 .05 .1
  193.  
  194.      !genbox blue_plastic box .5 .5 .5 \xform -rz15 -t .5 .75 0
  195.  
  196.      # a chrome rod to suspend the light from the ceiling:
  197.  
  198.      void metal chrome
  199.      0
  200.      0
  201.      5 .8 .8 .8 .9 0
  202.  
  203.      chrome cylinder fixture_support
  204.      0
  205.      0
  206.      7
  207.           2    1    1.5
  208.           2    1    1.75
  209.           .05
  210.  
  211. Note that this time the output of genbox was "piped" into another
  212. program, xform. Xform is used to move, scale and rotate RADIANCE
  213. descriptions. Genbox always creates a box in the positive octant
  214. of 3-space with one corner at the origin. This was what we wanted
  215. for the room, but we wanted the box moved away from the wall and
  216. rotated slightly. First we rotated the box 15 degrees about the
  217. z-axis (pivoting on the origin), then translated the corner from
  218. the origin to (.5,.75,0). By no small coincidence, this position
  219. is directly under our original ball.
  220.  
  221. After viewing this new arrangement, you can try changing some of
  222. the materials -- here are a few examples:
  223.  
  224.      # solid crystal:
  225.  
  226.      void dielectric crystal
  227.      0
  228.      0
  229.      5 .5 .5 .5 1.5 0
  230.  
  231.      # dark brown:
  232.  
  233.      void plastic brown
  234.      0
  235.      0
  236.      5 .2 .1 .1 0 0
  237.  
  238.      # light gray:
  239.  
  240.      void plastic white
  241.      0
  242.      0
  243.      5 .7 .7 .7 0 0
  244.  
  245. To change the ball from red_plastic to the crystal defined above,
  246. simply replace red plastic sphere ball with crystal sphere ball.
  247. Note once again that the definition of the new materials must
  248. precede any references to them. Changing the materials for the
  249. floor and ceiling of the room is a little more difficult. Since
  250. genbox creates six rectangles, all using the same material, it is
  251. necessary to replace the command with its output before we can
  252. make the required changes. To do this, enter the command
  253. directly:
  254.  
  255.      % genbox gray_paint room 3 2 1.75 -i>> room.rad
  256.  
  257. The double arrow ">>" causes the output to be "appended" to the
  258. end of the file, rather than overwriting its contents. Now edit
  259. the file and change the ceiling material to "white", and the
  260. floor material to "brown". (Hint: the ceiling is the polygon
  261. whose z coordinates are all high. And don't forget to remove the
  262. original genbox command from the file!)
  263.  
  264. Once you have chosen a nice view, you can generate a
  265. high-resolution image in batch mode using the rpict command:
  266.  
  267.      % rpict -vf myview -av .5 .5 .5 test.oct > test.pic & [PID]
  268.  
  269. The ampersand "&" causes the program to run in the background, so
  270. you can log out and go home while the computer continues to work
  271. on your picture. The bracketed number [PID] printed by the
  272. C-shell command interpreter is the process id that can be used
  273. later to check the progress or kill the program. This number can
  274. also be determined by the ps command:
  275.  
  276.      % ps
  277.  
  278. The number preceding the rpict command is the process id. If you
  279. want to kill the process later, use the command:
  280.  
  281.      % kill PID
  282.  
  283. If you only want a progress report, use the form:
  284.  
  285.      % kill -ALRM PID
  286.  
  287. This sends an "alarm" signal to rpict, which then prints out the
  288. percentage completion. Note that this is a special feature of
  289. rpict, and will not work with most programs. Also note that this
  290. works only for the current login session. If you log on later on
  291. a different terminal (or window), rpict will not send the report
  292. to the correct place. It is usually a good idea, therefore, to
  293. give rpict an error file argument if it is running a long job:
  294.  
  295.      % rpict -e errfile ...
  296.  
  297. Now sending an alarm signal will result in rpict reporting to the
  298. end of the specified error file. Alternatively, you can use the
  299. -t option to generate reports automatically at regular intervals.
  300. You can check the reports at any time by printing the file:
  301.  
  302.      % cat errfile
  303.  
  304. This file will also contain a header, and any errors that
  305. occurred.
  306.  
  307.  
  308. 3. Addition of a Window
  309.  
  310. Adding a window to the room requires two basic steps. The first
  311. step is to cut a hole in the wall an put in a piece of glass. The
  312. second step is to put something outside to make the view worth
  313. having. Since there are no explicit holes allowed in RADIANCE
  314. polygons, we use the trick of coincident edges (making a seam) to
  315. give the appearance of a hole. The new polygon for the window
  316. wall is shown in Figure 2.
  317.  
  318. To create the window wall, change the appropriate polygon in the
  319. scene file (modified part in italics). If you haven't done so
  320. already, follow the instructions in the previous section to
  321. change the genbox command in the file to its corresponding
  322. polygons.
  323.  
  324. % vi room.rad
  325.  
  326. gray_paint polygon room.5137
  327. 0
  328. 0
  329. 30
  330.  
  331.      3     2     1.75
  332.      3     2     0
  333.      3     0     0
  334.      3     0     1.75
  335.      3     .625  1.75
  336.      3     .625  .625
  337.      3     1.375 .625
  338.      3     1.375 1.375
  339.      3     .625  1.375
  340.      3     .625  1.75
  341.  
  342. Next, create a separate file for the window. (The use of separate
  343. files is desirable for parts of the scene that will be
  344. manipulated independently, as we will see in a moment.)
  345.  
  346.      % vi window.rad
  347.  
  348.      # an 88% transmittance glass window has a transmission of
  349.         96%:
  350.  
  351.      void glass window_glass
  352.      0
  353.      0
  354.  
  355.      3 .96 .96 .96
  356.  
  357.      window_glass polygon window
  358.      0
  359.      0
  360.      12
  361.           3     .625      1.375
  362.           3     1.375     1.375
  363.           3     1.375     .625
  364.           3     .625      .625
  365.  
  366. The vertex order is very important, especially for polygons with
  367. holes. Normally, vertices are listed in counterclockwise order as
  368. seen from the front. However, the hole of a polygon has its
  369. vertices listed in the opposite order. This insures that the seam
  370. does not cross itself.
  371.  
  372. The next step is the description of the scene outside the window.
  373. A special purpose generator, gensky, will create a description of
  374. the sun and sky which will be stored in a separate file. The
  375. arguments to gensky are the month, day and hour (local standard
  376. time). The following command produces a description for 10:00
  377. solar time on March 20th at latitude of 40 degrees:
  378.  
  379.      % gensky 3 20 10 -o 0 -m 0 -a 40 > sky.rad
  380.  
  381.  
  382. The file "sky.rad" contains only a description of the sun and the
  383. sky distribution. The actual sky and ground are still undefined,
  384. so we will create another short file containing a generic
  385. background:
  386.  
  387.      % vi outside.rad
  388.  
  389.      #
  390.      # A standard sky and ground to follow a gensky sun and sky
  391.        distribution.
  392.      #
  393.  
  394.      skyfunc glow sky_glow
  395.      0
  396.      0
  397.      4 .9 .9 1.15 0
  398.  
  399.      sky_glow source sky
  400.      0
  401.      0
  402.      4 0 0 1 180
  403.  
  404.      skyfunc glow ground_glow
  405.      0
  406.      0
  407.      4 1.4 .9 .6 0
  408.      ground_glow source ground
  409.      0
  410.      0
  411.      4 0 0-1 180
  412.  
  413. We can now put these elements together in one octree file using
  414.      oconv:
  415.  
  416.      % oconv outside.rad sky.rad window.rad room.rad > test.oct
  417.  
  418. Note that the above command results in the following error
  419.      message:
  420.  
  421.      oconv: fatal - (outside.rad): undefined modifier "skyfunc"
  422.  
  423. The modifier is undefined because we put "outside.rad", which
  424. uses skyfunc before "sky.rad" where skyfunc is defined. It is
  425. therefore necessary to change the order of the files so that
  426. skyfunc is defined before it is used:
  427.  
  428.      % oconv sky.rad outside.rad window.rad room.rad > test.oct
  429.  
  430. Now let's look at our modified scene, using the same rview
  431.       command as before:
  432.  
  433.      % rview -vf default.vp-av .5 .5 .5 test.oct
  434.  
  435. As you look around the scene, you will need to adjust the
  436. exposure repeatedly to be able to see detail over the wide
  437. dynamic range now present. To do this, wait a few seconds after
  438. choosing each new view and enter the command:
  439.  
  440.      : exposure 1
  441.  
  442. or simply:
  443.  
  444.      : e 1
  445.  
  446. All commands in rview can be abbreviated by one or two letters.
  447. Additional control over the exposure is possible by changing the
  448. multiplier factor to a value greater than one to lighten or less
  449. than one to darken. It is also possible to use absolute settings
  450. and spot normalization. See the rview manual entry for details.
  451.  
  452. You may notice that other than a patch of sun on the floor, the
  453. window does not seem to illuminate the room. In RADIANCE, certain
  454. surfaces act as light sources and others do not. Whether or not a
  455. surface is a light source is determined by its material type.
  456. Surfaces made from the material types light, illum, spotlight and
  457. (sometimes) glow will act as light sources, whereas surfaces made
  458. from plastic, metal, glass and other material types will not. In
  459. order for the window to directly illuminate the room, it is
  460. therefore necessary to change its material type. We will use the
  461. type illum because it is specially designed for "secondary" light
  462. sources such as windows and other bright objects that are not
  463. merely emitters but have other important visual properties. An
  464. illum will act as a light source for parts of the calculation,
  465. but when viewed directly will appear as if made from a different
  466. material (or disappear altogether).
  467.  
  468. Rather than modify the contents of "window.rad" which is a
  469. perfectly valid description of a nonsource window, let's create a
  470. new file, which we can substitute during octree creation, called
  471. "srcwindow.rad":
  472.  
  473.      % vi srcwindow.rad
  474.  
  475.      #
  476.      # An emissive window
  477.      #
  478.  
  479.      # visible glass window_glass
  480.      0
  481.      0
  482.      3 .96 .96 .96
  483.  
  484.      # window distribution function, including angular
  485.           transmittance
  486.  
  487.      skyfunc brightfunc window_dist
  488.      2 winxmit winxmit.cal
  489.      0
  490.      0
  491.  
  492.      # illum for window, using 88% transmittance at normal
  493.           incidence:
  494.  
  495.      window_dist illum window_illum
  496.      1 window_glass
  497.      0
  498.      3 .88 .88 .88
  499.  
  500.      # the source polygon:
  501.  
  502.      window_illum polygon window
  503.      0
  504.      0
  505.      12
  506.           3     .625  1.375
  507.           3     1375  1.375
  508.           3     1.375 .625
  509.           3     .625  .625
  510.  
  511. There are a couple of things you should notice in this file. The
  512. first definition is the normal glass type, window_glass, which is
  513. used for the alternate material for the illum window_illum. Next
  514. is the window distribution function, which is the sky
  515. distribution modified by angular transmittance of glass defined
  516. in winxmit.cal. Finally comes the illum itself, which is the
  517. secondary source material for the window.
  518.  
  519. To look at the scene, simply substitute "srcwindow.rad" for
  520. "window.rad" in the previous oconv command, thus:
  521.  
  522.      % oconv sky.rad outside.rad srcwindow.rad room.rad >
  523.           test.oct
  524.  
  525. You can look at the room at different times by changing the
  526. gensky command used to create "sky.rad" and regenerating the
  527. octree. (Although the octree does not strictly need to be
  528. recreated for every change to the input files, it is good to get
  529. in the habit until the exceptions are well understood.)
  530.  
  531.  
  532. 4. Outside Geometry
  533.  
  534. If the exterior of a space is not approximated well by an
  535. infinitely distant sky and ground, we can add a better
  536. description to calculate a more accurate window output
  537. distribution as well as a better view outside the window. Let's
  538. add a ground plane and a nearby building to the "outside.rad"
  539. file we created earlier.
  540.  
  541.      # Terra Firma:
  542.  
  543.      void plastic ground_mat
  544.      0
  545.      0
  546.      5 .28 .18 .12 0 0
  547.  
  548.      ground_mat ring groundplane
  549.      0
  550.      0
  551.      8
  552.  
  553.           0    0    -.01
  554.           0    0    1
  555.           0    30
  556.  
  557.      # A big, ugly, mirrored glass building:
  558.  
  559.      void mirror reflect20
  560.      0
  561.      0
  562.      3.15 .2 .2
  563.  
  564.      !genbox reflect20 building 10 10 2 | xform -t 10 5 0
  565.  
  566. Note that the groundplane was given a slightly negative z value.
  567. This is very important so that the ground does not peek through
  568. the floor we have defined. The material type mirror, used to
  569. define the neighboring structure, is special in RADIANCE.
  570. Surfaces of this type as well as the types prism1 and prism2
  571. participate in something called the "virtual light source"
  572. calculation. In short, this means that the surfaces of the
  573. building we have created will reflect sunlight and any other
  574. light source present in our scene. The virtual light source
  575. material types should be used with care since they can result in
  576. substantial growth in the calculation. It would be a good idea in
  577. the example above to remove the bottom surface of the building
  578. (which cannot be seen from the outside anyway) and change the
  579. roof type to metal or some non-reflecting material. This can be
  580. done using the same manual process described earlier for changing
  581. the room surface materials.
  582.  
  583. Now that we have a better description of the outside, what do we
  584. do with it? If we simply substitute it in our scene without
  585. changing the description of the window illum, the distribution of
  586. light from the window will be slightly wrong because the
  587. "skybright" function only describes light from the sky and the
  588. ground, not from other structures. Using this approximation might
  589. be acceptable in some cases, but let's assume that accuracy is
  590. one of our main goals in life. There are two ways to an accurate
  591. calculation of light from a window. The first is to treat the
  592. window as an ordinary window and rely on the default
  593. interreflection calculation of RADIANCE, and the second is to use
  594. the program mkillum to calculate the window distribution
  595. separately so we can still treat it as an illum light source.
  596. Let's try them both.
  597.  
  598.  
  599. Using the default interreflection calculation is probably easier,
  600. but as we shall see it takes a little longer to get a good result
  601. in this case. To use the interreflection calculation, we first
  602. create an octree using the original glass window and our new
  603. description of the outside:
  604.  
  605.      % oconv sky.rad outside.rad window.rad room.rad > test.oct
  606.  
  607. Now we just add a few new options to our rview command like so:
  608.  
  609.      % rview -vf default.vp -dr 1 -av .5 .5 .5 -ab 1 -ad 200 -as
  610.           80 -ar 80 test.oct
  611.  
  612. The -dr parameter tells rview how many reflections to allow in
  613. the virtual light source calculation. Because of the geometry of
  614. our scene, there will never be more than one reflection from our
  615. exterior building. The -ab parameter tells rview how many diffuse
  616. interreflections to follow. When this value is 0, there is no
  617. interreflection calculation. By setting this parameter to 1, we
  618. compute the first diffuse interreflection (eg. from the sun patch
  619. to the wall) as well as the contribution from the sky and
  620. exterior objects through the window. The -ad option tells rview
  621. how many rays to use in its initial sampling of the hemisphere
  622. for the diffuse interreflection calculation. We have set this
  623. value high enough so the program can find the relatively small
  624. window and its sun patch. The -as option tells the program how
  625. many rays to send to particularly bright areas of the hemisphere.
  626. Since we know that we will have such bright areas, we set this
  627. value to something which is around half the initial sample. The
  628. -ar option tells rview at what resolution it can relax the
  629. accuracy of the interreflection calculation. This number is
  630. relative to the overall size of our scene, which can be
  631. determined using getinfo on the octree like so:
  632.  
  633.      % getinfo -d test.oct
  634.  
  635. This command reveals that our scene has an overall dimension of
  636. 60 (due to the large ring we have used for our ground plane). In
  637. order to have good resolution in our interior space, we set the
  638. value so that 60 divided by this parameter is somewhat less than
  639. one quarter the dimension of our interior space. Unfortunately,
  640. many of the calculation parameters used in Radiance are difficult
  641. to set correctly the first time, and require some experience as
  642. well as knowledge about the calculation.
  643.  
  644. Probably the first thing you notice after starting rview is that
  645. nothing happens. It takes the calculation a while to get going,
  646. as it must trace may rays at the outset to determine the
  647. contribution at each point from the window area. Once rview has
  648. stored up some values, the progress rate improves, but it never
  649. really reaches blistering speed.
  650.  
  651. A more efficient alternative in this case is to use the program
  652. mkillum to create a modified window file that uses calculated
  653. data values to define its light output distribution. Applying
  654. mkillum is relatively straightforward in this case. You simply
  655. give it an octree defined with the normal window and the file
  656. describing this window and it creates a new window description
  657. using calculated data values:
  658.  
  659.      % oconv sky.rad outside.rad window.rad room.rad > test.oct
  660.      % mkillum -av 18 18 18 -ab 0 test.oct < window.rad >
  661.           mkiwindow.rad
  662.  
  663. The -av value is appropriate for the outside, which is much
  664. brighter, as suggested by the output of the gensky command stored
  665. in "sky.rad". The -ab option is set to 0, because outside the
  666. building we do not expect interreflections to play as important a
  667. role as in the interior (plus we are trying to save some time).
  668. The mkillum command may take a few minutes, so be patient. If we
  669. look at the output file from mkillum, we see that it uses a
  670. pattern type called brightdata, which refers to a data file
  671. called "Illum.dat". This file contains the results of an rtrace
  672. calculation, which traced many rays in each direction from the
  673. window in order to determine its brightness distribution. Now we
  674. can create an octree using this new file and render it with
  675. rview, this time without the interreflection calculation:
  676.  
  677.      % oconv sky.rad outside.rad mkiwindow.rad room.rad >
  678.           test.oct
  679.      % rview -vf default.vp -av .5 .5 .5 test.oct
  680.  
  681. You will notice that the calculation proceeds much more quickly,
  682. and even produces a smoother looking result. Aside from waiting
  683. for mkillum to finish, there is an additional price for this
  684. speed advantage, however. The contribution from the sun patch on
  685. the floor is no longer being considered, since we are not
  686. performing an interreflection calculation inside our space. The
  687. light from the window is being taken care of by the mkillum
  688. output, but the solar patch is not. In most cases, we endeavor to
  689. prevent direct sun from entering the space, and in the morning
  690. hours this is true for our model, but otherwise it is necessary
  691. to use the diffuse interreflection calculation to correctly
  692. account for all contributions.
  693.  
  694.  
  695. 5. Discomfort Glare
  696.  
  697. Especially in scenes containing daylight, situations arise where
  698. the occupant is uncomfortable due to large differences in the
  699. brightness of the visual field. For example, trying to look at
  700. someone's face when they are backlit by a bright window is
  701. difficult and painful. We would therefore like some way to
  702. predict the effects of such bright sources of illumination when
  703. designing a space. RADIANCE provides just such a calculation.
  704.  
  705. Let's start by generating a fisheye picture of our design space:
  706.  
  707.  
  708.      % rpict -vta -vp 1.5 .8 1 -vd 0 1 0 -vh 240 -vv 180 -av
  709.           .5 .5 .5 test.oct > fish.pic
  710.  
  711. This picture will be used to identify sources of glare from a
  712. particular view point (1.5, 1, 1) about a particular direction
  713. (0, 1, 0). Since RADIANCE pictures contain true floating point
  714. radiance values, they can be used to analyze a visual environment
  715. for problems such as discomfort glare. Once rpict has finished
  716. (and this may take the better part of an hour), you may display
  717. the image using ximage or whatever display program you have
  718. available on your system. A fisheye perspective is a type of
  719. distortion that allows a wider field of view than a standard
  720. perspective image.
  721.  
  722. This larger field is used by the program findglare to locate any
  723. and all bright spots that might affect visual comfort. Findglare
  724. can also use direct calculation with rtrace, but this takes a
  725. long time without providing the nice visual feedback one gets
  726. from an image.
  727.  
  728. To facilitate the use of findglare and the associated programs
  729. glarendx and xglaresrc, a script has been written called glare.
  730. This script asks you some questions and to make it a little
  731. easier to get a nice result. To start the script, simply type
  732. glare on the command line. When it asks you a name for the glare
  733. file you want to work with, enter something innocuous like
  734. "test.glr". It will tell you that the file does not exist, so we
  735. will have to create it. It then prompts you for the name of the
  736. picture and the name of the octree, which are "fish.pic" and
  737. "test.oct", respectively. When it asks for the view, just hit
  738. return because we want to use the default view from the picture
  739. file. Glare then asks what parameters it should use for the
  740. rtrace calculation. (Findglare will still use rtrace to calculate
  741. any points that it needs which are off the picture we have given
  742. it.) For this, you should give the -av setting from before (.5 .5
  743. .5). Then glare will ask you if the sources of glare are small,
  744. which they are not, and if you would like to set the glare
  745. threshold manually, which you would not. Finally, you will be
  746. asked what maximum angle you want to calculate away from the view
  747. center. Let's use 60 degrees (to the right and left). Glare then
  748. proceeds to call the program findglare to locate the actual glare
  749. sources. Once findglare has finished, glare will call the program
  750. xglaresrc (if you are running X) to circle the glare sources
  751. found on the image.
  752.  
  753. You then have a choice of a few different glare indices you may
  754. calculated from the computed sources. The Guth visual comfort
  755. probability (VCP) is perhaps the easiest to understand for those
  756. who are not familiar with glare metrics, because it gives a
  757. result in terms of a percentage of people who would be satisfied.
  758. Calculating the Guth VCP in this case, we see that looking
  759. straight ahead (ie. 0 degrees), we see that less than 15% of the
  760. people would find this visual environment comfortable. Although
  761. the visual comfort probability increases as we look to the left
  762. (positive angles), it never gets over 20% for the range of angles
  763. we've given. That is primarily because the window is unshielded
  764. and very near the horizontal line of sight. Skylights and ceiling
  765. fixtures are a little nicer from a glare standpoint for that
  766. reason.
  767.  
  768.