home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Raytrace & Morphing / SOS-RAYTRACE.ISO / programm / texte / rtnv7n2 < prev   
Encoding:
Text File  |  1994-02-03  |  64.0 KB  |  1,412 lines

  1.  _ __                 ______                         _ __
  2. ' )  )                  /                           ' )  )
  3.  /--' __.  __  ,     --/ __  __.  _. o ____  _,      /  / _  , , , _
  4. /  \_(_/|_/ (_/_    (_/ / (_(_/|_(__<_/ / <_(_)_    /  (_</_(_(_/_/_)_
  5.          /                               /|
  6.         '                               |/
  7.  
  8.             "Light Makes Right"
  9.  
  10.              February 2.01, 1994
  11.             Volume 7, Number 2
  12.  
  13. Compiled by Eric Haines, 3D/Eye Inc, 1050 Craft Road, Ithaca, NY 14850
  14.     erich@eye.com
  15. All contents are copyright (c) 1994 by the individual authors
  16. Archive locations:  anonymous FTP at princeton.edu (128.112.128.1)
  17.     /pub/Graphics/RTNews, wuarchive.wustl.edu:/graphics/graphics/RTNews,
  18.     and many others.
  19.  
  20. Contents:
  21.     Introduction
  22.     Ray Tracing Roundup
  23.     A Note on SPD Platform/Compiler Results (SPARC II), by David Hook
  24.     OORT - Object Oriented Ray Tracer, by Nicholas Wilt [and Eric Haines]
  25.     Partial Evaluation Applied to Ray Tracing, by P.H. Andersen
  26.     Comparison of Ray Traversal Methods, by Erik Jansen
  27.     Sphere Tessellation//Gamma Correction, by Olin Lathrop
  28.     Computational Geometry On-Line Bibliography, by Bill Jones
  29.     Summary of Advanced Rendering Papers from Eurographics '93, by
  30.         Erik Jansen
  31.     RAT, Another Ray Tracer, by Tom Wilson
  32.     Fast Raytracing via SEADS, by John Chapman and Wilfrid Lefer
  33.     Parallel Ray Tracing Schemes, by Rainer Menes
  34.     Notes on Parallel Ray Tracing, by Hsiu Lin and Sam Uselton
  35.     Parallel Texturing, by Jon Leech and Brian Corrie
  36.     Mapping Texture on a Sphere, by Ron Capelli
  37.     Computational Geometry in C, by Joseph O'Rourke
  38.     Programming for Graphics Files in C and C++, by John R Levine
  39.     Point in Polygon, the Quick Answer, by Wm. Randolph Franklin and
  40.         Eric Haines
  41.     Elib and NetNews Information, by Eric Haines
  42.     CFP: 5th Eurographics Workshop on Rendering, by Georgios Sakas
  43.     CFP: 5th EG workshop on Animation & Simulation, by Gerard Hegron
  44.     Morphology Digest, by Henk Heijmans
  45.     Position of the Sun, by Joe Cychosz
  46.  
  47. -------------------------------------------------------------------------------
  48.  
  49. Introduction
  50.  
  51. In celebration of James Joyce's birthday, (or is it Bloomsday, or both?  I
  52. forget...)  we're having a special two-for-one sale.  This issue is dedicated
  53. to research issues and programmer resources.  It includes articles on a
  54. variety of rendering related topics, research article summaries, new books,
  55. etc.  The other issue (v7n1) is more for renderer users.  There was enough
  56. accumulated stuff that I decided to try splitting things along these lines.
  57. Let me know if the split was worthwhile.
  58.  
  59. There are some worthwhile resources and articles in this issue.  Nicholas
  60. Wilt's ray tracer in C++ is now available on the net.  P.H. Andersen's
  61. progress report discusses an acceleration technology I had not heard of
  62. before.  Erik Jansen reports on some surprising results with acceleration
  63. techniques he's exploring.  Olin Lathrop takes a position ("Gamma correction
  64. is largely a crock") which is both polemical and practical.  There are also
  65. extracts from the net on parallelism which I found interesting, along with
  66. some article summaries, new book listings, CFP's and whatnot.
  67.  
  68. Some things worth watching for (but haven't been released yet) are "Graphics
  69. Gems IV" edited by Paul Heckbert, Academic Press; Sillion & Puech's radiosity
  70. book from Morgan Kaufmann; and Ian Ashdown's applied radiosity book.  Further
  71. on (by SIGGRAPH, I assume) will be Glassner's digital image synthesis book
  72. from Morgan Kaufmann, the first full-length book dedicated to computer graphics
  73. related theory.  If you know of anything I've missed, let me know.
  74.  
  75. -------------------------------------------------------------------------------
  76.  
  77. Ray Tracing Roundup
  78.  
  79.  
  80. Updated Ray Tracing and Radiosity Bibliographies
  81.  
  82. The free ray tracing and radiosity bibliographies which I maintain have been
  83. updated with references from 1993.  These are at:
  84. princeton.edu:/pub/Graphics/Papers, RayBib.10.93.Z and RadBib.10.93.Z
  85.  
  86. (Eric Haines)
  87.  
  88. --------
  89.  
  90. References to Blobby Models, Metaballs, etc.
  91.  
  92. The following is a bibliography on particle systems compiled by David Breen at
  93. Rensselaer, myself, and Bill Gates at UBC.  Blobby objects and metaballs are
  94. one type of particle systems.  This bibliography has been printed as part of
  95. the SIGGRAPH'92 course #16 notes:  "Particle System Modeling, Animation, and
  96. Physically Based Techniques".
  97.  
  98. (Dave Tonnesen, davet@dgp.toronto.edu)
  99.  
  100. [I do not include the bibliography here because it is (surprisingly) long.  If
  101. you want it, you can ask me for a copy.  -EAH]
  102.  
  103. -------------------------------------------------------------------------------
  104.  
  105. A Note on SPD Platform/Compiler Results (SPARC II), by David Hook
  106.     (dgh@ecr.mu.oz.au)
  107.  
  108. With the tweaked benchmarks in RTNv6n3 we removed the backing polygon
  109. altogether from the scene - we did this because we were interested in
  110. measuring the effect of having such a large object in the scene.
  111.  
  112. -------------------------------------------------------------------------------
  113.  
  114. OORT - Object Oriented Ray Tracer, by Nicholas Wilt (75210.2455@compuserve.com)
  115.     [and Eric Haines]
  116.  
  117. [I have also woven in my own comments about the book and code into this
  118. announcement.  Nick is nice enough to make the code available for free on the
  119. net, as the disk does not come with the book and normally costs $33 more!]
  120.  
  121. [The code for Nick's book is now available at the following sites as
  122. oort10.zip and oort10.tar.Z:
  123.     wuarchive.wustl.edu:/graphic/graphics/ray
  124.     ftp.funet.fi:pub/graphics/packages/ray-tracing/oort
  125.     gondwana.ecr.mu.oz.au (128.250.70.62):/pub
  126. -EAH]
  127.  
  128. Extracted from the README:
  129.      This distribution contains the source code that accompanies my book,
  130. _Object-Oriented Ray Tracing in C++_.  If you are interested in ray tracing,
  131. or if you want to understand OORT in more detail, you can call John Wiley &
  132. Sons at 1-800-CALLWILEY (1-800-225-5945) to order it.  Alternatively, you can
  133. find it in a local bookstore or have them order it for you (ISBN 0471 304 158,
  134. $36.95).
  135.  
  136. [I proof-read much of this book.  It's good for the serious novice programmer
  137. wanting to do a ray tracer (the C++ code also seems nice, but I'm just a
  138. beginner here); though it's a trade paperback, it's well referenced (for a
  139. switch).  It follows mainstream professional practices instead of amateur
  140. inventions.  The layout and illustrations are nothing to write home about, but
  141. suffice.  The first two thirds of the book walks through the topics below,
  142. the last third is a reference manual for the OORT class library and appendices
  143. for an intro to C++, GIF display, scene examples, file formats, etc.  The code
  144. per page amount is around 65% code for the first two thirds of the book, which
  145. is pretty high as these things go but is pretty reasonable for a book
  146. presenting C++ for novices.  Also, the code is well commented, so it's usually
  147. not just pages and pages of tokens.  -EAH]
  148.  
  149.      The book assumes some knowledge of 3D computer graphics.  It includes
  150. lots of references so readers can pursue their own research, too.  The topics
  151. covered include the following:
  152.  
  153.      -    Vectors and matrices for computer graphics.
  154.  
  155.      -    Standard Hall shading model with ambient, diffuse, specular,
  156.       reflective and transparent components.
  157.  
  158.      -    Rendering various primitives (planes, rings, polygons, spheres,
  159.       bounding boxes, quadrics, CSG and algebraic surfaces).
  160.  
  161.      -    Ray tracing acceleration.  OORT implements Goldsmith and Salmon's
  162.       automatic bounding volume hierarchy generation for speed.  It also
  163.       includes a hand-coded 80x87 assembler routine to intersect a ray
  164.       with a bounding box.
  165.  
  166.      -    Texture mapping.  Procedural and solid texturing is described.  OORT
  167.       implements a bunch of inverse mappings (sphere, cone, cylinder,
  168.       quadrilateral, circle).
  169.  
  170.      -    Distribution ray tracing for antialiasing, soft shadows, and
  171.       imperfectly reflective and translucent objects.
  172.  
  173.      -    Statistical optimization to make the distribution ray tracing go
  174.       faster.
  175.  
  176.      OORT is a class library for ray tracing.  As such, it does not implement
  177. an input language or interactive user interface.  Currently, images are
  178. described to the ray tracer using calls into the class library.  This is
  179. surprisingly painless; unlike C code, C++ is almost as intuitive as the input
  180. language of a ray tracer.  In addition, C++ is much more powerful than any ray
  181. tracer input language; it has loop constructs, functions and support for
  182. abstract data types.  Finally, C++ debugging tools are much more sophisticated
  183. than the debugging tools that are available for proprietary ray tracer input
  184. languages.
  185.  
  186.      All these protestations are not to say that no interactive user interface
  187. for OORT is in the works.  I plan to develop an interactive user interface for
  188. OORT, and may provide parsers for other ray tracers' input languages.  But for
  189. now, if you want to make pictures using OORT, you have to develop in C++.
  190.  
  191. [If you want to make pretty pictures, get POV, Polyray, Rayshade, etc.  If you
  192. want to look at some nice C++ code for a vector & matrix library, etc, check
  193. this code out.  Note that the code does use templates (which some C++
  194. compilers don't have yet, Microsoft's included).  Also, it's interesting to
  195. note that this code is easier to integrate into existing software packages
  196. since it is procedure driven (unlike most free ray tracers out there which are
  197. input language driven).  Finally, this book is worthwhile as an example of a
  198. serious C++ application.  Personally, learning C++ by examining the trivial
  199. examples in most books is useful for understanding syntax, but grokking the
  200. true power of OO is easier when examining a full-blown ray tracer built in
  201. C++.  There are times when a pure object orientation is not used in this code
  202. for simplicity (e.g. bounding boxes are treated differently), but otherwise
  203. it's pleasantly polymorphic. -EAH]
  204.  
  205. ----
  206.  
  207. Nicholas Wilt writes:
  208.  
  209. There are two versions of OORT.  The June 1993 version was cut for the book.
  210. The only people who can get their hands on the June build are those who buy
  211. the book/disk set from Wiley.
  212.  
  213. The freeware distribution was cut in late 1993 (November or December).  The
  214. differences between the book distribution and the freeware distribution are
  215. minimal:
  216.  
  217. 1) The book distribution contains a shareware GIF viewer, but the freeware
  218.    distribution does not (I figure anyone who can get their hands on the
  219.    freeware distribution has access to a GIF viewer of their own).
  220.  
  221. 2) The freeware distribution has a few fixes to make OORT compatible with
  222.    Borland C++ 4.0.  The number of lines of code affected can be counted on
  223.    one hand, but the source code won't compile as is for BC++ 4.0.
  224.  
  225. The "official," current version of OORT is the freeware distribution (again,
  226. the differences are minimal).
  227.  
  228. ----
  229.  
  230. Nicholas Wilt also writes about what he's up to now:
  231.  
  232. I've been working on the C++ code lately, though not on the rendering engine.
  233. I want an object-oriented framework for 3D rendering that decouples the
  234. rendering technique from the modelling and quantization and display.  That led
  235. me to develop an interactive modelling and display program for Microsoft
  236. Windows and Windows NT (I got tired of writing C++ source code to render
  237. images).  You professionals won't be too excited, but there are lots of ray
  238. tracing wienies here on CompuServe that might be :-).
  239.  
  240. Windows is a good environment for this stuff, because it has dynamic linking
  241. built in.  If I do the renderer right, it should be very configurable and
  242. extensible.  NT has symmetric multiprocessing and a multitude of networking
  243. models built in (RPC, named pipes, sockets, to name a few), so doing a
  244. parallel ray tracer should be a snap.
  245.  
  246. I got tired of waiting for ray tracings to finish, so I did a Z-buffering
  247. polygonal renderer.
  248.  
  249. -------------------------------------------------------------------------------
  250.  
  251. Partial Evaluation Applied to Ray Tracing, by P.H. Andersen (txix@diku.dk)
  252.  
  253. I have implemented a simple ray tracer in C, and optimized it by partial
  254. evaluation to run twice as fast.  The unoptimized program is faster than
  255. Rayshade 4.0.6 measured on raw intersection speed.
  256.  
  257. I am currently working on optimizing Rayshade by partial evaluation.
  258.  
  259. Below is a short description of partial evaluation and the application to ray
  260. tracing.
  261.  
  262.  
  263. Partial Evaluation.
  264.  
  265. Partial evaluation is a general and automatic program transformation technique
  266. that can specialize programs with respect some of their input data.
  267.  
  268. A partial evaluator is a program which, when given a program and some of its
  269. input data (the static data), produces a specialized program.  Running the
  270. specialized program on the remaining input data (the dynamic data) yields the
  271. same results as running the original program on all of its input data.  A
  272. partial evaluator unrolls loops, unfolds function calls, precomputes
  273. expressions that only depend on static data, and reduces expressions depending
  274. on dynamic data.  The benefit of partial evaluation is speed of execution:
  275. the specialized program is often significantly faster than the general
  276. program.  Refer to [5] for a general introduction to partial evaluation.
  277.  
  278. For this project we use a partial evaluator for C called C-Mix [1], [2], [3].
  279.  
  280.  
  281. Ray Tracing.
  282.  
  283. The usual implementation is by a general algorithm which, given a scene and a
  284. ray, performs computation to follow its path.  The main loop of the ray
  285. tracing algorithm could look like this:
  286.  
  287.     for each pixel (x,y) in the picture do
  288.     ray = <compute the primary ray using (x,y)>;
  289.     color = trace(scene, ray);
  290.     plot(x, y, color);
  291.  
  292. Since trace calls itself recursively to model reflected and refracted light,
  293. the algorithm is rather time consuming.
  294.  
  295.  
  296. Partial Evaluation Applied to Ray Tracing.
  297.  
  298. In all calls to the function trace the scene is the same, which makes partial
  299. evaluation highly relevant.  Thus we specify that scene is static and ray is
  300. dynamic.  Given the program and the static scene data the partial evaluator
  301. will produce a specialized program, where the main loop will look like this:
  302.  
  303.     for each pixel (x,y) in the picture do
  304.     ray = <compute primary ray using (x,y)>;
  305.     color = trace_scene(ray);
  306.     plot(x, y, color);
  307.  
  308. The function trace_scene is a version of trace, which is specialized with
  309. respect to the scene.  In other words:  trace_scene is a new function, which
  310. is only good for tracing rays in this one scene, but which is often faster
  311. than the general algorithm.
  312.  
  313. If the picture generated is big enough, the time to specialize plus the time
  314. to run the specialized program will be less than the time to run the original
  315. program (often true, since we all know how time consuming ray tracing can
  316. be!).  Further, in situations where the specialized program is run more than
  317. one time, the gain is much greater of course.  This is especially the case for
  318. animations where only the viewpoint changes and/or only part of the scene
  319. changes.  Another example is interactive design where one wants to try out
  320. different surface data, light sources, or eye positions.
  321.  
  322.  
  323. Related Work.
  324.  
  325. Mogensen specialized a very modular ray tracer written in a functional
  326. language [6], showing that the administrative overhead can be removed by
  327. partial evaluation.
  328.  
  329. Hanrahan has a `surface compiler' which accepts as input the equation of a
  330. surface and outputs the intersection code as a series of C statements [4].  He
  331. reports speedup of 20 %.
  332.  
  333.  
  334. References.
  335.  
  336. [1] Andersen, L.O.  Partial Evaluation of C and Automatic Compiler Generation
  337.     (Extend Abstract).  Compiler Construction, Paderborn, Germany.  October
  338.     1992.  (Lecture Notes in Computer Science, vol. 641).
  339.  
  340. [2] Andersen, L.O.  Self-Applicable C Program Specialization.  Proc. of ACM
  341.     Symposium on Partial Evaluation and Sematics-Based Program Manipulation,
  342.     PEPM'92.  1992.
  343.  
  344. [3] Andersen, L.O.  Binding-Time Analysis and the Taming of C Pointers.  Proc.
  345.     of ACM Symposium on Partial Evaluation and Sematics-Based Program
  346.     Manipulation, PEPM'93.  1993.
  347.  
  348. [4] Hanrahan, Pat.  Ray Tracing Algebraic Surfaces.  Computer Graphics, Volume
  349.     17, Number 3.  July 1983.
  350.  
  351. [5] Jones, N.D., Gomard, C.K, and Sestoft, P.  Partial Evaluation and
  352.     Automatic Program Generation.  Prentice-Hall.  1993.
  353.  
  354. [6] Mogensen, Torben.  The application of Partial Evaluation to Ray-Tracing.
  355.     Master Thesis, University of Copenhagen, Dept. of Computer Science, DIKU.
  356.     1986.
  357.  
  358. -------------------------------------------------------------------------------
  359.  
  360. Comparison of Ray Traversal Methods, by Erik Jansen (fwj@duticg.twi.tudelft.nl)
  361.  
  362. In RT-News Vol 5, nr.1, July 1992, we reported a comparison of the DDA-grid
  363. traversal as implemented (standard) in RayShade with a recursive bintree (BSP)
  364. traversal implemented in RayShade by Wim de Leeuw.  Although the BSP-method in
  365. all cases performs reasonable well (without additional tweaking), the grid
  366. method wins when some tweaking is allowed (leaving the groundplane out of the
  367. grid, etc.).
  368.  
  369. I disagree with those authors that take the position that a method should be
  370. fully automatic (without adjusting parameters by hand).  Of course, in
  371. practice it would be handy to have a fully automatic method, but personally I
  372. think that we have two different problems:  (1) which method is fastest (with
  373. the best settings possible) and (2) how can we automate the method to find the
  374. optimum setting of parameters algorithmically.  In addition, I think that we
  375. should be liberal in allowing having a two-level grid, i.e.  a main grid with
  376. in certain partitions or macro-objects a subgrid.  So, in my opinion, a grid
  377. method could be hierarchical as well (and still differ basically from the
  378. adaptive methods as bintree and octree).  With these assumptions the grid
  379. method is (still) the winner.
  380.  
  381. We have continued our experiments with the implementation of a DDA-bintree
  382. traversal in RayShade.  This was done by another student, Pim van der Wal.
  383. The method uses the standard RayShade DDA-traversal that traverses a
  384. (two-level) 3D virtual grid that is mapped to the bintree subdivision with an
  385. (hierarchical) spatial index in the style of the EXCELL method of Tamminen
  386. (the alternative of a hash table needs less memory but is slower).  From a
  387. first implementation we learned that the timings for the SPD models did not
  388. really differ from those with the BSP-method, so we may conclude that the
  389. recursive traversal is indeed an efficient traversal for the bintree, and we
  390. did not persue the DDA-bintree approach any further.
  391.  
  392. With respect to comparing the grid method with the bintree (or octree)
  393. methods, we were interested to know whether the three methods would behave
  394. differently when the density of the model data was increased locally.
  395. Intuitively we thought that this would benefit the adaptive methods and harm
  396. the grid method.  Therefore we made different linear approximations of the
  397. teapot model, increasing the amount of polygons from 10,000 to 60,000.  For
  398. the subdivision of the bintree a subdivision criterion of max.  20 polygons
  399. per cell was used.  For the grid a resolution of nxnxn was chosen where n =
  400. (#polygons)^1/3 (eg.  22x22x22 for 10712 polygons).
  401.  
  402. polygons   grid    bsp    dda-bintree
  403. 10712     164.7   197.3    229.9
  404. 20592     206.0   216.6    250.7
  405. 30800     207.8   238.1    279.2
  406. 43056     232.8   258.8    322.4
  407. 53592     246.3   270.7    328.8
  408. 61256     267.0   291.9    345.7
  409.  
  410. If you plot these figures, you see three parallel lines!
  411.  
  412. [This is a pretty surprising result, if you think about it - increasing the
  413. number of polygons affects all schemes in the same fashion, on the face of it.
  414. Erik will be making more results and ideas available from time to time, since
  415. this is work in progress.  -EAH]
  416.  
  417.  
  418. I wrote Erik in response:
  419.  
  420. One area I wish was explored more formally is characterizing the complexity of
  421. a model with regards to its rendering method.  One interesting scheme Cornell
  422. tried a decade ago (in the Weghorst & Hooper & Greenberg TOG paper, I think)
  423. was to do things like zoom way out (so that the model was a speck on the
  424. screen), do a normal rendering, and zoom way in (so a tiny portion of one
  425. surface was rendered.  A graph of time spent vs.  field of view angle might be
  426. interesting in comparing schemes.
  427.  
  428. Varying the size of the background plane polygon and charting the effect on
  429. various schemes might also be illuminating.  You and I can guess what the
  430. results probably will be.  But you don't know until you try, as you point out
  431. with your recent experiment.  It would also be interesting to me to try to
  432. characterize the models themselves, e.g.  graph the number of objects per cell
  433. for a given set of models and see if there are any correlations between these
  434. graphs and relative performance of schemes (e.g.  we suspect "when there are a
  435. large number of grid cells with a large number of items, the octree scheme
  436. performs better than DDA").
  437.  
  438. Anyway, these are just some experiments that your research made me think
  439. about.  What would be useful is some more knowledge of statistical methods, as
  440. I'm not sure how you could characterize such graphs into a few variables, for
  441. example, and then see the correlation between these variables and performance
  442. times.  Such research could lead to some heuristics that would be quite
  443. useful:  "when the graph looks like this, use BSP, else use DDA".
  444.  
  445. -------------------------------------------------------------------------------
  446.  
  447. Sphere Tessellation//Gamma Correction, by Olin Lathrop
  448.     (olin%cognivis@uunet.uu.net)
  449.  
  450. [These are comments by Olin on RTNv6n3.  Olin is the president of Cognivision,
  451. a visualization company, and has been in rendering for more than a decade.
  452. -EAH]
  453.  
  454.                Simple Sphere Tessellation
  455.  
  456. The method as described [make three subtriangle from one triangle, by dividing
  457. from the centroid] would end up with long and thin triangles near the edges of
  458. the original triangles.  Ideally you want a method that is completely
  459. symmetrical in recursion.  That doesn't really exist, but you can get much
  460. better results by subdividing each triangle into four triangles by using the
  461. midpoints of the edges.  I tried this about ten years ago with quite
  462. reasonable results.
  463.  
  464. The problem is that the four newly created triangles aren't exactly the same
  465. size due to the sphere's curvature.  The center one is always larger than the
  466. other three.  This effect falls off rapidly as the original triangle gets
  467. smaller.  The effect is not that strong, but is visually quite noticeable if
  468. you facet-shade the sphere, especially when starting with a tetrahedron (the
  469. worst case).  Starting with an octahedron as Mike Castle suggested is already
  470. noticeably better.
  471.  
  472. You can apply the same technique to subdividing a quadrilateral into four
  473. smaller ones.  In this case, start with a cube.
  474.  
  475. ----
  476.  
  477.                 Gamma Correction
  478.  
  479. Gamma correction is largely a crock because the fundamental assumption is
  480. wrong.  Yes, there is a (reasonably) reliable relationship between voltage and
  481. phosphor emission power that the standard "gamma" formula models well enough
  482. for our purposes.  Unfortunately, this is not at all what the relationship
  483. from pixel intensity value to visible brightness actually looks like.  Major
  484. reasons why not include the monitor offset (black level) control, and the
  485. CRT's reflection of ambient light.  The amplifiers can also be quite
  486. non-linear at low voltage levels.
  487.  
  488. All this amounts to black not really being black, which throws a big wrench
  489. into the gamma formula.  Here is how I think of and deal with the problem:
  490.  
  491. The problem really comes down to mapping an image with a large dynamic range
  492. (256:1) to an output medium with considerably less.  Ektachrome slides can get
  493. to 150:1, glossy prints with careful illumination 80:1, matte prints maybe
  494. 40:1, newspapers 15:1.  A well adjusted monitor in a dark room maybe 100:1 if
  495. everything is perfect.  Figure 40:1 (if that much) for more normal monitor
  496. situations.  Contrast this to real world scenes in a office, which can easily
  497. reach 500:1.
  498.  
  499. Clearly, something needs to get squashed in the process displaying or making a
  500. hard copy of most images.  The quest is to squash while maintaining the highest
  501. perceived "likeness" to the true image.  Humans perceive intensities
  502. logarithmically, not linearly.  Since we want to do image manipulations in
  503. perceptual linear space, this means manipulating brightnesses in mathematical
  504. log space.  Humans also tend to "tune out" details in dark areas of a scene.
  505. There was a lot of interesting research on this stuff done by Kodak back in the
  506. 1930s.
  507.  
  508. Between the black level problem, the way our perception system works, and a
  509. host of unpredictable environmental variables, it seems pointless to try to
  510. come up with a formula that can then be "corrected" for.  Even if you could
  511. come close, my points are:
  512.  
  513.   1)   Such a formula couldn't be reasonably approximated by anything as simple
  514.        as one "gamma" exponential.
  515.  
  516.   2)   Even if the function was known, you don't want to "correct" for the best
  517.        linear mapping anyway.  You want the best logarithmic mapping.
  518.  
  519. So, here's what I do.  My software can map the input black to white range to
  520. any other range, and can independently apply a "brightness" factor.  The
  521. brightness factor is exponential in nature, but doesn't effect full black or
  522. full white.  A value of 0 leaves everything alone.  Positive values
  523. increasingly slosh intensities smoothly to the white end, while negative values
  524. slosh towards black.  This doesn't try to model what the hardware is actually
  525. doing, but provides enough controls to make things look good.
  526.  
  527. I have used this technique to pre-treat images for film recorders, printers,
  528. and other output media with great results.
  529.  
  530. -------------------------------------------------------------------------------
  531.  
  532. Computational Geometry On-Line Bibliography, by Bill Jones
  533.     (jones@skdad.usask.ca)
  534.  
  535. The computational geometry community maintains its own bibliography of
  536. publications in or closely related to that subject.  Every four months,
  537. additions and corrections are solicited from users, after which the database
  538. is updated and released anew.  As of September 1993, it contained 5356 bibtex
  539. entries.  It can be retrieved via anonymous ftp from cs.usask.ca in the
  540. directory pub/geometry.  The file geombib.tar.Z therein is the bibliography
  541. proper, along with supporting software and documentation; geom.ps.Z is a
  542. Postscript formatting of the database; and o-cgc19.ps.Z is an overview which
  543. was published during 1993 in SIGACT News and the International J. Comput. Geom.
  544. Appl.  The file ftp-hints provides more detailed retrieval information.
  545.  
  546. -------------------------------------------------------------------------------
  547.  
  548. Summary of Advanced Rendering Papers from Eurographics '93, by Erik Jansen
  549.     (fwj@duticg.twi.tudelft.nl)
  550.  
  551. [The exact references can be found at princeton.edu in /pub/Graphics/papers
  552. RTBib and RadBib - EAH]
  553.  
  554. Takamura et al.:  a skylight illumination model based on scattering due to air
  555. molecules and aerosols.  Comparison of two methods to calculate the sky
  556. illuminance received by a point:  a band source method and a parallelepiped (a
  557. sort of hemi-cube) method.
  558.  
  559. Blasi et al.:  light absorption and scattering described by a phase function; a
  560. new approximation formula is given that is faster to compute and approximates
  561. closely the theoretical functions; use of the scattering function for
  562. simulating volume density objects (haze, fog, clouds) in a two-pass Monte
  563. Carlo ray tracing.  (this paper received the best paper award).
  564.  
  565. Daldegan et al.:  physical simulation of hair on basis of a dynamic model of
  566. hair and a collision detection technique comparable to the work of Anjyo et al.
  567. Visualization with ray tracing in combination with shadow buffers.
  568.  
  569. Shirman et al.:  techniques to be used in combination with dynamic (viewpoint
  570. dependent) tessellation of curved surfaces:  front- or backfacing test, light
  571. influence test, and existence of silhouette test.  No direct link with ray
  572. tracing or global illumination.
  573.  
  574. Drettakis et al.:  characteristics of illumination functions (maxima, minima,
  575. critical points, etc) and application to sampling and interpolation.
  576.  
  577. Maurel et al.:  exploiting coherence in ray tracing animation sequences by
  578. keeping track of temporal invariances.
  579.  
  580. Nishita et al.:  form factor calculation for curved surface patches by surface
  581. subdivision and element projection; shadow computation using Bezier clipping.
  582.  
  583. Bao et al.:  form factor calculation for curved surface patches by
  584. approximating the surfaces with triangular elements.
  585.  
  586. Sbert:  Global form factor calculation by sending a large number of rays in
  587. random directions through a scene.  Discussion of estimators and error
  588. metrics.
  589.  
  590. Michelin et al.:  new form-factor calculation based on reducing the double
  591. integral to a simpler line integral; parallel implementations of the method.
  592.  
  593. Cohen et al:  a (top-down/recursive) ray traversal method for a pyramid data
  594. structure using the midpoint line generation algorithm.  Application to
  595. terrain data visualization.
  596.  
  597. -------------------------------------------------------------------------------
  598.  
  599. RAT, Another Ray Tracer, by Tom Wilson (twilson@sunny5.dab.ge.com)
  600.  
  601. My goal [in making my ray tracer] is very different from the others.
  602.  
  603. RAT - a ray tracing package to benchmark acceleration schemes.  Although it is
  604. less primitive than its existence as my Ph.D. research work, it is still
  605. primitive compared to existing packages.  It only does very basic effects (no
  606. fuzzy shadows, textures, etc.).  It does contain several accelerators though:
  607. uniform subdivision, (a bad) HTE, BSP tree and octree with index grids, and
  608. extent tracing (my research).  The idea of the package is to be able to plug
  609. in accelerators very easily.  Someone was actually able to do this.  So the
  610. accelerator, recursive bintree traversal, is also available.  Bounding volumes
  611. are also selectable for further testing.
  612.  
  613. Features:
  614.  
  615. IBM PC version?            *
  616. Amiga version?             *
  617. Mac version?               *+
  618.   *=source code can be compiled for it. Images aren't displayed though (need
  619.     to write something or convert the image)
  620.   +=I have a Mac and given time, there will be a Mac version
  621.  
  622. Sphere/Cylinder/Cone       Y
  623.   Paraboloid               Y (I've never tested it, because it's not in SPD)
  624. Efficiency scheme?        US, HTE, BSP, Octree, extent tracing, rec. bintree
  625.  
  626. Advanced local shading - no, but it does the polygon patch shading, SPD teapot
  627.  
  628. User support            e-mail
  629. Other S/W support        some
  630.  
  631. As you can see, it doesn't measure up to the others.  But it's a research
  632. platform, not a pretty-picture generator.  The accelerators should be easy to
  633. plug into existing tracers if they are modularly written.  I'm currently
  634. working on an extension to my own extent tracing accelerator and struggling
  635. with the conversion of Arvo & Kirk's 5D ray classification method.  I also
  636. will try to see if Ohta's tracer can be converted (if I can find it on the net
  637. again).
  638.  
  639. New object types are easily added to the code.  I'd like to add new bounding
  640. volumes, but that is way down the list of things to do.  Also, NFF is the
  641. input format.  A very simple output format is used and a couple of conversion
  642. routines are provided (to .ppm and .ras).
  643.  
  644. I am very elated that Wim de Leeuw was able to add recursive bintree traversal
  645. to the package.  He said it was pretty easy.  I'm looking for other
  646. researchers to either take a stab at it or give me the code so I can try.  It
  647. is far harder for me to take someone else's code that is possibly not
  648. well-structured and convert it to my package than it is for him to convert it
  649. to my documented package.  It still takes a little time, but instructions are
  650. given (they are improving too), and the simplest of all examples, brute force
  651. tracing, is available as a guide.  Basically, 6 routines are necessary:  (1)
  652. scan the command line parameters for the technique and init.  a few variables,
  653. (2) select the BVs to be used for objects (which usually just uses the
  654. defaults, but the choice is there), (3) build the technique's data structure
  655. (something the person already has done), (4) trace one ray through the
  656. structure (also already done), (5) trace one shadow ray through the structure
  657. (often this is the same as #4), (6) print diagnostics for the technique.  All
  658. other code is provided (shading, intersection, etc.).
  659.  
  660. [Contact Tom Wilson if you are interested in this research tool]
  661.  
  662. -------------------------------------------------------------------------------
  663.  
  664. Fast Raytracing via SEADS, by John Chapman (chapman@cs.sfu.ca) and
  665.     Wilfrid Lefer (lefer@lifl.lifl.fr)
  666.  
  667. Greg Stull (gregs@irvine.com) writes:
  668.  
  669. >IEEE Computer Graphics magazine contained an article back in the late 1980's
  670. >[actually 1986, v. 6, n. 4 -EAH] which presented an approach to raytracing
  671. >using a Spatially Enumerated Auxilliary Data Structure (SEADS).  Other than
  672. >requiring a large amount of memory, this seems to be a very promising approach
  673. >since the rendering time of an image is "essentially" unrelated to the scene
  674. >complexity.
  675. >
  676. >I am curious if anyone out there has any experience with this rendering
  677. >method.
  678.  
  679.  
  680. John Chapman replies:
  681.  
  682. That was Fujimoto's technique and yes it takes a lot of memory. An obvious
  683. extension is to use hierarchies of such uniform spatial subdivision structures
  684. so that 'empty' areas are not filled with huge numbers of tiny little
  685. cubes - Wyvill did some work on this with one of his students a few years
  686. ago but I can't remember exactly where it was published at the moment - try
  687. taking a look at Graphics Interface proceedings from around 90 or 91. Hope
  688. this helps.
  689.  
  690. [The paper he means is in GI '89, by David Jevans and Brian Wyvill, "Adaptive
  691. Voxel Subdivision for Ray Tracing" - it's a paper that should get more notice,
  692. as the technique seems quite reasonable (nesting grids, essentially). -EAH]
  693.  
  694. ----
  695.  
  696. Wilfrid Lefer replies:
  697.  
  698. I wrote a ray-tracing using the SEADS structure two years ago.  Implementing
  699. this acceleration technique didn't raise any problem.  You can find the C code
  700. of my software on the following ftp site:
  701.  
  702.     ftp.lifl.fr (dir. /pub/users/graphix/lefer/SEADS)
  703.  
  704. -------------------------------------------------------------------------------
  705.  
  706. Parallel Ray Tracing Schemes, by Rainer Menes (menes@statistik.tu-muenchen.de)
  707.  
  708. [This is a introduction to some of the basic problems of parallelizing a
  709. ray tracer - EAH]
  710.  
  711. Dennis Gorrie writes:
  712. >I'm trying to come up for a project that shows off
  713. >distributed processing, and my first interest was ray-tracing.
  714. >I don't have much background in writing rendering code, so I
  715. >am not sure how it would be done in a distributed environment:
  716. >
  717. >1) render a picture 1 scanline at a time, where each machine
  718. >in the pool does a scanline.
  719. >
  720. >2) break the picture up into n portions for n machines, and
  721. >have each one work on their own portion.
  722. >
  723. >Well, I'm really not sure what the best way to do this is.
  724. >For #1, this would ensure each machine does equal amounts
  725. >of work, however, perhaps this method would be very good
  726. >to use with an incremental integer algorithm for rendering.
  727.  
  728. Hmmm, this is not a good method to do it.  You also will have to deal with the
  729. problem that the workload is not equally distributed over the scanlines.  An
  730. idea which is not bad is to interleave the scanlines on each processor like
  731. this (1 Processor gets scanline 0, n, 2*n, ...  the next processor get 2 get
  732. 1, n + 1, 2*n + 1, ....  and so on).  This gives you a static way to
  733. distribute the work over several processors.  This method has two problems.
  734.  
  735. 1.)  It will only work for a small number of workers.  Otherwise the scanlines
  736. on the processor are so far from each other that they are not related and
  737. don't have the same amount of work, and a 640x480 picture can only be split
  738. into 480 working packages.
  739.  
  740. 2.)  Antialiasing is hard to use.  Normally antialising uses the information
  741. of the lines calculated before on a single processor machine.  On a network of
  742. processors you don't have that information (or you will need a lot of
  743. communication).  To do antialiasing for the worst case you have to calculate
  744. the scanline before you and the scanline which follows you on each processor.
  745. This will raise your work amount by 3 times!
  746.  
  747.  
  748. >Method #2 might get around this problem, and reduce network
  749. >traffic; however, the problem arises that some areas of the
  750. >picture are more complex than others, so while some machines
  751. >are already done their trace and sitting idle, other machines
  752. >are still grinding away.
  753.  
  754. Not bad if you use square regions like 8x8 or 16x16 pixels with dynamic
  755. workloading.  At startup every processor requests one block of pixels to work
  756. on.  When he is done he will send his result back to the loadbalancing process
  757. and get a new pixel block package to work on.  This gives you a good
  758. loadbalancing of the net and only introduces a small amount of overhead when
  759. using antialising.  For antialiasing of 16x16 blocks you have an overhead of
  760. about only 1/3 and not 3 times.  If you make the areas bigger this will make
  761. your overhead smaller but reduce the amount of packages.  To get a good
  762. distribution of work you will need 20-30 packages per processor.
  763.  
  764.  
  765. >It would be nice if I had a basic rendering function that I
  766. >could pass a list of objects and a scanline #, and have it
  767. >generate the scanline.  Then I could concentrate on the task
  768. >of splitting up the job.
  769. >
  770. >Perhaps another aspect is a shared data file which all the tracers
  771. >access, maybe this would speed up the algorithm.  I don't know.
  772.  
  773. All this is based on my implementation of POVRay 1.0 (soon POVRay2.0) and
  774. Rayshade 4.06 onto a transputer workstation with up to 129 workers.  The
  775. architecture is able to work with up to 526 workers.
  776.  
  777. -------------------------------------------------------------------------------
  778.  
  779. Notes on Parallel Ray Tracing, by Hsiu Lin (hlin@wsuaix.csc.wsu.edu) and
  780.     Sam Uselton (uselton@nas.nasa.gov)
  781.  
  782. [From the massively parallel rendering mailing list.  There were many comments
  783. about these questions, I chose Sam's as a good, broad response, and also show
  784. Lin's responses to that.  Subscribe to the mailing list by writing
  785. mp-render-request@icase.edu.  -EAH]
  786.  
  787. Hsiu Lin writes:
  788. >>1. Are there still many groups or people interested or
  789. >>   doing research on parallel raytracing?
  790.  
  791. Sam Uselton responds:
  792. >Ray tracing is "embarrassingly parallel," in fact, I believe the first
  793. >time I read the term (in an article by Gordon Bell) ray tracing was
  794. >used as the example to explain the concept.  "Embarrassingly parallel"
  795. >applications are excluded from the Gordon Bell Award.
  796.  
  797. Lin replies:
  798.  
  799. Yes, it is a embarrassingly parallel problem.  But, since pixel computations
  800. might vary significantly in all screen pixels, it will result in poor results
  801. without careful scheduling.  In parallel computing literature, you also can
  802. find lots of paper talking about how to schedule this kind embarrassed
  803. paralleling problem (even though their problem is not ray tracing).  Check
  804. IEEE Transactions on Computer, Dec. 1987 "guided self-scheduling" or "a
  805. practical and robust method for scheduling parallel loops" in Comm. of ACM,
  806. Aug. 1992.
  807.  
  808. >Basically, if each pixel (or set of pixels) is computed by a single
  809. >process (that is, no single pixel receives contributions computed
  810. >by several processes) then there are no synchronization problems
  811. >and no data dependency problems.
  812.  
  813. Yes, no data dependency.  But, as for synchronization, it depends on the
  814. algorithm implemented.  For a simple example, we can use master/slave model to
  815. parallelize ray tracing.  Each slave requests a job from the master if it
  816. needs one.  If the system is small, it works fine.  But, if we talking about
  817. 200 or even 1024 slave nodes, the story is different.  The large
  818. synchronization overhead occurring in the master node will degrade the
  819. performance.
  820.  
  821. >Therefore, simply porting a ray tracer to a parallel machine is not
  822. >very interesting as a research project.  Research must involve some
  823. >unobvious cleverness to exploit the parallel architecture.
  824.  
  825. I can not completely agree with this point.  How you can achieve a scalable
  826. and load balanced parallel raytracer (if we talking about big problem)?  For
  827. example, millions of polygons are raytraced on a parallel machine.
  828.  
  829. >>2. Is parallel raytracing too simple or trivial?
  830.  
  831. >See above.
  832.  
  833. >>3. Is parallel raytracing research dead?
  834.  
  835. >Not entirely, but it has been worked enough that good ideas are
  836. >becoming harder to find.
  837.  
  838. >> 4. Many previous work used SPD to test parallel raytracing.
  839. >> Is it fair? Although an SPD database (such as balls, tree, mountain etc.)
  840. >> can be complicated enough, most objects appear uniformly
  841. >> in the scenes. I doubt if it will make the tested scene itself easy to
  842. >> be load balanced. And thus it is very easy to use many different
  843. >> schemes to get very good speedup. Why don't we view these scenes in
  844. >> different ways? It might result in more difficult scene to be load
  845. >> balanced.
  846.  
  847. >SPD is a start, but a wider variety of scenes would seem to me to
  848. >provide more info.  But designing good test scenes requires much
  849. >time and effort for little reward.
  850.  
  851. I don't mean SPD is not good.  Actually, I enjoy using it very much.  I just
  852. mean we need to adjust the viewpoint to keep the objects appear in different
  853. locations of the screen (i.e.  more different pixel computation distributions
  854. on the screen) to test the effectiveness of parallel ray tracing.  Otherwise,
  855. it is very easy, just like you think, to parallelize raytracing a
  856. self-balanced scene using different schemes.
  857.  
  858. [this parallels some of my comments to Erik Jansen. -EAH]
  859.  
  860.  
  861. >>5. People said now most interesting problem in parallel raytracing
  862. >>   is how to partition database and distribute database.(if
  863. >>   database is too large to duplicate at each node.)
  864. >>   Since we raytrace huge database, it should need huge cpu time
  865. >>   to finish. When we compare this cpu time with remote data access
  866. >>   time(when database is distributed), maybe the data access time
  867. >>   is relative small. I doubt if this issue will become the same
  868. >>   as we only consider all nodes has all duplicated database.
  869.  
  870. >If the database is replicated, or if you are using a shared memory
  871. >machine, then you should get linear speed up as you add processors.
  872. >If you aren't, you should instrument your system and find the
  873. >bottleneck(s).  Look at the papers in the Parallel Rendering
  874. >Symposium and you will see that distributing too small a chunk of
  875. >work is inefficient, but that for reasonably sized tasks,
  876. >communication time can easily dominate compute time, when the data
  877. >must be distributed.  Distribution among workstations on an ethernet
  878. >is fine to reduce runs that require days to runs that require hours,
  879. >but you can never get interactivity that way.
  880.  
  881.  
  882. >> 6. Besides loadbalancing and data partition, are there any other
  883. >> important issues? I have one. How to predict your good speedup
  884. >> will drop as the number of processors increase.
  885.  
  886. >This issue is very architecture and implementation dependent.  If
  887. >you are doing a good job of data partitioning and load balancing,
  888. >that WILL mostly minimize the loss of efficiency.
  889.  
  890. Yes, I believe you are right.  But, to design a good parallel raytracer, we
  891. can not ignore the architecture issue (particularly when we are talking
  892. parallel computing).  So, how can you easily do a good job on both above
  893. issues?
  894.  
  895. Well!  How about parallel volume rendering using ray casting?  In my opinion,
  896. volume rendering uses more regular data and regular computation than ray
  897. tracing.  Do you agree?  If so, do you also think parallel volume rendering is
  898. much easier than parallel raytracing?
  899.  
  900. ----
  901.  
  902. To Lin's comments, Uselton responds:
  903.  
  904. I didn't mean to indicate that I thought that all issues around parallelizing
  905. ray tracing were solved.  What I want to emphasize is that, if I'm on a
  906. conference program committee, and I see a paper whose total content is
  907. essentially:
  908.  
  909.     "I parallelised my ray tracer and got near linear speed up on machine
  910.     x," and maybe some words about whether it is SIMD or message passing,
  911.     tightly coupled or network connected machines, etc,
  912.  
  913. I'm not very interested in the paper.
  914.  
  915. If it includes something about how load balancing and/or distribution and
  916. access of very large data bases then it has a better chance.  But what I'm
  917. really interested in at this point is work that performs some detailed
  918. measurements and varies some parameters to get data on how performance varies
  919. in response to the parameters.  And it would be even better if there is some
  920. cogent analysis as to why this connection should be true.
  921.  
  922. As I argued in a paper given before a small conference about 8 or 10 years
  923. ago, the question is NOT "can ray tracing be parallelized?" but rather "which
  924. of the myriad possible ways (that will ALL work to some extent) is the best,
  925. and under what particular circumstances is this true?"
  926.  
  927.  
  928. I think much of the ray casting volume rendering work is directly applicable
  929. to ray tracing as well.  I think more research institutions are pursuing
  930. volume rendering because its applications make it more fundable.  Let me point
  931. again (but more specifically) to David Ellsworth's paper in the Parallel
  932. Rendering Symposium.  It is not about ray tracing, but it is exactly the kind
  933. of analysis that could be done for ray tracing (and many other parallel
  934. applications).
  935.  
  936. I hope this clarifies my position (and restores my credentials as a ray
  937. tracing enthusiast - parallel and otherwise).
  938.  
  939. -------------------------------------------------------------------------------
  940.  
  941. Parallel Texturing, by Jon Leech (leech@cs.unc.edu) and Brian Corrie
  942.     (Brian.Corrie@cs.anu.edu.au)
  943.  
  944. Jon Leech writes:
  945. >    We're implementing procedural shading models (ala RenderMan) to run on
  946. >the SIMD rasterizer/shader arrays in Pixel-Flow, the next generation of
  947. >graphics system being built here. The SIMD processors are coupled to a
  948. >heavily interleaved memory for fast image texturing with trilinear
  949. >interpolation.
  950. >
  951. >    I'd say one of the main problems is how to make efficient use of the
  952. >SIMD processors by scheduling identical operations in different shaders
  953. >(being applied at disjoint pixels) to execute at the same time. This is
  954. >important when using lots of shaders in the same image.
  955.  
  956. We have done the same thing for our parallel volumetric/geometric renderer for
  957. the Fujitsu AP1000.  That is, we have implemented an extended RenderMan-like
  958. shading language for procedural texturing.  The extension encompasses
  959. procedural shading of a volume data set.  To do this, we have created a new
  960. class of shader (called a _data shader_) that determines the shading and
  961. attenuation applied at a sample point within the volume.  The shader is
  962. invoked at each sample point.
  963.  
  964. Our implementation of the shading language gives us procedural shading of
  965. surface primitives as well.  With respect to the parallel issues of our
  966. technique, I can safely say that we have addressed approximately 0% of them
  967. 8-).  The data shaders were implemented as research into volume rendering
  968. techniques, not parallel rendering.  It just so happens that we have
  969. implemented the technique on our AP1000 as well.  Whether we go further with
  970. this research with respect to parallelism is unclear at this time.
  971.  
  972. If you are interested in more information on this work, see our paper entitled
  973. ``Data Shaders'' in the Proceedings of Visualization '93, San Jose,
  974. California, October 1993.
  975.  
  976. You can also check out our tech report ``Data Shader Language and Interface
  977. Specification'', Technical Report TR-CS-93-02, Department of Computer Science,
  978. Australian National University.  It is available for anonymous ftp from
  979. dcssoft.anu.edu.au in the directory pub/techreports/tr-cs-93-02/report.ps.Z
  980.  
  981. And if you are really keen, or just curious about the ANU ParVis Visualization
  982. Project, you can access an ftp based www server (with NCSA mosaic for example)
  983. on the CAP research project, including the ParVis Visualization Project, at
  984. the URL file://dcssoft.anu.edu.au/pub/www/dcs/cap/cap_research.html Info on
  985. the ParVis project can be found by following the ``ParVis Visualization
  986. Project'' link at the bottom of this document.
  987.  
  988. -------------------------------------------------------------------------------
  989.  
  990. Mapping Texture on a Sphere, by Ron Capelli (capelli@vnet.IBM.COM)
  991.  
  992. D.J.James writes:
  993. >I haven't had much success trying to wrap a texture around the sphere.  My
  994. >first approach using atan2() produces huge distortions at multiples of 90
  995. >degrees longitude.  I tried using spherical map projection equations using
  996. >asin() and acos() without any luck.  The best shot I had using an equation
  997. >from a gl reference book produced a beautiful image on the front of the
  998. >sphere but the rear kind of swirled into a black hole.
  999. >
  1000. >  Can someone give me a clue as to how to wrap an image around a sphere?
  1001.  
  1002. "You can't comb the hair on a billiard ball."
  1003. I may be mis-remembering the above quote slightly, and can't find the
  1004. original source, but it refers to the problem of oriented mappings
  1005. on a sphere.
  1006.  
  1007. Anyway, there was a paper presented at SIGGRAPH '93 that addresses the problem
  1008. of minimizing texture mapping distortion:
  1009.  
  1010.    Maillot, Yahia, and Verroust, "Interactive Texture Mapping",
  1011.    ACM/SIGGRAPH Computer Graphics Annual Conference Series,
  1012.    Proceedings of SIGGRAPH 93 (Anaheim, CA, Aug.1-6, 1993), pp.27-34.
  1013.  
  1014. The problem was treated as a global energy minimization problem, where energy
  1015. was related to elastic deformation of the texture map.
  1016.  
  1017. Other very good papers addressing the problem in different ways are:
  1018.  
  1019.    Bennis, Vezien, and Iglesias,
  1020.    "Piecewise Surface Flattening for Non-Distorted Texture Mapping",
  1021.    ACM/SIGGRAPH Computer Graphics, Vol.25, No.4, July 1991,
  1022.    Proceedings of SIGGRAPH 91 (Las Vegas, NV, July 28 - Aug. 2, 1991),
  1023.    pp.237-246.
  1024.  
  1025.    Bier and Sloan, "Two-part texture mapping",
  1026.    IEEE CG&A, Vol. 6, Sept. 1986, pp.40-53.
  1027.  
  1028. -------------------------------------------------------------------------------
  1029.  
  1030. Computational Geometry in C, by Joseph O'Rourke (orourke@sophia.smith.edu)
  1031.  
  1032. [This looks like an interesting book; I've ordered a copy and hope to review
  1033. it in the future. -EAH]
  1034.  
  1035.   author =      "Joseph O'Rourke"
  1036.   title =       "Computational Geometry in {C}"
  1037.   publisher =   "Cambridge University Press"
  1038.   year =        1993
  1039.   note =        "In stock on 28 January 1994.
  1040.         ISBN 0-521-44592-2/Pb \$24.95,
  1041.         ISBN 0-521-44034-3/Hc \$49.95.
  1042.         Cambridge University Press,
  1043.         40 West 20th Street,
  1044.         New York, NY 10011-4211.
  1045.         1-800-872-7423."
  1046.   note =    "346+xi pages, 228 exercises, 200 figures, 219 references"
  1047.   comments =    "Chapter titles:
  1048.         1. Polygon triangulation
  1049.         2. Polygon partitioning
  1050.         3. Convex hulls in two dimensions
  1051.         4. Convex hulls in three dimensions
  1052.         5. Voronoi diagrams
  1053.         6. Arrangements
  1054.         7. Search and intersection
  1055.         8. Motion planning
  1056.         9. Additional topics"
  1057.   annote =      "Textbook"
  1058.  
  1059. -------------------------------------------------------------------------------
  1060.  
  1061. Programming for Graphics Files in C and C++, by John R Levine
  1062.     (johnl@chico.iecc.com)
  1063.  
  1064. John Levine, Programming for Graphics Files in C and C++, John Wiley, ISBN
  1065. 0-471-59856-9 (with disk), ISBN 0-471-59854-2 (no disk).  $29.95 without disk,
  1066. $49.95 with disk.
  1067.  
  1068. The book discusses programs that read and write graphics files in a variety of
  1069. formats.  The book is about 60% C and C++ code, much based on the well-known
  1070. PBMPLUS library, the Leffler TIFF library, and the Independent JPEG group's
  1071. JPEG software.  (The disk has the full source of all three, the book is just
  1072. the most interesting parts, since otherwise it would have been about 2000
  1073. pages long.)  There is also new code for C++ image memory management in
  1074. limited memory environments like DOS, and some new file management code to
  1075. read formats not handled by PBM such as HP-GL files and Windows BMP.  As far
  1076. as I am concerned, all of the code is freely redistributable.
  1077.  
  1078. After discussing general principles of graphics file wrangling, the book
  1079. exhibits and explains the code to read and write 13 formats.
  1080.  
  1081. It's available at bookstores, or direct from Wiley at 1-800-879-4539.
  1082.  
  1083. -------------------------------------------------------------------------------
  1084.  
  1085. Point in Polygon, the Quick Answer, by Wm. Randolph Franklin and Eric Haines
  1086.  
  1087. Wm.  Randolph Franklin (wrf@ecse.rpi.edu) posted a nine line algorithm for the
  1088. classic question "How do I detect if a point is inside a polygon?"  I made a
  1089. few minor speed hacks, got rid of a little code, and made it shoot a ray along
  1090. X+ (which I'm used to), but it's mostly his.  Since we've beaten this one to
  1091. death in these pages, I thought I'd give his nice short (though a tad dense -
  1092. it's mostly just one big if statement) answer (8 lines).  Here 'tis:
  1093.  
  1094.    int pnpoly(int npol, float *xp, float *yp, float x, float y)
  1095.    {   int     i, j, c = 0;
  1096.        for (i = 0, j = npol-1; i < npol; j = i++) {
  1097.        if ((((yp[i]<=y) && (y<yp[j])) || ((yp[j]<=y) && (y<yp[i]))) &&
  1098.         (x < (xp[j] - xp[i]) * (y - yp[i]) / (yp[j] - yp[i]) + xp[i]))
  1099.           c = !c;     }
  1100.        return c;  }
  1101.  
  1102. Running it in my pt-in-poly testbed I found this routine to be about 20%
  1103. slower than my optimized crossings test (in the upcoming Graphics Gems IV).
  1104.  
  1105. -------------------------------------------------------------------------------
  1106.  
  1107. Elib and NetNews Information, by Eric Haines
  1108.  
  1109. There is an interesting pair of resources I just found out about from "Wired"
  1110. magazine.  By writing <elib@DB.Stanford.EDU> and <netnews@db.stanford.edu> and
  1111. sending the message "help" (no subject) to each, you can find out about them,
  1112. too.  Elib lets you search a computer science reference database at Stanford
  1113. for keywords.  It's not very extensive (dating back to 1991 at best), but the
  1114. response is immediate and the price is right (free).  For example, it turned
  1115. up this, which I hadn't heard of:
  1116.  
  1117.  Author    : Garland, M. J.
  1118.  Title     : Portable parallel ray tracing algorithms.
  1119.  Institute : Carnegie-Mellon University. Department of Computer Science.
  1120.  Report    : CMU-CS-93-176.
  1121.  Date      : 1993.
  1122.  Keyword   : Realistic rendering.
  1123.  Keyword   : Ray tracing.
  1124.  Keyword   : Parallel ray tracing.
  1125.  
  1126.  
  1127. NetNews is like Elib, but the server searches recent News on the net using
  1128. keywords.  You can also set searches on keywords so that it will daily (or at
  1129. whatever frequency you want) send you the first part of any messages that
  1130. match.  I do recommend that you set the threshold to 60, as the default is 50
  1131. (not 70, as it says in the documents).  At 50 and the keyword "ray tracing", I
  1132. was getting matches on rebuilding engines, how much LSD Jerry Garcia uses,
  1133. abortion discussions and all kinds of other random stuff - amusing for a few
  1134. days, but it wears thin.  Anyway, as an example, here's one that NetNews found
  1135. today that I would have never run across otherwise:
  1136.  
  1137.  
  1138. From: pjg@parint.esl.com (Paul Gyugyi)
  1139. Newsgroups: rec.toys.lego
  1140.  
  1141. dpenney@morgan.ucs.mun.ca (Dave Penney) writes:
  1142.  
  1143.    2a) If I was to design my own Lego set from Lego standard pieces, where
  1144.    would I be able to post this for others? (FTP, Pictures, or would LEGO be
  1145.    willing to take it?)
  1146.  
  1147.    2b) How (or which would be the easiest way) to transcribe this down onto
  1148.    paper?
  1149.  
  1150. There are a variety of CAD tools for lego on the earthsea archive, but nothing
  1151. that doesn't require some work.  If you can sketch down your instructions and
  1152. fax them to me, I'll pass them along to other CAD developers to use as a test
  1153. bed for adding new features to the programs.  In earthsea:/pub/lego/CAD, you
  1154. will find some Postscript tools, some ray tracing tools, and some parts
  1155. libraries for drafting programs.  But I've found isometric graph paper (with
  1156. 30 degree lines) is easiest to use, actually.  We've been working on a
  1157. standard input file format, something that you can type in ASCII and feed into
  1158. other programs.
  1159.  
  1160. Stefan and I are working on a front end to "Rayshade", a 3D raytracing
  1161. program.  If you are interested in describing your models in our format, or if
  1162. you are willing to sit down with a ruler and add descriptions of some lego
  1163. pieces to our parts library, it would be appreciated.
  1164.  
  1165. -------------------------------------------------------------------------------
  1166.  
  1167. CFP: 5th Eurographics Workshop on Rendering, by Georgios Sakas
  1168.  
  1169.              Darmstadt, Germany  13-15 June 1994
  1170.  
  1171. Aims and Scope:  Following four successful workshops (Rennes-1990,
  1172. Barcelona-1991, Bristol-1992, Paris-1993) we announce the fifth workshop on
  1173. rendering techniques.  In the recent years the workshop has been well
  1174. established as a major international forum in exchanging experience and
  1175. knowledge between people from universities, research and industry interested
  1176. in the different aspects of rendering techniques.
  1177.  
  1178. Main topics include (but are not restricted to):
  1179.    - Radiosity
  1180.    - Ray tracing
  1181.    - Illumination models
  1182.    - Colour, texture
  1183.    - Sampling, filtering, anti-aliasing
  1184.    - Parallel solutions for rendering
  1185.  
  1186. Two special themes of this workshop are:
  1187.    - Illumination & rendering of participating media (volume objects,
  1188.      clouds, ...)
  1189.    - Rendering of architectural & CAD models (illumination simulation,
  1190.      real-time rendering, walkthroughs, handling of large datasets, ...)
  1191.  
  1192. We encourage also papers describing on-going research and providing new
  1193. techniques, perspectives and applications in the field.  Discussions and
  1194. evaluation of current techniques and future trends greatly contribute to the
  1195. attractivity of the workshop.  Thus, the presentation of the papers to the
  1196. plenum will be followed by a discussion introduced by an expert of the field.
  1197. Internationally renowned speakers from research and industry will also present
  1198. invited papers.
  1199.  
  1200. Schedule: 5 April    1994  Submission deadline
  1201.       5 May      1994  Notification of acceptance for presentation
  1202.       30 May     1994  Full-paper deadline for the workshop proceedings
  1203.       13-15 June 1994  Workshop
  1204.  
  1205. For [the full posting,] detailed information, rendering databases, and authors
  1206. toolkit including latex styling formats contact haas@igd.fhg.de,
  1207. gsakas@igd.fhg.de or shirley@cs.indiana.edu
  1208.  
  1209. -------------------------------------------------------------------------------
  1210.  
  1211. CFP: 5th EG workshop on Animation & Simulation, by Gerard Hegron
  1212.     (hegron@irisa.fr)
  1213.  
  1214.             September 17-18, 1994
  1215.  
  1216.             Oslo, Norway
  1217.  
  1218. AIMS AND SCOPE:
  1219.  
  1220. The Eurographics workshop on Animation and Simulation has become
  1221. an international forum of high quality for exchanging experience
  1222. and knowledge between people representing the animation and simulation
  1223. communities on the general themes of modeling, animation, motion control,
  1224. simulation and visualization of dynamic scenes.
  1225.  
  1226. SCHEDULE:
  1227.  
  1228. May  1          : deadline for extended abstract
  1229.  
  1230. June 1          : notification of acceptance for the workshop
  1231.  
  1232. July 15         : full papers
  1233.  
  1234. September 17-18 : workshop
  1235.  
  1236. Write Gerard or Olov Fahlander (olov-f@isy.liu.se) for the full posting.
  1237.  
  1238. -------------------------------------------------------------------------------
  1239.  
  1240. Morphology Digest, by Henk Heijmans (henkh@cwi.nl)
  1241.  
  1242. Some time ago we announced the "Morphology Digest", an electronic newsletter
  1243. for workers in the field of mathematical morphology, stochastic geometry,
  1244. random set theory, image algebra, etc.  It provides fast and up-to-date
  1245. information on:
  1246.  
  1247.   1. Conferences, workshops, courses
  1248.   2. Books, articles, reports, PhD theses
  1249.   3. Algorithms, software, hardware
  1250.   4. Available research positions
  1251.   5. Bibliographical data
  1252.  
  1253. relevant to anyone interested in mathematical morphology.
  1254.  
  1255. The digest appears every six weeks and has approximately 500 subscribers.
  1256.  
  1257. Subscribe:  email to morpho@cwi.nl with "subscribe" as subject and empty
  1258.     message body.
  1259.  
  1260. Unsubscribe:  email to morpho@cwi.nl with "unsubscribe" followed by email
  1261.     address as subject and empty message body.
  1262.  
  1263. Submissions:  email to morpho@cwi.nl with "submit" as subject.
  1264.  
  1265. Archive site:  anonymous ftp to ftp.cwi.nl [192.16.184.180]; directory
  1266.     /pub/morphology/digest
  1267.  
  1268. [This digest is not about morphing, it is much more oriented to image
  1269. processing, object recognition, texture classification, etc.  It's a pretty
  1270. serious (and useful) journal, if this area interests you. -EAH]
  1271.  
  1272. -------------------------------------------------------------------------------
  1273.  
  1274. Position of the Sun, by Joe Cychosz (3ksnn64@ecn.purdue.edu)
  1275.  
  1276. I didn't try to analyze [James Ashton's] code [in RTNv6n3 for sun position].
  1277. But, I assume it's a quick hack.  It doesn't consider latitude, for one thing.
  1278. I didn't check his time equations, but there is nothing to correct for
  1279. timezone.  Maybe he's working with GMT all the time and what is this floating
  1280. point month stuff?  The lengths of the months varies from month to month.
  1281.  
  1282. The following code computes the direction to the sun, give location on the
  1283. earth (lon, lat) and the time.  A correction angle (gamma) can be specified so
  1284. the sweep of the sun can be aligned with the world coordinate system.  Thus
  1285. the structure can be nicely modeled along the coordinate system.  Some years
  1286. ago I did a short film of an energy efficient house build here at Purdue.  One
  1287. of the key pieces of technology was the design of the overhangs over the
  1288. windows which were designed to keep the sun out in the summer and let it in in
  1289. the winter.  The film demonstrated the effects of the overhangs on the
  1290. penetration of sun into the house at various times of the year.
  1291.  
  1292. Hopefully the code has sufficient documentation to enable one to use.  This
  1293. code has only been tested in the northern hemisphere.  A quick note about the
  1294. coordinate system:  y is up, x is right, z is out.
  1295.  
  1296. Joe Cychosz
  1297.  
  1298. #include    <math.h>
  1299. #include    "GraphicsGems.h"
  1300.  
  1301. #define pi    3.14159265358979323846264338
  1302. #define    rad2deg    (180./pi)
  1303. #define    deg2rad    (pi/180.)
  1304.  
  1305. /* ----    trigd.h - Degree based trig functions. ------------------------    */
  1306.  
  1307. #define    cosd(t)        (cos ( 0.01745329251994 * (t) ))
  1308. #define    sind(t)        (sin ( 0.01745329251994 * (t) ))
  1309. #define    tand(t)        (tan ( 0.01745329251994 * (t) ))
  1310.  
  1311. /* ----    sunpos - Compute the position of the sun. ---------------------    */
  1312. /*                                    */
  1313. /*                                    */
  1314. /*    Description:                            */
  1315. /*        Sunpos computes the position of the sun given the location    */
  1316. /*        (longitude and latitude) on the earth, the day of the year,    */
  1317. /*        and the time.  The origin (i.e. 0,0,0 in world space) is    */
  1318. /*        the specified location on the earth.  With an orientation    */
  1319. /*        angle of 0, east = -z, west = +z, south = +x, north = -x.    */
  1320. /*                                    */
  1321. /*    On entry:                            */
  1322. /*        lon, lat= The longitude and latitude in degrees of the    */
  1323. /*              location of the origin on the earth.        */
  1324. /*              (i.e., West Lafayette, Indiana = 89-40)        */
  1325. /*        lontz   = The longitude for the time zone in degrees.    */
  1326. /*              Each time zone is 15 degrees, advancing to the    */
  1327. /*              west.  For daylight savings, the longitude is    */
  1328. /*              advanced 1 timezone to the east.            */
  1329. /*              (i.e., 75 for EST, 90 for CST, 75 for CDT)    */
  1330. /*        time    = The time of the day in hours.            */
  1331. /*              (i.e., 13.5 = 1:30 pm)                */
  1332. /*        day     = The day of the year.                */
  1333. /*              (i.e., 172 for June 21st)                */
  1334. /*        gamma   = Orientation angle defining south, rotating the    */
  1335. /*              sweep of the sun.                    */
  1336. /*              (i.e, 14 = 14 degrees east of south)        */
  1337. /*                                    */
  1338. /*    On return:                            */
  1339. /*        pos     = Direction cosines of a vector pointing toward    */
  1340. /*              the sun from the origin.                */
  1341. /*                                    */
  1342. /*    Returns:  True if the sun is visible.                */
  1343. /*                                    */
  1344. /*    Author:      Joe Cychosz                        */
  1345. /*          Purdue University CADLAB                */
  1346. /*          Potter Engineering Center                */
  1347. /*          W. Lafayette, IN  47907                */
  1348. /*                                    */
  1349. /* --------------------------------------------------------------------    */
  1350.  
  1351.  
  1352. boolean    sunpos        ( lon, lat, lontz, time, day, gamma, pos)
  1353.  
  1354.     double        lon, lat;    /* Longitude, latitude        */
  1355.     double        lontz;        /* Longitude for timezone    */
  1356.     double        time;        /* Time of day            */
  1357.     int        day;        /* Day of the year        */
  1358.     double        gamma;        /* Orientation angle        */
  1359.     Vector3        *pos;        /* Position vector of sun    */
  1360.  
  1361. {            /* Angles are in degrees, times are in hours.    */
  1362.     double        del;        /* Angle of declination        */
  1363.     double        b;        /* Time angle            */
  1364.     double        e;        /* Time                */
  1365.     double        w;        /* Hour angle            */
  1366.     double        we, gs;
  1367.     double        phi;
  1368.     double        ws;        /* Sunrise, sunset angle    */
  1369.     double        sunrise;    /* Sunrise time            */
  1370.     double        sunset;        /* Sunset time            */
  1371.  
  1372. /*    Compute solar declination (23.45 deg on June 21)        */
  1373.     del = 23.45 * sind (360.0 * (284+day) / 365);
  1374.  
  1375. /*    Compute the hour angle in degrees.                */
  1376. /*                                    */
  1377. /*    w = 0 at solar noon, => 180 at midnight, + for am, - for pm.    */
  1378. /*    1 hour = 15 degrees, w = 22.5 at 10:30 am (solar)        */
  1379.     b   = 360.0 * (day-81) / 364;
  1380.     e   = (9.87*sind(2.0*b) - 7.53*cosd(b) - 1.5*sind(b)) / 60.;
  1381.     w   = 180.0 - lontz + lon - 15.0*(time+e);
  1382.  
  1383.     phi = acos (sind(lat)*sind(del) + cosd(lat)*cosd(del)*cosd(w));
  1384.     we  = acos (tand(del) / tand(lat)) * rad2deg;
  1385.     gs  = asin (cosd(del) * sind(w) / sin(phi));
  1386.     if  ( w >  we ) gs =  pi - gs;
  1387.     if  ( w < -we ) gs = -pi - gs;
  1388.  
  1389. /*    Compute the position of the sun.                */
  1390. /*                                    */
  1391. /*    For gamma = 0, the sun will rise at -z and set at +z.         */
  1392.     pos->x =   cos (gs + gamma*deg2rad);
  1393.     pos->y =   cos (phi);
  1394.     pos->z = - sin (gs - gamma*deg2rad);
  1395.  
  1396. /*    Compute sunrise, sunset angle.                    */
  1397.     ws = rad2deg * acos (-tand(lat) * tand(del));
  1398.  
  1399. /*    Compute sunrise time and sunset time.                 */
  1400.     sunrise = (180.0 - ws - lontz + lon) / 15.0 - e;
  1401.     sunset  = (180.0 + ws - lontz + lon) / 15.0 - e;
  1402.  
  1403.     printf (" sunpos: sun position: %f %f %f\n", pos->x, pos->y, pos->z);
  1404.     printf (" sunpos: sunrise time: %f\n", sunrise);
  1405.     printf (" sunpos: sunset  time: %f\n", sunset);
  1406.  
  1407.     return (time >= sunrise && time <= sunset);
  1408. }
  1409.  
  1410. -------------------------------------------------------------------------------
  1411. END OF RTNEWS
  1412.