home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / info / rtnews / rtnv7n2 < prev    next >
Encoding:
Text File  |  1994-10-16  |  64.1 KB  |  1,414 lines

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