home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 8 / CDASC08.ISO / NEWS / RADIANCE / DOC / RADIANCE.V24 < prev    next >
Text File  |  1993-10-07  |  43KB  |  1,094 lines

  1. ~s Radiance Digest, v2n4
  2. Dear Radiance Users,
  3.  
  4. It's time for another collection of questions and answers on Radiance.
  5. If this digest is unwelcomed junk mail, please write to GJWard@lbl.gov
  6. to have your name removed from the list.
  7.  
  8. Here is a list of topics for this time:
  9.  
  10.     VIDEO    - Simulating video photography with Radiance
  11.     INTERREFLECTION - Diffuse interreflection accuracy
  12.     PENUMBRAS - Generating accurate penumbras
  13.     HEIGHT_FIELDS - Generating colored height fields
  14.     INSTANCES - Octree instancing problems
  15.     CONSTANTS - Constant expressions in .cal files
  16.     IMAGES - Image formats, gamma correction, contrast and colors
  17.     GENERAL - Some general questions about global illumination and rendering
  18.     TEXDATA - Using the texdata type for bump mapping
  19.     CSG - Using antimatter type for destructive solid geometry
  20.  
  21. We have been having poor communication lately with our DOE managers back
  22. in Washington, DC.  Because of this, I may soon ask for your feedback on
  23. plans for transfer of Radiance to a wider user community.
  24.  
  25. -Greg
  26.  
  27. =========================================================
  28. VIDEO    - Simulating video photography with RADIANCE
  29.  
  30. Date: Fri, 28 Aug 92 14:39:57 CDT
  31. From: pandya@graf6.jsc.nasa.gov (Abhilash Pandya)
  32. Apparently-To: GJWard@lbl.gov
  33.  
  34. Greg-
  35.  
  36.   In our work, we are trying to generate accurate maps of lighing. 
  37. Your program provides us with accurate radiance values at each
  38. pixel in an image.  We would like to produce images that an eye or
  39. camera will produce.  These systems have mechanisms to filter the 
  40. images with iris and lens control.  Do you have information on how 
  41. this transformation can be done?  We are able to apply scale factors
  42. to make the images look realistic, but these are guesses.
  43.  
  44. By the way, your package is a very good one, in just 2 weeks we were
  45. able to trace complex space shuttle lighting very easily.  Nice work.
  46.  
  47. Pandya.
  48.  
  49. Date: Fri, 28 Aug 92 13:24:34 PDT
  50. From: greg (Gregory J. Ward)
  51. To: pandya@graf6.jsc.nasa.gov
  52. Subject: clarification
  53.  
  54. Hello Pandya,
  55.  
  56. I am glad you have had some success with your shuttle lighting work.
  57. I would be very interested to see any results you are willing (and able)
  58. to share.
  59.  
  60. Could you clarify your question for me a bit, please?  Do you want to
  61. reproduce the automatic iris and shutter control found in cameras?
  62. Do you wish to model also depth of field?
  63.  
  64. I do have some formulas that can tell you roughly how to set the exposure
  65. value to correspond to a given f-stop, ASA and shutter speed of a camera,
  66. but the automatic exposure control of cameras varies quite a bit from
  67. one make of camera to another.
  68.  
  69. -Greg
  70.  
  71. Date: Thu, 3 Sep 92 17:29:59 PDT
  72. From: greg (Gregory J. Ward)
  73. To: pandya@graf6.jsc.nasa.gov
  74. Subject: camera simulation
  75.  
  76. > 1. We are planning to run an experiment in a lighting lab where
  77. > we measure the light distribution and material properties for 
  78. > Shuttle and Station applications.  Our overall goal is to compare 
  79. > the output of a camera (with the fstop, film speed, shutter speed 
  80. > and development process gamma all known) with a radiance output for
  81. > a test case. How do we process the radiance output to emulate the
  82. > camera image?  We would be interested in the formulas you mentioned
  83. > and also any reference list that deals with validation of your 
  84. > model. 
  85.  
  86. Here is the note on film speed and aperture:
  87.  
  88. Francis found the appropriate equation for film exposure in the IES
  89. handbook.  There isn't an exact relation, but the following formula
  90. can be used to get an approximate answer for 35mm photography:
  91.  
  92.     Radiance EXPOSURE = K * T * S / f^2
  93.  
  94.         where:
  95.             T = exposure time (in seconds)
  96.             S = film speed (ISO)
  97.             f = f-stop
  98.             K = 2.81 (conversion factor 179*PI/200)
  99.  
  100. This came from the IES Lighting Handbook, 1987 Application Volume, section 11,
  101. page 24.
  102.  
  103. So, if you were trying to produce an image as it would appear shot at
  104. 1/60 sec. on ASA 100 (ISO 21) film at f-4, you would apply pfilt
  105. thusly:
  106.  
  107.     pfilt -1 -e `ev "2.81*1/60*21/4^2"` raw.pic > fin.pic
  108.  
  109. > 2. We would like to extend the static case (#1) to a dynamic case 
  110. > where we can model the automatic iris control and fstop found in 
  111. > the eye and also video cameras.  We have information on how the 
  112. > video uses average ambient light to adjust the iris aperture 
  113. > (circuit diagrams). We know how the fstop is computed dynamically
  114. > (using infared rays to detected the neareast surface).  What
  115. > approach do you suggest?
  116.  
  117. I assume you meant to say "focus" in the penultimate sentence above.
  118. Currently, "depth of field" simulation is not directly supported in
  119. Radiance.  In effect, an infinite f-stop is always used with results
  120. in unlimited depth of field (ie. as from a perfect pinhole camera).
  121. If you wish to fully model the dynamic exposure compensation of a
  122. video camera, you will have to use different exposure values for
  123. pfilt as above, but on a per-frame basis.
  124.  
  125. > 3. We need to find a scale factor to be used in the falsecolor 
  126. > routine that corresponds to the actual range of illuminance in
  127. > the image.  The default value may saturate the image in certain 
  128. > regions.  How do we find the optimal scale value in nits without
  129. > trial and error?
  130.  
  131. Ah, yes.  A fair question.  It just so happens that until recently
  132. there was no way to determine the maximum value in an image.  I have
  133. just written a program called "pextrem" that quickly computes the
  134. minimum and maximum values for a Radiance picture.  This program will
  135. be included in version 2.2 when it is released this fall.  I have
  136. appended it for your benefit along with an improved version of
  137. falsecolor at the end of this message.
  138.  
  139. > We will be glad to share the information on the results of our study 
  140. > when we are at that stage. 
  141.  
  142. I'd love to see it!
  143.  
  144. -Greg
  145.  
  146. =========================================================
  147. INTERREFLECTION - Diffuse interreflection accuracy
  148.  
  149. Date:         Mon, 31 Aug 92 23:59:53 CET
  150. From: SJK%PLWRTU11.BITNET@Csa3.lbl.gov
  151. To: greg@hobbes.lbl.gov
  152. Subject: Diffuse interreflection
  153.  
  154. Hello Greg,
  155.  
  156. Thank you for your excellent answers to my (excellent? Hmmm) questions.
  157. I have really overlooked a possibility to specify angle dependencies
  158. in brightfunc.
  159.  
  160. I have one more question. It is not urgent (as well as previous ones)
  161. so don't worry about them if you are busy with something else.
  162.  
  163. Now I try to investigate diffuse interreflection calculation in
  164. RADIANCE. I began with a cubic room covered with totally diffusive
  165. white plastic (reflectivity 2/3) and a single small light source
  166. inside. The diffude interreflection in this case should produce
  167. ambient light with total energy twice as large as the energy of
  168. the light source. Analysing results I noticed that some small error
  169. (5-10%) remains even after 10 iterations. Further investigation
  170. revealed that the same problem exists for the simplest case of a
  171. sphere with light source at its center. So my question is
  172. (numbering continues the previous letter):
  173.  
  174. 6. How to improve diffuse interreflection accuracy?
  175.  
  176. Consider the following scene:
  177.  
  178. void light white_source
  179. 0 0
  180. 3 10000 10000 10000
  181.  
  182. void plastic white
  183. 0
  184. 0
  185. 5 .667 .667 .667 0 0
  186.  
  187. white bubble room
  188. 0 0 4    5 5 5   5
  189.  
  190. # Light source
  191.  
  192. white_source sphere central_source
  193. 0 0
  194. 4  5 5 5   0.1
  195.  
  196. I used parameters:
  197.  
  198. -vtv -vp 5 5 4 -vd 0 0 -1 -vu 0 1 0 -vh 120 -vv 120 -x 100 -ab 5 -t 30
  199.  
  200. Due to full symmetry we can calculate ambient light exactly and
  201. not only the final value but even the value after any number
  202. of ambient iteration. The surface brightness (constant) after
  203. n iterations should be following (neglecting absorption in the light
  204. source):
  205.  
  206.       B = r^2/R^2 * C * P * d * (1+d+d^2+...+d^n)
  207.  
  208. where B is the brightness in nits; r is the radius of the light source;
  209. R is the radius of the room; C is constant conversion factor =
  210. 179 lumens/Watt; P is power density of the light source (Watt/m^2/sr);
  211. d is the surface reflectivity.
  212.  
  213. The results for the example above are shown in the following table:
  214.  
  215.    -ab n     Theory    RADIANCE
  216.  -------------------------------
  217.       0       477        477
  218.       1       795        797
  219.       2      1007       1015
  220.       4      1242       1295
  221.       5      1305       1351
  222.       6      1347       1362
  223.      10      1414       1362
  224.    infty     1432      (1362?)
  225.  -------------------------------
  226.  
  227. So, we can see that till n=2 the accordance is perfect, then
  228. RADIANCE begins to overestimate ambient light, but after six
  229. iterations saturation occurs so that the final value is
  230. underestimated.
  231.  
  232. Is it possible to achieve more accurate calculation of ambient light?
  233. What parameter is responsible for it? I tried to vary values of
  234. -ad, -aa, -lr, and -lw parameters with no effect.
  235.  
  236. Andrei Khodulev,      sjk@plwrtu11.bitnet
  237.  
  238. Date: Mon, 31 Aug 92 22:37:37 PDT
  239. From: greg (Gregory J. Ward)
  240. To: SJK%PLWRTU11.BITNET@Csa3.lbl.gov
  241. Subject: Question #6
  242.  
  243. Hello Andrei,
  244.  
  245. The reason that Radiance never converged in your example problem is
  246. that each successive interreflection uses half as many sample rays.
  247. (See the 1988 Siggraph article on the technique for an explanation.)
  248. With so many bounces, you dropped below the one ray threshold at
  249. about the 7th bounce, which is why no further convergence was obtained.
  250. To get better convergence, you would have to decrease the value of
  251. -lw (to zero if you like), increase -lr (to 12 or whatever), and ALSO
  252. increase the value of -ad to at least 2^N, where N is the number of
  253. bounces you wish to compute.
  254.  
  255. By the way, Radiance assumes that your average surface reflectance is
  256. around 50%, which is a good part of why your 67% reflectance room shows
  257. poor convergence with the default parameter values.  I could have used
  258. the actual surface reflectance to guide the calculation, but that would
  259. cause problems with the reuse of the indirect irradiance values.
  260.  
  261. The preferred way to get a more accurate value is to estimate the
  262. average radiance in the space and set the -av parameter accordingly.
  263. I wish there were a reliable automatic way to do this, but there
  264. really isn't one, which is why the default value is zero.  In your
  265. example, the correct ambient value specification would be 1432/179,
  266. which is 8 W/sr/m^2.  Of course, you would obtain convergence with
  267. this value right away.
  268.  
  269. As for the overestimation of values for 3-6 bounces, it's conceivable
  270. that Radiance would be off by that much, but it's more likely you're just
  271. seeing the errors associated with the Radiance picture format, which
  272. at best keeps within 1% of the computed values.  I tried the same
  273. experiment with rtrace (and the default parameter values) for -ab 6,
  274. and got a result of 1349 nits, which is within .1% of the correct
  275. value of 1350 nits.  (Note that you should have used .667 instead
  276. of 2/3 for the surface reflectance in your calculations, since that's
  277. what you put in the input file.)
  278.  
  279. I want to thank you once more for setting up such an excellent
  280. test scene.  I really should be paying you for all your good work!
  281.  
  282. -Greg
  283.  
  284. =========================================================
  285. PENUMBRAS - Generating accurate penumbras
  286.  
  287. Date: Tue, 1 Sep 92 17:16:49 PDT
  288. From: wex@rooster.Eng.Sun.COM (Daniel Wexler)
  289. To: greg@hobbes.lbl.gov
  290. Subject: Penumbra problems
  291.  
  292. Greg,
  293.     We have been toying with the command line arguments to Radiance
  294. to achieve nice soft shadows. Unfortunately we have been cursed with
  295. severe aliasing. I have put an example image in the xfer account on
  296. hobbes (aliased_ball.pic). I think the problem is obvious. We use
  297. pfilt to achieve supersampling, but the aliasing will not go away until
  298. the artifacts in the original image are eliminated. Essentially, we would
  299. like the most accurate image regardless of computation time. If you
  300. know what arguments would achieve this result, that would be great. I
  301. don't think we need to use any ambient calculation for these images,
  302. but please correct me if I'm wrong.
  303.  
  304. Thanks,
  305.     Dan
  306.  
  307.  
  308. Here is the command we used to create the image:
  309.  
  310. rpict -x 1000 -y 1000 -vtv -vp -5.112623 -7.815219 -3.025246 -vd 0.177627 0.917738 0.355254 -vu -0.000000 -1.000000 -0.000000 -vh 63.985638 -vv 63.985638 -ps 2 -dj 0.5 -pj 1.0 -ds 0.00001 -dc 1.0 NTtmp.oct > NTtmp.pic
  311.  
  312. And here is the radiance file; note that the modeller outputs a separate
  313. file for each object, and uses xform to position them:
  314.  
  315. void plastic gray_plastic
  316. 0
  317. 0
  318. 5 0.7 0.7 0.7 0.05 0.1
  319.  
  320.  
  321. #############################
  322. # PRIMITIVES:
  323.  
  324. void light white_light
  325. 0
  326. 0
  327. 3 40000 40000 40000
  328.  
  329. !xform -e -m white_light big_light.obj
  330.  
  331. void metal bronze_metal
  332. 0
  333. 0
  334. 5 0.9 0.3 0.0 0.0 0.0
  335.  
  336. !xform -e -m bronze_metal -rx 89.996984 test_ring.obj
  337.  
  338. !xform -e -m bronze_metal -s 0.300000 -t -2.000000 0.000000 0.000000 test_planet.obj
  339.  
  340. -----------big_light.obj---------------
  341.  
  342. white_light sphere big_light
  343. 0
  344. 0
  345. 4 0.0 0.0 0.0 1.0
  346.  
  347. -----------test_ring.obj---------------
  348.  
  349. bronze_metal ring test_ring
  350. 0
  351. 0
  352. 8 0.0 0.0 0.0 0.0 0.0 1.0 1.000000 10.000000
  353.  
  354. -----------test_planet.obj-------------
  355.  
  356. bronze_metal sphere test_planet
  357. 0
  358. 0
  359. 4 0.0 0.0 0.0 1.0
  360.  
  361. Date: Tue, 1 Sep 92 21:03:49 PDT
  362. From: greg (Gregory J. Ward)
  363. To: wex@rooster.Eng.Sun.COM
  364. Subject: Re:  Penumbra problems
  365.  
  366. Hi Dan,
  367.  
  368. Well, I'm not sure I can really tell which artifacts you are talking about,
  369. since I'm doing this from home and printing your picture out on a dot matrix
  370. printer.
  371.  
  372. If you are referring to the patterns apparent in the penumbra and even the
  373. test_ring object, that is a result of the anticorrelated sampling strategy
  374. used by rpict.  The standard jittering techniques use a psuedo-random
  375. number generator for stochastic sampling.  Radiance uses a sequence of
  376. anticorrelated samples (based on the method described by Schlick in his
  377. 1991 Eurographics Rendering Workshop paper) that converges faster than
  378. a purely random sequence, but is not without artifacts.  One can actually
  379. choose the final appearance of the artifacts, and I've chosen sort of a
  380. brushed look in rpict.
  381.  
  382. To really get away from artifacts, you will have to use 3 or 4 times
  383. oversampling, eg:
  384.  
  385.     rpict -x 4096 -y 4096 ... octree | pfilt -1 -x /4 -y /4 -r .7 > output.pic
  386.  
  387. Regarding your other arguments, you should try the following:
  388.  
  389.     -ps 1 -dj 0.5 -pj .9 -ds 0.1
  390.  
  391. The -ds value you used is really much higher than necessary, and has no
  392. effect with spherical light sources anyway (which is part of your problem
  393. with this particular scene).
  394.  
  395. If you want to get rid of the brushed appearance, you can modify the
  396. random.h header by defining urand() to be the same as frandom(), though
  397. you will get a noisier (higher variance) result:
  398.  
  399. #define  urand(i)    frandom()
  400.  
  401. One place you will not easily eliminate spatial aliasing in Radiance is
  402. at the boundaries of light sources.  Since all calculations, including
  403. image filtering, is done in floating point, very large differences in
  404. neighboring pixel values will continue to cause ugly jaggies even at
  405. large sample densities.  The only way around this is to cheat by clipping
  406. prior to filtering, a step I choose to avoid since it compromises the
  407. integrity of the result.
  408.  
  409. Let me know if these suggestions aren't enough.
  410. -Greg
  411.  
  412. =========================================================
  413. HEIGHT_FIELDS - Generating colored height fields
  414.  
  415. Date: Thu, 3 Sep 92 17:30:24 PDT
  416. From: greg (Gregory J. Ward)
  417. To: fsb@sparc.vitro.com
  418. Subject: Re: Radiance Digest, v2n3
  419.  
  420. Dear Steve,
  421.  
  422. > OK I tried this and get a brown looking surface when I give it
  423. > brown plastic modifier.  It uses the same modifier for every patch.
  424. > Is there a way to make the modifier select a color according to
  425. > elevation?  Like below a certain point is blue for water, and then 
  426. > green, and then on up is brown, and then the highest elevations
  427. > are white?  I haven't been using this package for very long so am
  428. > not really that familiar with how to do things yet.
  429.  
  430. The usual way to see the height field is to insert a light source
  431. (such as the sun as output by gensky) and the lighting will show
  432. it to you naturally.  If you want to do some fun stuff with colors,
  433. you can use a pattern based on the Z position of the surface point, eg:
  434.  
  435. # A1 is level of water, A2 is level of snow
  436. void colorfunc ranges
  437. 4 r_red r_grn r_blu ranges.cal
  438. 0
  439. 2 1.5 3.5
  440.  
  441. ranges plastic ground_mat
  442. 0
  443. 0
  444. 5 1 1 1 0 0
  445.  
  446. ---------------------------------- ranges.cal :
  447. { Select water or ground or snow depending on altitude }
  448. { A1 is water level, A2 is snow level }
  449. { move from green to brown between A1 and A2 }
  450. lp = (Pz-A1)/(A2-A1);
  451. r_red = if(-lp, .02, if(lp-1, .75, linterp(lp,.1,.5)));
  452. r_grn = if(-lp, .2, if(lp-1, .75, linterp(lp,.5,.3)));
  453. r_blu = if(-lp, .4, if(lp-1, .75, linterp(lp,.1,.1)));
  454.  
  455. -Greg
  456.  
  457. =========================================================
  458. INSTANCES - Octree instancing problems
  459.  
  460. From: Environmental Design Unit <edu@de-montfort.ac.uk>
  461. Date: Thu, 17 Sep 92 16:00:11 BST
  462. To: greg@hobbes.lbl.gov
  463. Subject: Re: instancing octrees
  464.  
  465. Hello Greg,
  466.  
  467. I'm getting some strange behaviour from "oconv" when
  468. instancing octrees.  I've made a single storey description
  469. of a building and created the (frozen) octree (~0.5Mb).  A
  470. five storey octree can be made virtually instantly, whereas
  471. with 6 or more, "oconv" seems to get hung, gradually soaking
  472. up more memory.  I let one run over lunch and it still didn't
  473. finish!  I've tried increasing the resolution and setting a
  474. bounding box, but to no effect.  Am I right in thinking that
  475. it is, in fact, something to do with the bounding-box?
  476.  
  477. I see that version 2R2b is on pub/xfer, should I be using it?
  478.  
  479. Regards,
  480.  
  481. -John
  482.  
  483. Date: Thu, 17 Sep 92 17:56:17 PDT
  484. From: greg (Gregory J. Ward)
  485. To: edu@de-montfort.ac.uk
  486. Subject: Re: instancing octrees
  487.  
  488. Hi John,
  489.  
  490. Never mind my previous response.  I fooled around with the problem a bit,
  491. and realized that the real difficulty is in resolving the octree instances'
  492. boundaries.  Because your stories are (presumably) wider and longer than
  493. they are high, the bounding cube determined by oconv for the original
  494. frozen octree extends quite a bit above and below the actual objects.
  495. (I suppose that oconv should start with a bounding parallelepiped rather
  496. than a cube, but there you are.)  When you subsequently stack your octrees
  497. to create a building, the vertical faces of the corresponding bounding
  498. cubes are largely coincident.  As you may or may not know, oconv will
  499. then resolve these coincident faces to the resolution specified with
  500. the -r option (1024 by default).  This can take quite a long time.
  501.  
  502. There are two possible solutions.  The best one is probably to reduce
  503. the value of -r to 200 or so, provided that you don't have a lot of
  504. other detail in your encompassing scene.  The other solution is to
  505. increase the value of the -n option to the number of stories of your
  506. building, or to the maximum horizontal dimension divided by the story
  507. height, whichever is smaller.
  508.  
  509. Ideally, the instanced octrees should not significantly overlap.  As
  510. you noticed, it's even worse when the faces of the bounding cubes
  511. are coplanar and overlapping.
  512.  
  513. Hope this helps!
  514.  
  515. -Greg
  516.  
  517. P.S.  The behavior of oconv used to be MUCH worse with regards to overlapping
  518. instances.  It used to try to resolve the entire intersecting VOLUME to the
  519. maximum resolution!
  520.  
  521. =========================================================
  522. CONSTANTS - Constant expressions in .cal files
  523.  
  524. Date: Thu, 24 Sep 92 11:41:57 -0400
  525. From: David Jones  <djones@Lightning.McRCIM.McGill.EDU>
  526. To: greg@hobbes.lbl.gov
  527. Subject: Re:  radiance 2.1 change with "cal" files??
  528.  
  529. In looking in your "ray.1" and trying to understand my error,
  530. I got confused about "constants".  I had pondered arg(n), but since it had
  531. worked before, I dismissed it.
  532.  
  533. I must admit I don't understand the concept of a "constant function".
  534.  
  535. Can you elaborate?  ... and does declaring something as a "constant"
  536. really translate into much of a savings?
  537.  
  538. as always, thanks for your help,
  539.  
  540.    dj
  541.  
  542. Date: Thu, 24 Sep 92 08:52:47 PDT
  543. From: greg (Gregory J. Ward)
  544. To: djones@Lightning.McRCIM.McGill.EDU
  545. Subject: Re:  radiance 2.1 change with "cal" files??
  546.  
  547. Hi Dave,
  548.  
  549. The savings garnered from a constant expression depends on the complexity
  550. of the expression.  When expensive function calls are involved, the savings
  551. can be substantial.
  552.  
  553. A constant function is simply a function whose value depends solely on its
  554. arguments.  All of the standard math functions have the constant attribute,
  555. as do most of the additional builtin functions.  Even the rand(x) function
  556. has the constant attribute, since it returns the same pseudorandom number
  557. for the same value of x.
  558.  
  559. Functions and variables that somehow depend on values that may change due
  560. to a changing execution environment or altered definitions must not be
  561. given the constant attribute or you will get inconsistent results.  This is
  562. because the expression is evaluated only once.
  563.  
  564. Remember also that constant subexpressions are eliminated, so by using
  565. constant function and variable definitions, you save in any expression
  566. that refers to them.
  567.  
  568. I hope this explains it a little better.
  569.  
  570. -Greg
  571.  
  572. =========================================================
  573. IMAGES - Image formats, gamma correction, contrast and colors
  574.  
  575. Date: Sat, 3 Oct 92 19:42:12 -0400
  576. From: "Jim Callahan" <jmc@sioux.eel.ufl.edu>
  577. To: greg@hobbes.lbl.gov
  578. Subject: Exposure & PS(TIFF)
  579.  
  580. Hi Greg-
  581.  
  582.     I understand that Radiance stores images as 32-Bit RGB.  How does
  583. an adjustment of exposure effect the colors displayed.  Obviously it
  584. affects the brightness of the image, but what are the differences between
  585. exposure and gamma correction? Are both needed?  If a light source is too
  586. dim, I want to know in absolute terms. 
  587.  
  588.     This is a bit confusing to me because I realize that the eye is
  589. constantly readjusting its exposure.  I would like to be able to say that
  590. the image is a "realistic" simulation of a scene, but can this really be
  591. done?
  592.  
  593.     Also, do you have any experience with encapsulated PostScript as a
  594. image format.  I can convert to TIFF with the "ra_tiff" program but I don't
  595. know where I should go from there.
  596.  
  597.  
  598.     By the way, what kind of Indigo are you considering?  I got a
  599. chance to see the R4k Elan here in Gainesville and it was impressive.  We
  600. calculated that it would be faster than the whole 17 machine network I use
  601. now in terms of floating point operations! 
  602.  
  603.      
  604.     See ya later...
  605.  
  606.                         -Jim
  607.     
  608. Date: Sun, 4 Oct 92 11:04:43 PDT
  609. From: greg (Gregory J. Ward)
  610. To: jmc@sioux.eel.ufl.edu
  611. Subject: Re:  Exposure & PS(TIFF)
  612.  
  613. Hi Jim,
  614.  
  615. You've touched on a very complicated issue.  The 32-bit format used in
  616. Radiance stores a common 1-byte exponent and linear (uncorrected gamma)
  617. values.  This provides better than 1% accuracy over a dynamic range
  618. of about 10^30:1, compared to about 3% accuracy over a 100:1 dynamic
  619. range for 24-bit gamma-corrected color.
  620.  
  621. Changing the exposure of a Radiance image changes only the relative
  622. brightness of the image.  Gamma correction is meaningful only in the
  623. presence of a monitor or display device with a power law response
  624. function.  Gamma correction is an imperfect attempt to compensate for
  625. this response function to get back linear radiances.  Thus, applying
  626. the proper gamma correction for your monitor merely gives you a linear
  627. correlation between CRT radiance and the radiance value calculated.
  628. (Radiance is named after the value it calculates, in case you didn't
  629. already know.)
  630.  
  631. However, as you correctly pointed out, linear radiances are not necessarily
  632. what you want to have displayed.  Since the dynamic range of a CRT is limited
  633. to less than 100:1 in most environments, mapping calculated radiances to
  634. such a small range of dispayable values does not necessarily evoke the same
  635. response from the viewer that the actual scene would.  The film industry has
  636. known this for many years, and has a host of processing and exposure techniques
  637. for dealing with the problem.  Even though computer graphics provides us with
  638. much greater flexibility in designing our input to output radiance mapping,
  639. we have only just begun to consider the problem, and it has not gotten nearly
  640. the attention it deserves.  (If you are interested in learning more on the
  641. topic, I suggest you check out the excellent CG+A article and longer Georgia
  642. Tech technical report by Jack Tumblin and Holly Rushmeier.)
  643.  
  644. Color is an even stickier problem.  Gary Meyer and others have explored a
  645. little the problem of mapping out-of-gamut colors to a CRT, but offhand
  646. I don't know what work has been done on handling clipped (over-bright)
  647. values.  This is another interesting perceptual issue ripe for exploration.
  648.  
  649. The best you can currently claim for a computer graphics rendering is that
  650. photography would produce similar results.  Combined with accurate
  651. luminance calculations, this should be enough to convince most people.
  652. In absolute terms, the only way to know is by understanding lighting
  653. design and luminance/illuminance levels appropriate to the task.  It will
  654. be many years before we will have displays capable of SHOWING us
  655. unambiguously whether or not a given lighting level is adequate.
  656.  
  657. I think encapsulated PostScript is just PostScript with embedded data
  658. (such as a PICT image) that makes it easier for other software to deal
  659. with since it isn't then necessary to include a complete PostScript
  660. interpreter just to display the file contents.  Such files are used
  661. commonly in the Macintosh and other desktop publishing environments.
  662.  
  663. Russell Street of Aukland University wrote a translator to PICT format,
  664. and I have recently finished a translator to black and white PostScript.
  665. Paul Bourke (also of Aukland University) said he was finishing a color
  666. PostScript translator, so we might have that available soon as well.
  667. (Personally, I think PostScript is a terrible way to transfer raster
  668. data -- the files are humungous and printing them tries my patience.)
  669. If you are going to a Mac environment, I still think TIFF or PICT are
  670. your best bets.
  671.  
  672. I am getting a R4000 Indigo XS24.  It seems to perform very well with
  673. Radiance, outpacing my Sun 3/60 by a factor of about 30!
  674.  
  675. -Greg
  676.  
  677. =========================================================
  678. GENERAL - Some general questions about global illumination and rendering
  679.  
  680. Date: Mon, 5 Oct 92 10:07:33 +0100
  681. From: u7x31ad@sun4.lrz-muenchen.de
  682. To: greg@hobbes.lbl.gov
  683. Subject: Radiance and Mac
  684.  
  685. High Greg,
  686. i am a student here at munich university and on striving through Internet
  687. i came across Your Radiance-SW. Since i've been interested in Computer
  688. Graphics for quite a long time already i was very happy to find something
  689. like Radiance.
  690. Is there any possibilty to get the radiance-system running on a Macintosh.
  691. The system i have is a Qudra 950, 64/520MB, 16"RGB Screen.
  692. What i want to do is to create photorealistic pictures of rooms etc. but not
  693. only with raytracing. What i am looking for is a combination  from both:
  694. Raytracing & Radiosity. Do You know any SW that uses a method also
  695. calculating specular refelctions on surfaces?
  696. An adition i am thinking about a methode to include the characteristics
  697. of the various types of lamps used to give light to a scenery.
  698. But not to take too much of Your time - if Your interested please let
  699. me know and i will try to explain it in better english
  700. Thank You
  701. Christian von Stengel
  702. u7x31ad@sun4.lrz-muenchen.de
  703.  
  704. Date: Mon, 5 Oct 92 09:35:13 PDT
  705. From: greg (Gregory J. Ward)
  706. To: u7x31ad@sun4.lrz-muenchen.de
  707. Subject: Re:  Radiance and Mac
  708.  
  709. Hello Christian,
  710.  
  711. Currently, the only way to get Radiance running on the Macintosh is to get
  712. Apple's A/UX product.  This is an implementation of UNIX System V with
  713. Berkeley extensions, and the current distribution (3.0) includes X11 as
  714. well.  It costs about $600.00 in the States and takes up about 160 Mbytes
  715. of disk space.  The good news is that you can still run most of your Mac
  716. software under A/UX (and note that you don't HAVE to run A/UX if you don't
  717. want to just because you installed it), and I use Radiance with A/UX all
  718. the time and have found it to be quite reliable.
  719.  
  720. I have not ported Radiance to the native Mac OS, primarily due to lack of
  721. time and motivation.  If you have used Radiance, you know that it is not
  722. a menu-based application, and thus doesn't fit into the Macintosh environment
  723. very well.  Someday, when a proper user interface is written for the software,
  724. we can look more seriously at integrating into the Mac world.
  725.  
  726. As far as I know, Radiance is the only free software that accounts for
  727. arbitrary diffuse and specular interactions in complicated geometries.
  728. It does not follow the usual "radiosity" finite element approach, but
  729. it does calculate diffuse interreflections and is essentially equivalent
  730. in functionality to so-called radiosity programs.  If you want to combine
  731. ray-tracing and radiosity, I think you will have a difficult time doing
  732. better than what Radiance does already.
  733.  
  734. Radiance also handles arbitrary light source distribution functions and
  735. secondary light source reflections, so you should examine and
  736. understand these capabilities before embarking on any additional
  737. programming.
  738.  
  739. If after close scrutiny of Radiance's capabilities you find it lacking in
  740. certain areas, please feel free to use the source code as a starting point
  741. for your own explorations into global illumination.  Be warned, though, that
  742. much work has been done by many people in this area already, and you should
  743. do your research carefully if you want to avoid duplicating work.
  744.  
  745. On the other hand, I have often found that duplicating other people's work
  746. in ignorance is a good way to familiarize oneself with a problem.  I
  747. do not wish to discourage your interest.  There are many problems in
  748. global illumination and rendering that are largely unsolved and even
  749. unaddressed.
  750.  
  751. Human perception is a good example of just such a problem.  No one really
  752. knows what goes on between the display screen and the brain, or how to
  753. create a display that evokes the same subjective response from the viewer
  754. as the real scene would have.  Holly Rushmeier, Gary Meyer and Jack Tumblin
  755. have done some pioneering work in this area, but there is much work still
  756. to do before we have some satisfactory answers.
  757.  
  758. I wish you the best of luck in your work!
  759. -Greg
  760.  
  761. Date: Thu, 15 Oct 92 19:32:49 -0400
  762. From: macker@valhalla.cs.wright.edu (Michael L. Acker)
  763. To: greg@hobbes.lbl.gov
  764. Subject: Radiance Question
  765.  
  766. I've been trying to learn your Radiance 2.1 package and apply it
  767. to rendering the lobby of a large building on my campus.  (Another
  768. student and I are doing this as part of an independent graphics
  769. study course.)
  770.  
  771. I have a couple questions I was hoping you could answer.
  772.  
  773. 1)  We have a large skylight in the roof of the lobby.  To simulate this
  774. in our model, I followed the example in the tutorial document you
  775. provide with the Radiance package. (At the end of the tutorial you
  776. create a window that can transmit light and that can be seen through.) 
  777.  
  778. The lobby is completely enclosed and the only light sources are what
  779. we've created inside (some track lighting and recessed incandescent
  780. lights) and the light from the skylight.  Before I added the
  781. skylight, the light from the light sources was sufficient to
  782. 'look' around the room (I didn't need to add the -av option in rpict).
  783. But when I add the skylight with the simulated sky as a new light 
  784. source, the amount of light is blinding.  I have to use 
  785. 'ximage -e -6 ...' to see anything.
  786.  
  787. How can I turn down the intensity of the light from the sky?  I'm
  788. not picking up the info (so far) out of the documentation.  As I said,
  789. I used the method you described in the tutorial.  (I'm also
  790. including the artificial ground as in the tutorial because I
  791. plan to put some first floor windows in later.)
  792.  
  793.  
  794. 2)  Can you recommend any of your examples (or documentation) on how
  795. to put a pattern on a surface?   We're simulating a clear glass brick
  796. wall made up of many small bricks by using one  large polygon of glass.
  797. But we need to simulate the grout (between the actual bricks)
  798. on the large glass polygon.  I could just overlay white polygon strips
  799. over the glass polygon, but the pattern function should be applicable
  800. here.  Any suggestions?
  801.  
  802. Thanks,
  803.  
  804. --Mike
  805.  
  806. Mike Acker,macker@valhalla.cs.wright.edu
  807.  
  808. Date: Fri, 16 Oct 92 10:34:44 PDT
  809. From: greg (Gregory J. Ward)
  810. To: macker@valhalla.cs.wright.edu
  811. Subject: Re:  Radiance Question
  812.  
  813. Hello Mike,
  814.  
  815. In answer to your first question, it sounds as if you are doing nothing wrong
  816. in your modeling of a skylight.  It is quite normal for a Radiance rendering
  817. to require exposure adjustment, either brighter or darker, prior to display.
  818. Pfilt is the usual program to accomplish this.
  819.  
  820. Whereas most rendering programs produce 24-bit integer color images, Radiance
  821. produces 32-bit floating point color images, and there is no loss of quality
  822. in adjusting the exposure after the rendering is complete.  (Normally, this
  823. would wash out a 24-bit rendering.)  It is important NOT to change the value
  824. of your light sources just to get a rendering that is the right exposure,
  825. since you would lose the physical values that Radiance attempts to maintain
  826. in its simulation.  (For example, the 'l' command in ximage would produce
  827. meaningless values.)
  828.  
  829. As for your second question, you can affect the transmission of the "glass"
  830. or "dielectric" types with a pattern, but you cannot affect their reflection,
  831. since that is determined by the index of refraction which is not accessible
  832. in this way.  Thus, you could produce dark grout with a pattern, but not
  833. light grout, because the reflectance of glass is fixed around 5%.
  834.  
  835. If you want white grout, I would use the -a option of xform to place many
  836. polygonal strips just in front and/or behind the glass.  The impact on
  837. the calculation time should be negligible.
  838.  
  839. -Greg
  840.  
  841. =========================================================
  842. TEXDATA - Using the texdata type for bump mapping
  843.  
  844. Date: Wed, 21 Oct 1992 13:19:48 +0800
  845. From: Simon Crone <crones@cs.curtin.edu.au>
  846. Apparently-To: GJWard@lbl.gov
  847.  
  848. Hello Greg,
  849.  
  850.     I am after information on how to use the data files for the
  851. Texdata type.  I want to be able to use a Radiance picture file
  852. as a texture 'map'.  Ie. using the picture file's red value to
  853. change the x normal, the blue value to change the y normal and
  854. the z value to change the z height.  How might I go about this?
  855.     If you could supply an example, that would be great.
  856.  
  857. Many thanks,
  858.     Simon Crone.
  859.  
  860. Date: Wed, 21 Oct 92 11:48:02 PDT
  861. From: greg (Gregory J. Ward)
  862. To: crones@cs.curtin.edu.au
  863. Subject: texture data
  864.  
  865. Hi Simon,
  866.  
  867. There is no direct way to do what you are asking in Radiance.  Why do you
  868. want to take a picture and interpret it in this way?  Is it merely for the
  869. effect?  If you have a picture and wish to access it as data in a texdata
  870. primitive, you must first convert the picture to three files, one for red
  871. (x perturbation), one for green (y perturbation) and one for z 
  872. (z perturbation -- not the same as height).  I can give you more details
  873. on how to do this if you give me a little more information about your
  874. specific application and need.
  875.  
  876. -Greg
  877.  
  878. Date: Thu, 22 Oct 1992 05:06:06 +0800
  879. From: Simon Crone <crones@cs.curtin.edu.au>
  880. To: GJWard@lbl.gov
  881. Subject: Texture-data
  882.  
  883. Hi Greg,
  884.  
  885.     The reason I wish to interpret picture files as texture data is as follows;
  886.  
  887.     The raytracing program ( CAN Raytracing System ) that is being used in our Architecture department contains a number of texture pictures or "bump maps" that are used for various materials definitions.
  888. I am currently converting the raytrace material list ( around 80+ materials ) to radiance material descriptions.
  889. It would be a lot easier if I could use the existing raytrace "bump map" pictures to perturb materials rather than creating new procedural pattern.
  890.     A prime example of this is a water texture.  The raytrace program has a very realistic water pattern, while my efforts to create such a procedural pattern have led to some fascinating, if not realistic textures ( The Molten Murcury pool is my favourite! 
  891. )
  892. The blue channel ( z ) is used as a height for calculation of shadows across a perturbed surface in the raytrace program and does not perturb the z normal.  I realise this may not be possible in Radiance.
  893.  
  894. I hope this helps.
  895.  
  896.  
  897.     Simon 
  898.  
  899. Date: Wed, 21 Oct 92 17:50:17 PDT
  900. From: greg (Gregory J. Ward)
  901. To: crones@cs.curtin.edu.au
  902. Subject: Re:  Texture-data
  903.  
  904. Hmmm.  Sounds like a nice system.  Who makes it (CAN)?  What does it cost?
  905.  
  906. Anyway, you are correct in thinking that Radiance does not provide height-
  907. variation for shadowing, so this information may as well be thrown away.
  908.  
  909. First, you need to put your x and y perturbations into two separate files
  910. that look like this:
  911.  
  912.     2
  913.     0 1 height
  914.     0 1 width
  915.  
  916.     dx00 dx01 dx02 ... dx0width
  917.     dx10 dx11 dx12 ... dx1width
  918.     .
  919.     .
  920.     .
  921.     dxheight0 dxheight1 dxheight2 ... dxheightwidth
  922.  
  923. Replace "height" with the vertical size of the map (# of points), and "width"
  924. with the horizontal size.  The y perturbation file will look pretty much
  925. the same.  (The line spacing and suchlike is irrelevant.)  Let's say you
  926. named these files "xpert.dat" and "ypert.dat".
  927.  
  928. Next, decide the orientation of your surface and apply the texture to it.
  929. For a surface in the xy plane, you might use the following:
  930.  
  931. void texdata my_texture
  932. 9 pass_dx pass_dy nopert xpert.dat ypert.dat ypert.dat tex.cal frac(Px) frac(Py)
  933. 0
  934. 0
  935.  
  936. my_texture plastic water
  937. 0
  938. 0
  939. 5 .1 .2 .6 .05 0
  940.  
  941. water ring lake
  942. 0
  943. 0
  944. 8
  945.     0    0    0
  946.     0    0    1
  947.     0    10
  948.  
  949. Finally, you need to create the following file (tex.cal):
  950.  
  951. { A dumb texture mapping file }
  952. pass_dx(dx,dy,dz)=dx; pass_dy(dx,dy,dz)=dy; pass_dz(dx,dy,dz)=dz;
  953. nopert(dx,dy,dz)=0;
  954.  
  955. This just repeats the texture with a size of 1.  You can use scalefactors
  956. and different coordinate mappings to change this.  If this works or doesn't
  957. work, let me know.  (I have NEVER tried to map textures in this way, so you
  958. will be the first person I know of to use this feature.)
  959.  
  960. -Greg
  961.  
  962. Date: Fri, 23 Oct 1992 00:32:13 +0800
  963. From: Simon Crone <crones@cs.curtin.edu.au>
  964. To: GJWard@lbl.gov
  965. Subject: Texture-data
  966.  
  967. Greg, hello again,
  968.  
  969. Well, the good news is that the texture mapping works! 
  970. I've converted the raytrace water bump map from RLE format to radiance PIC and used the pvalue program to create a large data file.  A small C program then converts this data into the separate x and y perturbation files.
  971. The example of the data file you suggested needed a bit of a modification.
  972. It needed to be:
  973.  
  974.     2
  975.     0 1 height
  976.     0 1 width
  977.  
  978.     dx00 dx01 dx02 ... dx0(width -1)
  979.     dx10 dx01 dx12 ... dx1(width -1)
  980.     .
  981.     .
  982.     etc
  983.  
  984.     i.e. the data was one array too wide and high.
  985.  
  986. The texture works well and is easy to adjust both in the tex.cal function file and through normal transformations etc.  The only drawback is that the size of the data files can be quite large and radiance takes a while to read in and store all the data.
  987. For example the water.rle bump map (a 256x256 image) takes up 203486 bytes.
  988. The water.dat file generated from pvalue is 4194351 bytes.
  989. The xpert.dat and ypert.dat files are each 655379 bytes.
  990.  
  991. As to your queries on the raytrace program ...
  992.     It is the Computer Animation Negus Raytracer (CAN) developed at the
  993. School of Computing Science, Curtin University of Technology, Western Australia.
  994. I am not sure of its cost but you can get more information from the following mail address:
  995.     raytrace@cs.curtin.edu.au
  996.  
  997. -Simon
  998.  
  999. Date: Thu, 22 Oct 92 10:12:11 PDT
  1000. From: greg (Gregory J. Ward)
  1001. To: crones@cs.curtin.edu.au
  1002. Subject: Re:  Texture-data
  1003.  
  1004. Hi Simon,
  1005.  
  1006. I'm glad to hear that it works!  Sorry about my error in the data file
  1007. description.
  1008.  
  1009. Yes, the data files are large and not the most efficient way to store
  1010. or retrieve data.  Sounds like yours is taking about 10 bytes per value.
  1011. Different formatting might reduce this to 5 bytes per value, but that's
  1012. about the best you can hope for.
  1013.  
  1014. In most cases, the ASCII data representation is preferable for ease of
  1015. editing and so on.  (Data files are most often used for light source
  1016. distributions.)  The main exception is pattern data, for which I allow
  1017. Radiance picture files, as you know.  Since you are currently the only
  1018. one I have heard from using texture data, it doesn't seem necessary at
  1019. this point to create yet another file type to hold it, and I don't favor
  1020. using a picture format to hold other types of data.  (The Radiance picture
  1021. format doesn't allow negative values, for one thing.)
  1022.  
  1023. -Greg
  1024.  
  1025. =========================================================
  1026. CSG - Using antimatter type for destructive solid geometry
  1027.  
  1028. Date: Fri, 30 Oct 92 16:37:32 PST
  1029. From: rocco@Eng.Sun.COM (Rocco Pochy)
  1030. To: greg@hobbes.lbl.gov
  1031. Subject: radiance question
  1032.  
  1033. I just stared playing around with radiance and have ran into a
  1034. problem trying to create a sphere with a missing slice (i.e like
  1035. and orange slice).
  1036.  
  1037. How would you go about implementing this feature? Something like
  1038. a CSG subtraction... Looks pretty hot from what I've seen...
  1039.  
  1040.                         R.
  1041.  
  1042. Date: Fri, 30 Oct 92 17:17:06 PST
  1043. From: greg (Gregory J. Ward)
  1044. To: rocco@Eng.Sun.COM
  1045. Subject: Re:  radiance question
  1046.  
  1047. Hello Rocco,
  1048.  
  1049. Radiance does not support CSG directly.  There are two ways to create
  1050. an orange with a wedge missing.  The easiest is to use gensurf to make
  1051. a boundary representation (using Phong-smoothed polygons) like so:
  1052.  
  1053.     !gensurf 'cos(5.5*s)*sin(PI*t)' 'sin(5.5*s)*sin(PI*t)' \
  1054.         'cos(PI*t)' 20 20 -s
  1055.  
  1056. The value 5.5 is instead of 2*PI to get the partial sphere.  You may
  1057. have to use a couple of polygons or rings if you want the sliced
  1058. area to be solid.  The sphere here will have a radius of one, centered
  1059. at the origin.  You can use xform to size it and move it from there.
  1060.  
  1061. The second way to get an orange with a wedge missing is to use the
  1062. antimatter type to "subtract" the wedge from a real sphere.  The
  1063. description might go something like this:
  1064.  
  1065.     void plastic orange_peel
  1066.     0
  1067.     0
  1068.     5 .6 .45 .05 .05 .02
  1069.  
  1070.     void antimatter orange_slice
  1071.     1 orange_peel
  1072.     0
  1073.     0
  1074.  
  1075.     orange_peel sphere orange
  1076.     0
  1077.     0
  1078.     4 0 0 0 1
  1079.  
  1080.     !genprism orange_slice slice 3  0 0  2 0  2 1.5  -l 0 0 -2 \
  1081.         | xform -t 0 0 1
  1082.  
  1083. Genprism makes a triangular prism to cut the wedge from the sphere.
  1084. This will make a slice using the same material as the peel.  If you
  1085. want a different material there, you can prepend your material to the
  1086. list of string arguments for orange_slice.
  1087.  
  1088. Note that there are problems with the antimatter type that make the
  1089. the gensurf solution preferable if you can live with it.
  1090.  
  1091. Hope this helps!
  1092. -Greg
  1093.  
  1094.