If you want to add a light source that does not interact with the atmosphere you can use the atmosphere keyword inside the light source statement (see "Atmosphere Interaction" ). Just add atmosphere off .
By default the light coming from any light source will not be diminished by the atmosphere. Thus the highlights in your scene will normally be too bright. This can be changed with atmospheric_attenuation on .
The Rayleigh scattering is used for small particles like dust and smoke while the Mie scattering is used for fog.
If you ever saw the lighthouse scene in the movie Casper you'll know what effect the scattering type has. In this scene the beam of light coming from the lighthouse becomes visible while it points nearly towards the viewer. As it starts to point away from the viewer it vanishes. This behaviour is typical for miniscule water droplets as modeled by the Mie scattering.
Even though this is not obvious this holds for infinite and patch objects like quadrics, quartics, triangles, polygons, etc. Whenever you add one of those objects you should add the hollow keyword as long as you are not absolutely sure you don't need it. You also have to make sure that all objects the camera is inside are set to be hollow.
Whenever you get unexpected results you should check for solid objects and set them to be hollow.
The size and shape of the rainbow are determined by the angle and width keywords. The direction keyword is used to set the direction of the incoming light, thus setting the rainbow's position. The rainbow is visible when the angle between the direction vector and the incident light direction is larger than angle-width/2 and smaller than angle+width/2.
The incoming light is the virtual light source that is responsible for the rainbow. There needn't be a real light source to create the rainbow effect.
The rainbow is a fog-like effect, i.e. the rainbow's color is mixed with the background color based on the distance to the intersection point. If you choose small distance values the rainbow will be visible on objects, not just in the background. You can avoid this by using a very large distance value.
The color map is the crucial part of the rainbow since it contains all the colors that normally can be seen in a rainbow. The color of the innermost color band is taken from the color map entry 0 while the outermost band is take from entry 1. You should note that due to the limited color range any monitor can display it is impossible to create a real rainbow. There are just some colors that you cannot display.
The filter channel of the rainbow's color map is used in the same way as with fogs. It determines how much of the light passing through the rainbow is filtered by the color.
The following example shows a simple scene with a ground plane, three spheres and a somewhat exaggerated rainbow ( rainbow1.pov ).
Some irregularity is added to the color bands using the jitter keyword.
The rainbow in our sample is much too bright. You'll never see a rainbow like this in reality. You can decrease the rainbow's colors by decreasing the RGB values in the color map.
We can use the transmittance channel of the colors in the color map to specify a minimum translucency, just like we did with the fog. To get realistic results we have to use very large transmittance values as you can see in the following example ( rainbow2.pov ).
The transmittance values increase at the outer bands of the rainbow to make it softly blend into the background.
The resulting image looks much more realistic than our first rainbow.
If you use arc_angle 120 for example you'll get a rainbow arc that abruptly vanishes at the arc's ends. This does not look good. To avoid this the falloff_angle keyword can be used to specify a region where the arc smoothly blends into the background.
As explained in the rainbow's reference section (see "Rainbow" ) the arc extends from -arc_angle/2 to arc_angle/2 while the blending takes place from -arc_angle/2 to -falloff_angle/2 and falloff_angle/2 to arc_angle/2. This is the reason why the falloff_angle has to be smaller or equal to the arc_angle .
In the following examples we use an 120 degrees arc with a 45 degree falloff region on both sides of the arc ( rainbow3.pov ).
The arc angles are measured against the rainbows up direction which can be specified using the up keyword. By default the up direction is the y-axis.
We finally have a realistic looking rainbow arc.