home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 16 / CD_ASCQ_16_0994.iso / news / 2555 / povhlp / arealgt.hlp < prev    next >
Encoding:
Text File  |  1994-07-04  |  7.0 KB  |  137 lines

  1.     Regular light sources in POV-Ray are modeled as point light sources, that
  2.  is they emit light from a single point in space.  Because of this the sha-
  3.  dows created by these lights have the characteristic sharp edges that most
  4.  of us are use to seeing in ray traced images.  The reason for the distinct
  5.  edges is that a point light source is either fully in view or it is fully
  6.  blocked by an object.  A point source can never be partially blocked.
  7.  
  8.     Area lights on the other hand occupy a finite area of space.  Since it is
  9.  possible for an area light to be partially blocked by an object the shadows
  10.  created will have soft or 'fuzzy' edges.  The softness of the edge is depen-
  11.  dent on the dimensions of the light source and it's distance from the object
  12.  casting the shadow.
  13.  
  14.     The area lights used in POV-Ray are rectangular in shape, sort of like a
  15.  flat panel light.  Rather than performing the complex calculations that
  16.  would be required to model a true area light, POV-Ray approximates an area
  17.  light as an array of 'point' light sources spread out over the area occupied
  18.  by the light.  The intensity of each individual point light in the array is
  19.  dimmed so that the total amount of light emitted by the light is equal to
  20.  the light color specified in the declaration.
  21.  
  22.     Syntax:
  23.        light_source {
  24.           <X, Y, Z>
  25.           color red # green # blue #
  26.           area_light
  27.           <X1, Y1, Z1>, <X2, Y2, Z2>, N1, N2
  28.           adaptive #
  29.           jitter
  30.           [optional spotlight parameters]
  31.        }
  32.  
  33.     The light's location and color are specified in the same way as a regular
  34.  light source.
  35.  
  36.     The area_light command defines the size and orientation of the area light
  37.  as well as the number of lights in the light source array.  The vectors <X1,
  38.  Y1, Z1> and <X2, Y2, Z2> specify the lengths and directions of the edges of
  39.  the light.  Since the area lights are rectangular in shape these vectors
  40.  should be perpendicular to each other.  The larger the size of the light the
  41.  thicker that the soft part of the shadow will be.  The numbers N1 and N2
  42.  specify the dimensions of the array of point lights.  The larger the number
  43.  of lights you use the smoother your shadows will be but the longer they will
  44.  take to render.
  45.  
  46.     The adaptive command is used to enable adaptive sampling of the light
  47.  source.  By default POV-Ray calculates the amount of light that reaches a
  48.  surface from an area light by shooting a test ray at every point light with-
  49.  in the array.  As you can imagine this is VERY slow.  Adaptive sampling on
  50.  the other hand attempts to approximate the same calculation by using a mini-
  51.  mum number of test rays.  The number specified after the keyword controls
  52.  how much adaptive sampling is used.  The higher the number the more accurate
  53.  your shadows will be but the longer they will take to render.  If you're not
  54.  sure what value to use a good starting point is 'adaptive 1'.  The adaptive
  55.  command only accepts integer values and cannot be set lower than 0.  Adap-
  56.  tive sampling is explained in more detail later.
  57.  
  58.     The jitter command is optional.  When used it causes the positions of
  59.  the point lights in the array to be randomly jittered to eliminate any sha-
  60.  dow banding that may occur.  The jittering is completely random from render
  61.  to render and should not be used when generating animations.
  62.  
  63.     NOTE: It's possible to specify spotlight parameters along with area_light
  64.  parameters to create 'area spotlights.' Using area spotlights is a good way
  65.  to speed up scenes that use area lights since you can confine the lengthy
  66.  soft shadow calculations to only the parts of your scene that need them.
  67.  For example:
  68.        light_source {
  69.           <0, 50, 0>
  70.           color White
  71.           area_light
  72.           <5, 0, 0>, <0, 0, 10>, 5, 5
  73.           adaptive 1
  74.           jitter
  75.        }
  76.  
  77.     This defines an area light that extends 5 units along the x axis and 10
  78.  units along the z axis and is centered at the location <0,50,0>.  The light
  79.  consists of a 5 by 5 jittered array of point sources for a total of 25 point
  80.  lights.  A minimum of 9 shadow rays will be used each time this light is
  81.  tested.
  82.                     / * * * * *
  83.                   / * * * * *         Y
  84.        <0,0,10> / * * * * *            |    Z
  85.               / * * * * *              |  /
  86.             / * * * * *                |/
  87.            +----------->               +------X
  88.                <5,0,0>
  89.  
  90.     An interesting effect that can be created using area lights is a linear
  91.  light.  Rather than having a rectangular shape, a linear light stretches
  92.  along a line sort of like a thin fluorescent tube.  To create a linear light
  93.  just create an area light with one of the array dimensions set to 1.  For
  94.  example:
  95.        light_source {
  96.           <0, 50, 0>
  97.           color White
  98.           area_light
  99.           <40, 0, 0>, <0, 0, 1>, 100, 1
  100.           adaptive 4
  101.           jitter
  102.        }
  103.  
  104.     This defines a linear light that extends from <-40/2, 50, 0> to <+40/2,
  105.  50, 0> and consists of 100 point sources along it's length.  The vector <0,
  106.  0, 1> is ignored in this case since a linear light has no width.
  107.  
  108.     NOTE: If the linear light is fairly long you'll usually need to set the
  109.  adaptive parameter fairly high as in the above example.
  110.  
  111.     When performing adaptive sampling POV-Ray starts by shooting a test ray
  112.  at each of the four corners of the area light.  If the amount of light re-
  113.  ceived from all four corners is approximately the same then the area light
  114.  is assumed to be either fully in view or fully blocked.  The light intensity
  115.  is then calculated as the average intensity of the light received from the
  116.  four corners.  However, if the light intensity from the four corners differs
  117.  significantly then the area light is partially blocked.  The light is the
  118.  split into four quarters and each section is sampled as described above.
  119.  This allows POV-Ray to rapidly approximate how much of the area light is in
  120.  view without having to shoot a test ray at every light in the array.
  121.  
  122.     While the adaptive sampling method is fast (relatively speaking) it can
  123.  sometimes produces inaccurate shadows.  The solution is to reduce the amount
  124.  of adaptive sampling without completely turning it off.  The number after
  125.  the adaptive keyword adjusts the number of times that the area light will be
  126.  split before the adaptive phase begins.  For example if you use 'adaptive 0'
  127.  a minimum of 4 rays will be shot at the light.  If you use 'adaptive 1' a
  128.  minimum of 9 rays will be shot (adaptive 2 = 25 rays, adaptive 3 = 81 rays,
  129.  etc).  Obviously the more shadow rays you shoot the slower the rendering
  130.  will be so you should use the lowest value that gives acceptable results.
  131.  
  132.     The number of rays never exceeds the values you specify for rows and co-
  133.  lumns of points.  For example: area_light x,y,4,4 specifies a 4 by 4 array
  134.  of lights.  If you specify adaptive 3 it would mean that you should start
  135.  with a 5 by 5 array.  In this case no adaptive sampling is done.  The 4 by 4
  136.  array is used.
  137.