home *** CD-ROM | disk | FTP | other *** search
- Regular light sources in POV-Ray are modeled as point light sources, that
- is they emit light from a single point in space. Because of this the sha-
- dows created by these lights have the characteristic sharp edges that most
- of us are use to seeing in ray traced images. The reason for the distinct
- edges is that a point light source is either fully in view or it is fully
- blocked by an object. A point source can never be partially blocked.
-
- Area lights on the other hand occupy a finite area of space. Since it is
- possible for an area light to be partially blocked by an object the shadows
- created will have soft or 'fuzzy' edges. The softness of the edge is depen-
- dent on the dimensions of the light source and it's distance from the object
- casting the shadow.
-
- The area lights used in POV-Ray are rectangular in shape, sort of like a
- flat panel light. Rather than performing the complex calculations that
- would be required to model a true area light, POV-Ray approximates an area
- light as an array of 'point' light sources spread out over the area occupied
- by the light. The intensity of each individual point light in the array is
- dimmed so that the total amount of light emitted by the light is equal to
- the light color specified in the declaration.
-
- Syntax:
- light_source {
- <X, Y, Z>
- color red # green # blue #
- area_light
- <X1, Y1, Z1>, <X2, Y2, Z2>, N1, N2
- adaptive #
- jitter
- [optional spotlight parameters]
- }
-
- The light's location and color are specified in the same way as a regular
- light source.
-
- The area_light command defines the size and orientation of the area light
- as well as the number of lights in the light source array. The vectors <X1,
- Y1, Z1> and <X2, Y2, Z2> specify the lengths and directions of the edges of
- the light. Since the area lights are rectangular in shape these vectors
- should be perpendicular to each other. The larger the size of the light the
- thicker that the soft part of the shadow will be. The numbers N1 and N2
- specify the dimensions of the array of point lights. The larger the number
- of lights you use the smoother your shadows will be but the longer they will
- take to render.
-
- The adaptive command is used to enable adaptive sampling of the light
- source. By default POV-Ray calculates the amount of light that reaches a
- surface from an area light by shooting a test ray at every point light with-
- in the array. As you can imagine this is VERY slow. Adaptive sampling on
- the other hand attempts to approximate the same calculation by using a mini-
- mum number of test rays. The number specified after the keyword controls
- how much adaptive sampling is used. The higher the number the more accurate
- your shadows will be but the longer they will take to render. If you're not
- sure what value to use a good starting point is 'adaptive 1'. The adaptive
- command only accepts integer values and cannot be set lower than 0. Adap-
- tive sampling is explained in more detail later.
-
- The jitter command is optional. When used it causes the positions of
- the point lights in the array to be randomly jittered to eliminate any sha-
- dow banding that may occur. The jittering is completely random from render
- to render and should not be used when generating animations.
-
- NOTE: It's possible to specify spotlight parameters along with area_light
- parameters to create 'area spotlights.' Using area spotlights is a good way
- to speed up scenes that use area lights since you can confine the lengthy
- soft shadow calculations to only the parts of your scene that need them.
- For example:
- light_source {
- <0, 50, 0>
- color White
- area_light
- <5, 0, 0>, <0, 0, 10>, 5, 5
- adaptive 1
- jitter
- }
-
- This defines an area light that extends 5 units along the x axis and 10
- units along the z axis and is centered at the location <0,50,0>. The light
- consists of a 5 by 5 jittered array of point sources for a total of 25 point
- lights. A minimum of 9 shadow rays will be used each time this light is
- tested.
- / * * * * *
- / * * * * * Y
- <0,0,10> / * * * * * | Z
- / * * * * * | /
- / * * * * * |/
- +-----------> +------X
- <5,0,0>
-
- An interesting effect that can be created using area lights is a linear
- light. Rather than having a rectangular shape, a linear light stretches
- along a line sort of like a thin fluorescent tube. To create a linear light
- just create an area light with one of the array dimensions set to 1. For
- example:
- light_source {
- <0, 50, 0>
- color White
- area_light
- <40, 0, 0>, <0, 0, 1>, 100, 1
- adaptive 4
- jitter
- }
-
- This defines a linear light that extends from <-40/2, 50, 0> to <+40/2,
- 50, 0> and consists of 100 point sources along it's length. The vector <0,
- 0, 1> is ignored in this case since a linear light has no width.
-
- NOTE: If the linear light is fairly long you'll usually need to set the
- adaptive parameter fairly high as in the above example.
-
- When performing adaptive sampling POV-Ray starts by shooting a test ray
- at each of the four corners of the area light. If the amount of light re-
- ceived from all four corners is approximately the same then the area light
- is assumed to be either fully in view or fully blocked. The light intensity
- is then calculated as the average intensity of the light received from the
- four corners. However, if the light intensity from the four corners differs
- significantly then the area light is partially blocked. The light is the
- split into four quarters and each section is sampled as described above.
- This allows POV-Ray to rapidly approximate how much of the area light is in
- view without having to shoot a test ray at every light in the array.
-
- While the adaptive sampling method is fast (relatively speaking) it can
- sometimes produces inaccurate shadows. The solution is to reduce the amount
- of adaptive sampling without completely turning it off. The number after
- the adaptive keyword adjusts the number of times that the area light will be
- split before the adaptive phase begins. For example if you use 'adaptive 0'
- a minimum of 4 rays will be shot at the light. If you use 'adaptive 1' a
- minimum of 9 rays will be shot (adaptive 2 = 25 rays, adaptive 3 = 81 rays,
- etc). Obviously the more shadow rays you shoot the slower the rendering
- will be so you should use the lowest value that gives acceptable results.
-
- The number of rays never exceeds the values you specify for rows and co-
- lumns of points. For example: area_light x,y,4,4 specifies a 4 by 4 array
- of lights. If you specify adaptive 3 it would mean that you should start
- with a 5 by 5 array. In this case no adaptive sampling is done. The 4 by 4
- array is used.
-