home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / f / ftpov / Authors / POVAFX10 < prev    next >
Text File  |  1995-12-18  |  14KB  |  302 lines

  1.                                         ____
  2.                                        /   /   
  3.                    _________  ____    /   /   
  4.                   |         | \   \  /   /
  5.                   |   ,-----'  \   \/   /   
  6.                   |   |____     \      /   
  7.               POVA|        |     \    /   
  8.                   |   ,----'     /    \
  9.                   |   |         /      \
  10.                   |   |        /   /\   \
  11.                   |___|       /   /  \___\
  12.                              /   /    
  13.                             /   /   POVAFX v1.0 extensions 
  14.                            /   /   POV-Ray with Simple Atmospheric Effects 
  15.                           /   /    
  16.                          /   /   Marcos Fajardo 
  17.                         /   /   mfajardo@freenet.hut.fi 
  18.                        /   /   http://www.geopages.com/TimesSquare/2143 
  19.                       /___/    
  20.  
  21.  
  22.  
  23.  
  24. 0. INDEX
  25.  
  26.         0. INDEX
  27.         1. WHAT'S THIS?
  28.         2. WELL, WHAT ARE EXACTLY THOSE FX?
  29.         3. TRICKS AND TIPS
  30.         4. DISTRIBUTION SITES
  31.         5. MAKING BINARIES
  32.         6. CHANGES TO ORIGINAL POV-RAY 2.2 CODE
  33.         7. CONTACTING THE AUTHOR
  34.         8. REFERENCES
  35.  
  36.  
  37.  
  38. 1. WHAT'S THIS?
  39.  
  40.         POVAFX is a custom unofficial version of the POV-Ray ray tracer that 
  41.         is able to render some simple light-atmosphere interactions. This 
  42.         first release comes with two such effects, namely ground fog and 
  43.         glowing lights. A few new reserved words have been added to the 
  44.         parser in order to accomodate smoothly these extensions. Of course, 
  45.         being this just a little extension to POV-Ray 2.2 code, there aren't 
  46.         any compatibility problems with POV-Ray scenes. It will behave 
  47.         exactly as an official POV-Ray does, but with the added functionality 
  48.         of a couple of new switcheable features. 
  49.  
  50.         I've decided to make these simple but useful enhancements public,
  51.         since i know of a lot of people who would like them, and it's been 
  52.         very few work (it was already coded in my own realistic rendering 
  53.         engine, the only issue here was poking around with POV-Ray's code). 
  54.         People out there is very bored waiting for POV-Ray 3.0 to come; it's 
  55.         taking it slowly, so these little and simple goodies may be welcome 
  56.         by some of you. If POV-Ray 3.0 gets released inmediately after this 
  57.         POVAFX v1.0 release, most likely i'll have made an stupidity, since 
  58.         POVAFX v1.0 WILL UNDOUBTEDLY AND SOON BE FORGOTTEN. I'm a fool, i 
  59.         know... i should have made this 6 months ago, not now... it's just 
  60.         too late to complain about it. At least i've had fun hacking POV's 
  61.         code! :-) And if people out there shows some interest in POVAFX v1.0
  62.         i could add some more effects like foggy spotlights with fast volume 
  63.         shadows (Z-buffering from the lights...) or whatever they suggest.
  64.  
  65.  
  66.  
  67. 2. WELL, WHAT ARE EXACTLY THOSE FX?
  68.  
  69.         Ground fog
  70.  
  71.                 This is an enhancement to POV-Ray's uniform fog feature.
  72.                 Now fog density vanishes exponentially along the positive Y 
  73.                 axis, due to the factor exp(-y/height). At y=0 density is 
  74.                 100% its full value, at y=height it's 37%, at y=4*height it's 
  75.                 2% and finally it becomes 0% at y=infinite. Thus the fog 
  76.                 statement has been extended with a new keyword:
  77.  
  78.                         fog { color SkyBlue distance 200 height 50 }
  79.  
  80.                 If height is omitted, you get standard fog. Just remember 
  81.                 that 'distance' controls the fog strength and 'height'
  82.                 controls its decrease rate along Y axis. Please note that
  83.                 when using ground fog, there is no fog at all in the range
  84.                 y<0, so you'll see a discontinuity if your ground plane is
  85.                 below y=0.
  86.  
  87.         Glowing lights
  88.  
  89.                 Traditional point light sources are invisible by themselves,
  90.                 they serve just as illuminators of object surfaces. You 
  91.                 just can't see a point. That holds correct only in a clear 
  92.                 pristine atmosphere, otherwise every ray would transport some
  93.                 amount of scattered energy coming from the atmosphere itself
  94.                 in the ray direction. Rays passing near the light source 
  95.                 would gather more energy because light emanating from it is 
  96.                 attenuated by the distance. That's exactly the phenomenom
  97.                 that POVAFX inexactly models with its glowing lights. And
  98.                 what is the visible effect of this whole story? The answer
  99.                 is simple: point light sources become visible, surrounded by
  100.                 a subtle (or wild if you want) halo. This is managed via 
  101.                 three additional keywords pertaining to POV-Ray's point
  102.                 sources: glow, glow_type_a and glow_type_b. Example:
  103.  
  104.                         light_source { 
  105.                            <0, 5, 0> 
  106.                            color White 
  107.                            glow 0.2 
  108.                            glow_type_b 
  109.                         }
  110.  
  111.                 The glow parameter tells about the local fog density that
  112.                 will be used in the computations involving this light source,
  113.                 and it controls how strong the halo will be. It would have
  114.                 been more correct using the same fog density for all light
  115.                 sources, but this way allows more flexibility, and you can
  116.                 always use the same glow value for all of your lights. The
  117.                 glow type refers to the function used to attenuate light. 
  118.                 Type A uses 1/d^2, with 'd' being distance to the source,
  119.                 which has been the standard for atmospheric scattering due
  120.                 to point light sources in computer graphics because of the 
  121.                 simplicity of the integral involved (see [1] and [3]). Type 
  122.                 B, fruit of my own research, uses a similar but definitely 
  123.                 not the same function: 1/(d^2+1). As is not the case with 
  124.                 type A, halos of type B don't get always wildly saturated 
  125.                 in their center. Anyhow, both glow types are physically 
  126.                 inaccurate, because a more accurate model makes an analytical 
  127.                 solution very difficult to find (or impossible at all).
  128.                 Default model is A.
  129.  
  130.  
  131.  
  132. 3. TRICKS AND TIPS
  133.  
  134.              - Ground fog was implemented to be visible only in y>0, so the
  135.                usual way of using it is with a ground plane at y=0. If you
  136.                position the camera at y=0 you'll clearly see the 
  137.                discontinuity in the fog.
  138.  
  139.              - Try negative values in the light intensity like this:
  140.  
  141.                         light_source { 
  142.                            <1 2 3> 
  143.                            color red -0.3 green -0.3 blue -0.3
  144.                            glow 0.2
  145.                         }
  146.  
  147.                You've effectively created a black hole! or in other words,
  148.                a visible light sucker, a darkness source ... Glassner called
  149.                them darklights in Graphics Gems III. If you put positive
  150.                light but negative glow, the result is similar, since you
  151.                can see the source as an obscure spot, but objects will be
  152.                normally illuminated. Think of it, it's tons of fun.
  153.  
  154.              - Subtle ground fog (high distance, high height) always 
  155.                improves outdoor scenes, being a simple alternative for 
  156.                gradient textured sky spheres.
  157.  
  158.              - Use low values of glow to avoid excessive saturation near 
  159.                the lights, but feel free to turn it up when you want extreme
  160.                effects like explosions devouring cities and the like.
  161.                Remember that glow type B is less prone to saturation, and
  162.                that lights of type A a