
@C4@M@bPOV-Ray Options


POV-Ray was originally created as a command-line program for operating
systems without graphical interfaces, dialog boxes and pull-down menus. Most
versions of POV-Ray still use command-line switches to tell it what to do.
This documentation assumes you are using the command-line version. If you are
using Macintosh, MS-Windows or other GUI versions, there will be dialog boxes
or menus which do the same thing. There is system-specific documentation for
each system describing the specific commands.

6.1              Setting POV-Ray Options

There are two distinct ways of setting POV-Ray options: command line switches
and INI file keywords. Both are explained in detail in the following
sections.

6.1.1            Command Line Switches

Command line switches consist of a + (plus) or - (minus) sign, followed by
one or more alphabetic characters and possibly a numeric value. Here is a
typical command line with switches.

  POVRAY +Isimple.pov +V +W80 +H60


povray is the name of the program and it is followed by several switches.
Each switch begins with a plus or minus sign. The +I switch with the filename
tells POV-Ray what scene file it should use as input and +V tells the program
to output its status to the text screen as it's working. The +W and +H
switches set the width and height of the image in pixels. This image will be
80 pixels wide by 60 pixels high.

In switches which toggle a feature, the plus turns it on and minus turns it
off. For example +P turns on the pause for keypress  when finished option
while -P turns it off. Other switches are used to specify values and do not
toggle a feature. Either plus or minus may be used in that instance. For
example +W320 sets the width to 320 pixels. You could also use -W320 and get
the same results.

Switches may be specified in upper or lower case. They are read left to right
but in general may be specified in any order. If you specify a switch more
than once, the previous value is generally overwritten with the last
specification. The only exception is the +L switch for setting library paths.
Up to ten unique paths may be specified.

Almost all +/- switches have an equivalent option which can be used in an INI
file which is described in the next section. A detailed description of each
switch is given in the option reference section.

6.1.2            Using INI Files

Because it is difficult to set more than a few options on a command line, you
have the ability to put multiple options in one or more text files. These
initialization files or INI files have .ini as their default extension.
Previous versions of POV-Ray called them default files or DEF files. You may
still use existing DEF files with this version of POV-Ray.

The majority of options you use will be stored in INI files. The command line
switches are recommended for options which you will turn off or on frequently
as you perform test renderings of a scene you are developing. The file
povray.ini is automatically read if present. You may specify additional INI
files on the command-line by simply typing the file name on the command line.
For example:

  POVRAY MYOPTS.INI


If no extension is given, then .ini is assumed. POV-Ray knows this is not a
switch because it is not preceded by a plus or minus. In fact a common error
among new users is that they forget to put the +I switch before the input
file name. Without the switch, POV-Ray thinks that the scene file simple.pov
is an INI file. Don't forget! If no plus or minus precedes a command line
switch, it is assumed to be an INI file name.

You may have multiple INI files on the command line along with switches. For
example:

  POVRAY MYOPTS +V OTHER


This reads options from myopts.ini, then sets the +V switch, then reads
options from other.ini.

An INI file is a plain ASCII text file with options of the form...

  Option_keyword=VALUE ; Text after semicolon is a comment


For example the INI equivalent of the switch +Isimple.pov is...

  Input_File_Name=simple.pov


Options are read top to bottom in the file but in general may be specified in
any order. If you specify an option more than once, the previous values are
generally overwritten with the last specification. The only exception is the
Library_Path=path options. Up to ten unique paths may be specified.

Almost all INI-style options have equivalent +/- switches. The option
reference section gives a detailed description of all POV-Ray options. It
includes both the INI-style settings and the +/- switches.

The INI keywords are not case sensitive. Only one INI option is permitted per
line of text. You may also include switches in your INI file if they are
easier for you. You may have multiple switches per line but you should not
mix switches and INI options on the same line. You may nest INI files by
simply putting the file name on a line by itself with no equals sign after
it. Nesting may occur up to ten levels deep.

For example:

  ; This is a sample INI file. This entire line is a comment.
  ; Blank lines are permitted.

  Input_File_Name=simple.pov ;This sets the input file name

  +W80 +H60 ; Traditional +/- switches are permitted too

  MOREOPT   ; Read MOREOPT.INI and continue with next line

  +V        ; Another switch

  ; That's all folks!


INI files may have labeled sections so that more than one set of options may
be stored in a single file. Each section begins with a label in [] brackets.
For example:

  ; RES.INI
  ; This sample INI file is used to set resolution.

  +W120 +H100  ; This section has no label.
               ; Select it with "RES"

  [Low]
  +W80 +H60    ; This section has a label.
               ; Select it with "RES[Low]"

  [Med]
  +W320 +H200  ; This section has a label.
               ; Select it with "RES[Med]"

  [High]
  +W640 +H480  ; Labels are not case sensitive.
               ; "RES[high]" works

  [Really High]
  +W800 +H600  ; Labels may contain blanks


When you specify the INI file you should follow it with the section label in
brackets. For example...

  POVRAY RES[Med] +Imyfile.pov


POV-Ray reads res.ini and skips all options until it finds the label Med. It
processes options after that label until it finds another label and then it
skips. If no label is specified on the command line then only the unlabeled
area at the top of the file is read. If a label is specified, the unlabeled
area is ignored.

6.1.3            Using the POVINI Environment Variable

The environment variable POVINI is used to specify the location and name of a
default INI file that is read every time POV-Ray is executed. If POVINI is
not specified a default INI file may be read depending on the platform used.
If the specified file does not exist a warning message is printed.

To set the environment variable under MS-DOS you might put the following line
in your autoexec.bat file...

  set POVINI=c:\povray3\default.ini


On most operating systems the sequence of reading options is as follows:

  1.Read options from default INI file specified by the POVINI environment
  2.Read switches from command line (this includes reading any specified
    INI/DEF files).


The POVRAYOPT environment variable supported by previous POV-Ray versions is
no longer available.

6.2              Options Reference

As explained in the previous section, options may be specified by switches or
INI-style options. Almost all INI-style options have equivalent +/- switches
and most switches have equivalent INI-style option. The following sections
give a detailed description of each POV-Ray option. It includes both the
INI-style settings and the +/- switches.

The notation and terminology used is described in the tables below.

  Keyword=bool turn Keyword on if bool equals true, yes, on or 1 and turn it
  Keyword=fileeany valid file name. Note: some options prohibit the use of
               any of the above true or false values as a file name. They are
               noted in later sections.


  path yany directory name, drive optional, no final path separator ("\" or
        "/", depending on the operating system)


Unless otherwise specifically noted, you may assume that either a plus or
minus sign before a switch will produce the same results.

6.2.1            Animation Options

POV-Ray 3.0 greatly improved its animation capability with the addition of an
internal animation loop, automatic output file name numbering and the ability
to shell out to the operating system to external utilities which can assemble
individual frames into an animation. The internal animation loop is simple
yet flexible. You may still use external programs or batch files to create
animations without the internal loop as you may have done in POV-Ray 2.

6.2.1.1          External Animation Loop

  +Kn.n=n.nSame as Clock=n.nt identifier to n.n


The Clock=n.n option or the +Kn.n switch may be used to pass a single float
value to the program for basic animation. The value is stored in the float
identifier clock. If an object had a rotate <0,clock,0> attached then you
could rotate the object by different amounts over different frames by setting
+K10.0, +K20.0... etc. on successive renderings. It is up to the user to
repeatedly invoke POV-Ray with a different Clock value and a different
Output_File_Name for each frame.

6.2.1.2          Internal Animation Loop

  +KFn.nClock=n.n.nSame as Final_Clock=n.n.n to n


The internal animation loop new to POV-Ray 3.0 relieves the user of the task
of generating complicated sets of batch files to invoke POV-Ray multiple
times with different settings. While the multitude of options may look
intimidating, the clever set of default values means that you will probably
only need to specify the Final_Frame=n or the +KFFn option to specify the
number of frames. All other values may remain at their defaults.

Any Final_Frame setting other than -1 will trigger POV-Ray's internal
animation loop. For example Final_Frame=10 or +KFF10 causes POV-Ray to render
your scene 10 times. If you specified Output_File_Name=file.tga then each
frame would be output as file01.tga, file02.tga, file03.tga etc. The number
of zero-padded digits in the file name depends upon the final frame number.
For example +KFF100 would generate file001.tga through file100.tga. The frame
number may encroach upon the file name. On MS-DOS with an eight character
limit, myscene.pov would render to mysce001.tga through mysce100.tga.

The default Initial_Frame=1 will probably never have to be changed. You would
only change it if you were assembling a long animation sequence in pieces.
One scene might run from frame 1 to 50 and the next from 51 to 100. The
Initial_Frame=n or +KFIn option is for this purpose.

Note that if you wish to render a subset of frames such as 30 through 40 out
of a 1 to 100 animation, you should not change Frame_Initial or Frame_Final.
Instead you should use the subset commands described in section "Subsets of
Animation Frames".

Unlike some animation packages, the action in POV-Ray animated scenes does
not depend upon the integer frame numbers. Rather you should design your
scenes based upon the float identifier clock. By default, the clock value is
0.0 for the initial frame and 1.0 for the final frame. All other frames are
interpolated between these values. For example if your object is supposed to
rotate one full turn over the course of the animation, you could specify
rotate  360*clock*y. Then as clock runs from 0.0 to 1.0, the object rotates
about the y-axis from 0 to 360 degrees.

The major advantage of this system is that you can render a 10 frame
animation or a 100 frame or 500 frame or 329 frame animation yet you still
get one full 360 degree rotation. Test renders of a few frames work exactly
like final renders of many frames.

In effect you define the motion over a continuous float valued parameter (the
clock) and you take discrete samples at some fixed intervals (the frames). If
you take a movie or video tape of a real scene it works the same way. An
object's actual motion depends only on time. It does not depend on the frame
rate of your camera.

Many users have already created scenes for POV-Ray 2 that expect clock values
over a range other than the default 0.0 to 1.0. For this reason we provide
the Initial_Clock=n.n or +KIn.n and Final_Clock=n.n or +KFn.n options. For
example to run the clock from 25.0 to 75.0 you would specify
Initial_Clock=25.0 and Final_Clock=75.0. Then the clock would be set to 25.0
for the initial frame and 75.0 for the final frame. In-between frames would
have clock values interpolated from 25.0 through 75.0 proportionally.

Users who are accustomed to using frame numbers rather than clock values
could specify Initial_Clock=1.0 and Final_Clock=10.0 and Frame_Final=10 for a
10 frame animation.

For new scenes, we recommend you do not change the Initial_Clock or
Final_Clock from their default 0.0 to 1.0 values. If you want the clock to
vary over a different range than the default 0.0 to 1.0, we recommend you
handle this inside your scene file as follows...

  #declare Start    = 25.0
  #declare End      = 75.0
  #declare My_Clock = Start+(End-Start)*clock


Then use My_Clock in the scene description. This keeps the critical values
25.0 and 75.0 in your .pov file.

Note that more details concerning the inner workings of the animation loop
are in the section on shell-out operating system commands in section
"Shell-out to Operating System".

6.2.1.3          Subsets of Animation Frames

  +EFn or +EF0.nme=0.n.nSame as Subset_End_Frameme n percentnt


When creating a long animation, it may be handy to render only a portion of
the animation to see what it looks like. Suppose you have 100 frames but only
want to render frames 30 through 40. If you set Initial_Frame=30 and
Final_Frame=40 then the clock would vary from 0.0 to 1.0 from frames 30
through 40 rather than 0.30 through 0.40 as it should. Therefore you should
leave Initial_Frame=1 and Final_Frame=100 and use Subset_Start_Frame=30 and
Subset_End_Frame=40 to selectively render part of the scene. POV-Ray will
then properly compute the clock values.

Usually you will specify the subset using the actual integer frame numbers
however an alternate form of the subset commands takes a float value in the
range 0.0 <=n.nnn <=1.0 which is interpreted as a fraction of the whole
animation. For example, Subset_Start_Frame=0.333 and Subset_End_Frame=0.667
would render the middle 1/3rd of a sequence regardless of the number of
frames.

6.2.1.4          Cyclic Animation

  -KClic_Animation=boolTurn cyclic animation offoff


Many computer animation sequences are designed to be run in a continuous
loop. Suppose you have an object that rotates exactly 360 degrees over the
course of your animation and you did rotate  360*clock*y to do so. Both the
first and last frames would be identical. Upon playback there would be a
brief one frame jerkiness. To eliminate this problem you need to adjust the
clock so that the last frame does not match the first. For example a ten
frame cyclic animation should not use clock 0.0 to 1.0. It should run from
0.0 to 0.9 in 0.1 increments. However if you change to 20 frames it should
run from 0.0 to 0.95 in 0.05 increments. This complicates things because you
would have to change the final clock value every time you changed
Final_Frame. Setting Cyclic_Animation=on or using +KC will cause POV-Ray to
automatically adjust the final clock value for cyclic animation regardless of
how many total frames. The default value for this setting is off.

6.2.1.5          Field Rendering

  -UO_Field=booloolSet odd field flag offffoff


Field rendering is sometimes used for animations when the animation is being
output for television. TVs only display alternate scan lines on each vertical
refresh. When each frame is being displayed the fields are interlaced to give
the impression of a higher resolution image. The even scan lines make up the
even field, and are drawn first (i. e. scan lines 0, 2, 4, etc.), followed by
the odd field, made up of the odd numbered scan lines are drawn afterwards.
If objects in an animation are moving quickly, their position can change
noticeably from one field to the next. As a result, it may be desirable in
these cases to have POV-Ray render alternate fields at the actual field rate
(which is twice the frame rate), rather than rendering full frames at the
normal frame rate. This would save a great deal of time compared to rendering
the entire animation at twice the frame rate, and then only using half of
each frame.

By default, field rendering is not used. Setting Field_Render=on or using +UF
will cause alternate frames in an animation to be only the even or odd fields
of an animation. By default, the first frame is the even field, followed by
the odd field. You can have POV-Ray render the odd field first by specifying
Odd_Field=on, or by using the +UO switch.

6.2.2            Output Options


6.2.2.1          General Output Options


6.2.2.1.1        Height and Width of Output

  +Wnth=nnSame as Width=nn (when n > 8)


These switches set the height and width of the image in pixels. This
specifies the image size for file output. The preview display, if on, will
generally attempt to pick a video mode to accommodate this size but the
display settings do not in any way affect the resulting file output.

6.2.2.1.2        Partial Output Options

  +ER0.n or +E0.nnSame as End_Row=0.nercent of heightthh


When doing test rendering it is often convenient to define a small,
rectangular sub-section of the whole screen so you can quickly check out one
area of the image. The Start_Row, End_Row, Start_Column and End_Column
options allow you to define the subset area to be rendered. The default
values are the full size of the image from (1,1) which is the upper left to
(w,h) on the lower right where w and h are the Width=n and Height=n values
you have set.

Note if the number specified is greater than 1 then it is interpreted as an
absolute row or column number in pixels. If it is a decimal value between 0.0
and 1.0 then it is interpreted as a percent of the total width or height of
the image. For example: Start_Row=0.75 and Start_Column=0.75 starts on a row
75% down from the top at a column 75% from the left. Thus it renders only the
lower-right 25% of the image regardless of the specified width and height.

The +SR, +ER, +SC and +EC switches work in the same way as the corresponding
INI-style settings for both absolute settings or percentages. Early versions
of POV-Ray allowed only start and end rows to be specified with +Sn and +En
so they are still supported in addition to +SR and +ER.

6.2.2.1.3        Interrupting Options

  -Xnt_Abort_Count=nSet to test for abort off (in future test every n pixels)



On some operating systems once you start a rendering you must let it finish.
The Test_Abort=on option or +X switch causes POV-Ray to test the keyboard for
keypress. If you have pressed a key, it will generate a controlled user
abort. Files will be flushed and closed but only data through the last full
row of pixels is saved. POV-Ray exits with an error code 2 (normally POV-Ray
returns 0 for a successful run or 1 for a fatal error).

When this option is on, the keyboard is polled on every line while parsing
the scene file and on every pixel while rendering. Because polling the
keyboard can slow down a rendering, the Test_Abort_Count=n option or +Xn
switch causes the test to be performed only every n pixels rendered or scene
lines parsed.

6.2.2.1.4        Resuming Options

  +GIsss_Ini=falseoolSame as Create_Ini=sss previously set file.ini


If you abort a render while it's in progress or if you used the End_Row
option to end the render prematurely, you can use Continue_Trace=on or +C
option to continue the render later at the point where you left off. This
option reads in the previously generated output file, displays the partial
image rendered so far, then proceeds with the ray-tracing. This option cannot
be used if file output is disabled with Output_to_file=off or -F.

The Continue_Trace option may not work if the Start_Row option has been set
to anything but the top of the file, depending on the output format being
used.

POV-Ray tries to figure out where to resume an interrupted trace by reading
any previously generated data in the specified output file. All file formats
contain the image size, so this will override any image size settings
specified. Some file formats (namely TGA and PNG) also store information
about where the file started (i. e. +SCn and +SRn options), alpha output +UA,
and bit-depth +FNn, which will override these settings. It is up to the user
to make sure that all other options are set the same as the original render.

The Create_Ini option or +GI switch provides an easy way to create an INI
file with all of the rendering options, so you can re-run files with the same
options, or ensure you have all the same options when resuming. This option
creates an INI file with every option set at the value used for that
rendering. This includes default values which you have not specified. For
example if you run POV-Ray with...

  POVRAY +Isimple.pov MYOPTS +GIrerun.ini MOREOPTS


POV-Ray will create a file called rerun.ini with all of the options used to
generate this scene. The file is not written until all options have been
processed. This means that in the above example, the file will include
options from both myopts.ini and moreopts.ini despite the fact that the +GI
switch is specified between them. You may now re-run the scene with...

  POVRAY RERUN


or resume an interrupted trace with

  POVRAY RERUN +C


If you add other switches with the rerun.ini reference, they will be included
in future re-runs because the file is re-written every time you use it.

The Create_Ini option is also useful for documenting how a scene was
rendered. If you render waycool.pov with Create_Ini=on then it will create a
file waycool.ini that you could distribute along with your scene file so
other users can exactly re-create your image.

6.2.2.2          Display Output Options


6.2.2.2.1        Display Hardware Settings

  Display_Gamma=n.nSets the display gamma to n.n, palette 'y' in future


The Display=on or +D switch will turn on the graphics display of the image
while it is being rendered. Even on some non-graphics systems, POV-Ray may
display an 80 by 24 character ASCII-Art version of your image. Where
available, the display may be full, 24-bit true color. Setting Display=off or
using the -D switch will turn off the graphics display which is the default.

The Video_Mode=x option sets the display mode or hardware type chosen where x
is a single digit or letter that is machine dependent (see section "Display
Types" for a description of the modes supported by the MS-DOS version).
Generally Video_Mode=0 means the default or an auto-detected setting should
be used. When using switches, this character immediately follows the switch.
For example the +D0 switch will turn on the graphics display in the default
mode.

The Palette=y option selects the palette to be used. Typically the single
character parameter y is a digit which selects one of several fixed palettes
or a letter such G for gray scale, H for 15-bit or 16-bit high color or T for
24-bit true color. When using switches, this character is the 2nd character
after the switch. For example the +D0T switch will turn on the graphics
display in the default mode with a true color palette.

The Display_Gamma=n.n setting is new with POV-Ray 3.0, and is not available
as a command-line switch. The Display_Gamma setting overcomes the problem of
images (whether ray-traced or not) having different brightness when being
displayed on different monitors, different video cards, and under different
operating systems. Note that the Display_Gamma is a setting based on your
computer's display hardware, and should be set correctly once and not
changed. The Display_Gamma INI setting works in conjunction with the new
assumed_gamma global setting to ensure that POV scenes and the images they
create look the same on all systems. See section "Assumed_Gamma" which
describes the assumed_gamma global setting and describes gamma more
thoroughly.

While the Display_Gamma can be different for each system, there are a few
general rules that can be used for setting Display_Gamma if you don't know it
exactly. If the Display_Gamma keyword does not appear in the INI file,
POV-Ray assumes that the display gamma is 2.2. This is because most PC
monitors have a gamma value in the range 1.6 to 2.6 (newer models seem to
have a lower gamma value). MacOS has the ability to do gamma correction
inside the system software (based on a user setting in the gamma control
panel). If the gamma control panel is turned off, or is not available, the
default Macintosh system gamma is 1.8. Some high-end PC graphics cards can do
hardware gamma correction and should use the current Display_Gamma setting,
usually 1.0. A gamma test image is also available to help users to set their
Display_Gamma accurately.

For scene files that do not contain an assumed_gamma global setting the INI
file option Display_Gamma will not have any affect on the preview output of
POV-Ray or for most output file formats. However, the Display_Gamma value is
used when creating PNG format output files, and also when rendering the
POV-Ray example files (because they have an assumed_gamma), so it should
still be correctly set for your system to ensure proper results.

6.2.2.2.2        Display Related Settings

  -UDw_Vistas=boolboolTurn draw vistas offofffoff


On some systems, when the image is complete, the graphics display is cleared
and POV-Ray switches back into text mode to print the final statistics and to
exit. Normally when the graphics display is on, you want to look at the image
awhile before continuing. Using Pause_When_Done=on or +P causes POV-Ray to
pause in graphics mode until you to press a key to continue. The default is
not to pause (-P).

When the graphics display is not used, it is often desirable to monitor
progress of the rendering. Using Verbose=on or +V turns on verbose reporting
of your rendering progress. This reports the number of the line currently
being rendered, the elapsed time for the current frame and other information.
On some systems, this textual information can conflict with the graphics
display. You may need to turn this off when the display is on. The default
setting is off (-V).

The option Draw_Vistas=on or +UD was originally a debugging help for
POV-Ray's vista buffer feature but it was such fun we decided to keep it.
Vista buffering is a spatial sub-division method that projects the 2-D
extents of bounding boxes onto the viewing window. POV-Ray tests the 2-D x, y
pixel location against these rectangular areas to determine quickly which
objects, if any, the viewing ray will hit. This option shows you the 2-D
rectangles used. The default setting is off (-UD) because the drawing of the
rectangles can take considerable time on complex scenes and it serves no
critical purpose. See section "Automatic Bounding Control" for more details.

6.2.2.2.3        Mosaic Preview

  +EPniew_End_Size=n=nSame as Preview_End_Size=ne to n n


Typically, while you are developing a scene, you will do many low resolution
test renders to see if objects are placed properly. Often this low resolution
version doesn't give you sufficient detail and you have to render the scene
again at a higher resolution. A feature called mosaic preview solves this
problem by automatically rendering your image in several passes.

The early passes paint a rough overview of the entire image using large
blocks of pixels that look like mosaic tiles. The image is then refined using
higher resolutions on subsequent passes. This display method very quickly
displays the entire image at a low resolution, letting you look for any major
problems with the scene. As it refines the image, you can concentrate on more
details, like shadows and textures. You don't have to wait for a full
resolution render to find problems, since you can interrupt the rendering
early and fix the scene, or if things look good, you can let it continue and
render the scene at high quality and resolution.

To use this feature you should first select a width and height value that is
the highest resolution you will need. Mosaic preview is enabled by specifying
how big the mosaic blocks will be on the first pass using
Preview_Start_Size=n or +SPn. The value n should be a number greater than
zero that is a power of two (1, 2, 4, 8, 16, 32, etc.) If it is not a power
of two, the nearest power of two less than n is substituted. This sets the
size of the squares, measured in pixels. A value of 16 will draw every 16th
pixel as a 16*16 pixel square on the first pass. Subsequent passes will use
half the previous value (such as 8*8, 4*4 and so on.)

The process continues until it reaches 1*1 pixels or until it reaches the
size you set with Preview_End_Size=n or +EPn. Again the value n should be a
number greater than zero that is a power of two and less than or equal to
Preview_Start_Size. If it is not a power of two, the nearest power of two
less than n is substituted. The default ending value is 1. If you set
Preview_End_Size to a value greater than 1 the mosaic passes will end before
reaching 1*1, but POV-Ray will always finish with a 1*1. For example, if you
want a single 8*8 mosaic pass before rendering the final image, set
Preview_Start_Size=8 and Preview_End_Size=8.

No file output is performed until the final 1*1 pass is reached. Although the
preliminary passes render only as many pixels as needed, the 1*1 pass
re-renders every pixel so that anti-aliasing and file output streams work
properly. This makes the scene take up to 25% longer than the regular 1*1
pass to render, so it is suggested that mosaic preview not be used for final
rendering. Also, the lack of file output until the final pass means that
renderings which are interrupted before the 1*1 pass can not be resumed
without starting over from the beginning.

Future versions of POV-Ray will include some system of temporary files or
buffers which will eliminate these inefficiencies and limitations. Mosaic
preview is still a very useful feature for test renderings.

6.2.2.3          File Output Options

  -Ftput_to_File=boolSets file output off(use default type)


By default, POV-Ray writes an image file to disk. When you are developing a
scene and doing test renders, the graphic preview may be sufficient. To save
time and disk activity you may turn file output off with Output_to_File=off
or -F.

6.2.2.3.1        Output File Type

  -Fxnut_File_Type=xSets file output off; but in future use format 'x', depth
  Bits_Per_Color=nl Sets file output bits/color to 'n'


The default type of image file depends on which platform you are using.
MS-DOS and most others default to 24-bit uncompressed Targa. See your
platform-specific documentation to see what your default file type is. You
may select one of several different file types using Output_File_Type=x or
+Fx where x is one of the following...

  +FTUncompressed Targa-24 formatPict or Windows BMPoded)


Note that the obsolete +FD dump format and +FR raw format have been dropped
from POV-Ray 3.0 because they were rarely used and no longer necessary. PPM,
PNG, and system specific formats have been added. PPM format images are
uncompressed, and have a simple text header, which makes it a widely portable
image format. PNG is a new image format designed not only to replace GIF, but
to improve on its shortcomings. PNG offers the highest compression available
without loss for high quality applications, such as ray-tracing. The system
specific format depends on the platform used and is covered in the
appropriate system specific documentation.

Most of these formats output 24 bits per pixel with 8 bits for each of red,
green and blue data. PNG allows you to optionally specify the output bit
depth from 5 to 16 bits for each of the red, green, and blue colors, giving
from 15 to 48 bits of color information per pixel. The default output depth
for all formats is 8 bits/color (16 million possible colors), but this may be
changed for PNG format files by setting Bits_Per_Color=n or by specifying
+FNn, where n is the desired bit depth.

Specifying a smaller color depth like 5 bits/color (32768 colors) may be
enough for people with 8- or 16-bit (256 or 65536 color) displays, and will
improve compression of the PNG file. Higher bit depths like 10 or 12 may be
useful for video or publishing applications, and 16 bits/color is good for
grayscale height field output (See section "Height Field" for details on
height fields).

Targa format also allows 8 bits of alpha transparency data to be output,
while PNG format allows 5 to 16 bits of alpha transparency data, depending on
the color bit depth as specified above. You may turn this option on with
Output_Alpha=on or +UA. The default is off or -UA. See section "Using the
Alpha Channel" for further details on transparency.

In addition to support for variable bit-depths, alpha channel, and grayscale
formats, PNG files also store the Display_Gamma value so the image displays
properly on all systems (see section "Display Hardware Settings"). The
hf_gray_16 global setting, as described in section "HF_Gray_16" will also
affect the type of data written to the output file.

6.2.2.3.2        Output File Name

  +Ofile_File_Name=fileSame as Output_File_Name=file


The default output filename is created from the scene name and need not be
specified. The scene name is the input name with all drive, path, and
extension information stripped. For example if the input file name is
c:\povray3\mystuff\myfile.pov the scene name is myfile. The proper extension
is appended to the scene name based on the file type. For example myfile.tga
or myfile.png might be used.

You may override the default output name using Output_File_Name=file or
+Ofile. For example:

  Input_File_Name=myinput.pov
  Output_File_Name=myoutput.tga


If an output file name of "-" is specified (a single minus sign), then the
image will be written to standard output, usually the screen. The output can
then be piped into another program or to a GUI if desired.

6.2.2.3.3        Output File Buffer

  Buffer_Size=n=boolSet output buffer size to 'n' kilobytes. If n is zero, no
                    buffering. If n < system default, the system default is
  -Bn               Turn buffer off, but for future set size n


The Buffer_Output and Buffer_Size options and the +B switch allows you to
assign large buffers to the output file. This reduces the amount of time
spent writing to the disk. If this parameter is not specified, then as each
row of pixels is finished, the line is written to the file and the file is
flushed. On most systems, this operation ensures that the file is written to
the disk so that in the event of a system crash or other catastrophic event,
at least a part of the picture has been stored properly and retrievable on
disk. The default is not to use any buffer.

6.2.2.4          CPU Utilization Histogram

The CPU utilization histogram is a way of finding out where POV-Ray is
spending its rendering time, as well as an interesting way of generating
heightfields. The histogram splits up the screen into a rectangular grid of
blocks. As POV-Ray renders the image, it calculates the amount of time it
spends rendering each pixel and then adds this time to the total rendering
time for each grid block. When the rendering is complete, the histogram is a
file which represents how much time was spent computing the pixels in each
grid block.

Not all versions of POV-Ray allow the creation of histograms. The histogram
output is dependent on the file type and the system that POV-Ray is being run
on.

6.2.2.4.1        File Type

  +HTxogram_Type=xSame as Histogram_Type=x(turn off if type is 'X')


The histogram output file type is nearly the same as that used for the image
output file types in "Output File Type". The available histogram file types
are as follows.

  +HTXNo histogram file output is generatedindows BMPscaleets


Note that +HTC does not generate a compressed Targa-24 format output file but
rather a text file with a comma-separated list of the time spent in each grid
block, in left-to-right and top-to bottom order. The units of time output to
the CSV file are system dependent. See the system specific documentation for
further details on the time units in CSV files.

The Targa and PPM format files are in the POV heightfield format (see "Height
Field"), so the histogram information is stored in both the red and green
parts of the image, which makes it unsuitable for viewing. When used as a
height field, lower values indicate less time spent calculating the pixels in
that block, while higher indicate more time spent in that block.

PNG format images are stored as grayscale images and are useful for both
viewing the histogram data as well as for use as a heightfield. In PNG files,
the darker (lower) areas indicate less time spent in that grid block, while
the brighter (higher) areas indicate more time spent in that grid block.

6.2.2.4.2        File Name

  +HNfileam_Name=fileSame as Histogram_Name=file


The histogram file name is the name of the file in which to write the
histogram data. If the file name is not specified it will default to
histgram.ext, where ext is based on the file type specified previously. Note
that if the histogram name is specified the file name extension should match
the file type.

6.2.2.4.3        Grid Size

  +HSxx.yym_Grid_Size=xx.yySame as Histogram_Grid_Size=xx.yy


The histogram grid size gives the number of times the image is split up in
both the horizontal and vertical directions. For example

  povray +Isample +W640 +H480 +HTN +HS160.120 +HNhistogrm.png


will split the image into 160*120 grid blocks, each of size 4*4 pixels, and
output a PNG file, suitable for viewing or for use as a heightfield. Smaller
numbers for the grid size mean more pixels are put into the same grid block.
With CSV output, the number of values output is the same as the number of
grid blocks specified. For the other formats the image size is identical to
the rendered image rather than the specified grid size, to allow easy
comparison between the histogram and the rendered image. If the histogram
grid size is not specified, it will default to the same size as the image, so
there will be one grid block per pixel.

Note that on systems that do task-switching or multi-tasking the histogram
may not exactly represent the amount of time POV-Ray spent in a given grid
block since the histogram is based on real time rather than CPU time. As a
result, time may be spent for operating system overhead or on other tasks
running at the same time. This will cause the histogram to have speckling,
noise or large spikes. This can be reduced by decreasing the grid size so
that more pixels are averaged into a given grid block.

6.2.3            Scene Parsing Options

POV-Ray reads in your scene file and processes it to create an internal model
of your scene. The process is called parsing. As your file is parsed other
files may be read along the way. This section covers options concerning what
to parse, where to find it and what version specific assumptions it should
make while parsing it.

6.2.3.1          Input File Name

  +IfileFile_Name=fileSame as Input_File_Name=file


You will probably always set this option but if you do not the default input
filename is object.pov. If you do not have an extension then .pov is assumed.
On case-sensitive operating systems both .pov and .POV are tried. A full path
specification may be used (on MS-DOS systems +Ic:\povray3\mystuff\myfile.pov
is allowed for example). In addition to specifying the input file name this
also establishes the scene name.

The scene name is the input name with drive, path and extension stripped. In
the above example the scene name is myfile. This name is used to create a
default output file name and it is referenced other places.

If you use "-" as the input file name the input will be read from standard
input. Thus you can pipe a scene created by a program to POV-Ray and render
it without having a scene file.

Under MS-DOS you can try this feature by typing.

  type ANYSCENE.POV | povray +I-


6.2.3.2          Library Paths

  +Lpathy_Path=pathSame as Library_Path=pathry paths


POV-Ray looks for files in the current directory. If it does not find a file
it needs it looks in various other library directories which you specify.
POV-Ray does not search your operating system path. It only searches the
current directory and directories which you specify with this option. For
example the standard include files are usually kept in one special directory.
You tell POV-Ray to look there with...

  Library_Path=c:\povray3\include


You must not specify any final path separators ("\" or "/") at the end.

Multiple uses of this option switch do not override previous settings. Up to
ten unique paths may be specified. If you specify the exact same path twice
it is only counts once. The current directory will be searched first followed
by the indicated library directories in the order in which you specified
them.

6.2.3.3          Language Version

  +MVn.nn=n.nSame as Version=n.ne compatibility to version n.n


While many language changes have been made for POV-Ray 3.0, all of version
2.0 syntax and most of version 1.0 syntax still works. Whenever possible we
try to maintain backwards compatibility. One feature introduced in 2.0 that
was incompatible with any 1.0 scene files is the parsing of float
expressions. Setting Version=1.0 or using +MV1.0 turns off expression parsing
as well as many warning messages so that nearly all 1.0 files will still
work. The changes between 2.0 and 3.0 are not as extensive. Setting
Version=2.0 is only necessary to eliminate some warning messages. Naturally
the default setting for this option is Version=3.0.

The #version language directive can also be used to change modes several
times within scene files. The above options affect only the initial setting.
See section "Version Directive" for more details about the language version
directive.

6.2.3.4          Removing User Bounding

  -SUit_Unions=boollTurn split bounded unions offoffoffoff


Early versions of POV-Ray had no system of automatic bounding or spatial
sub-division to speed up ray-object intersection tests. Users had to manually
create bounding boxes to speed up the rendering. POV-Ray 3.0 has more
sophisticated automatic bounding than any previous version. In many cases the
manual bounding on older scenes is slower than the new automatic systems.
Therefore POV-Ray removes manual bounding when it knows it will help. In rare
instances you may want to keep manual bounding. Some older scenes incorrectly
used bounding when they should have used clipping. If POV-Ray removes the
bounds in these scenes the image will not look right. To turn off the
automatic removal of manual bounds you should specify Remove_Bounds=off or
use -UR. The default is Remove_Bounds=on.

One area where the jury is still out is the splitting of manually bounded
unions. Unbounded unions are always split into their component parts so that
automatic bounding works better. Most users do not bound unions because they
know that doing so is usually slower. If you do manually bound a union we
presume you really want it bound. For safety sake we do not presume to remove
such bounds. If you want to remove manual bounds from unions you should
specify Split_Unions=on or use +SU. The default is Split_Unions=off.

6.2.4            Shell-out to Operating System

  Fatal_Error_Command=sSet command when POV-Ray has fatal error


Note that no +/- switches are available for these options. They cannot be
used from the command line. They may only be used from INI files.

POV-Ray offers you the opportunity to shell-out to the operating system at
several key points to execute another program or batch file. Usually this is
used to manage files created by the internal animation loop however the shell
commands are available for any scene. The CMD is a single line of text which
is passed to the operating system to execute a program. For example

  Post_Scene_Command=tga2gif -d -m myfile


would use the utility tga2gif with the -D and -M parameters to convert
myfile.tga to myfile.gif after the scene had finished rendering.

6.2.4.1          String Substitution in Shell Commands

It could get cumbersome to change the Post_Scene_Command every time you
changed scene names. POV-Ray can substitute various values into a CMD string
for you. For example:

  Post_Scene_Command=tga2gif -d -m %s


POV-Ray will substitute the %s with the scene name in the command. The scene
name is the Input_File_Name or +I setting with any drive, directory or
extension removed. For example:

  Input_File_Name=c:\povray3\scenes\waycool.pov


is stripped down to the scene name waycool which results in...

  Post_Scene_Command=tga2gif -d -m waycool


In an animation it may be necessary to have the exact output file name with
the frame number included. The string %o will substitute the output file
name. Suppose you want to save your output files in a zip archive using
pkzip. You could do...

  Post_Frame_Command=pkzip -m %s %o


After rendering frame 12 of myscene.pov POV-Ray would shell to the operating
system with "pkzip -m myscene mysce012.tga". The -M switch in pkzip moves
mysce012.tga to myscene.zip and removes it from the directory. Note that %o
includes frame numbers only when in an animation loop. During the
Pre_Scene_Command and Post_Scene_Command there is no frame number so the
original, unnumbered Output_File_Name is used. Any User_Abort_Command or
Fatal_Error_Command not inside the loop will similarly give an unnumbered %o
substitution.

Here is the complete list of substitutions available for a common string.


6.2.4.2          Shell Command Sequencing

Here is the sequence of events in an animation loop. Non-animated scenes work
the exact same way except there is no loop.

  1)  Process all INI file keywords and command line switches just once.
  2)  Open any text output streams and do Create_INI if any.
  3)  Execute Pre_Scene_Command if any.
  4)  Loop through frames (or just do once on non-animation).
      a)  Execute Pre_Frame_Command if any.
      b)  Parse entire scene file, open output file and read settings,
          turn on display, render the frame, destroy all objects,
          textures etc., close output file, close display.
      c)  Execute Post_Frame_Command if any.
      d)  Go back to 4 a until all frames are done.
  5)  Execute Post_Scene_Command if any.
  6)  Exit POV-Ray.


If the user interrupts processing the User_Abort_Command, if any, is
executed. User aborts can only occur during the parsing and rendering parts
of step 4 a above.

If a fatal error occurs that POV-Ray notices the Fatal_Error_Command, if any,
is executed. Sometimes an unforeseen bug or memory error could cause a total
crash of the program in which case there is no chance to shell out. Fatal
errors can occur just about anywhere including during the processing of
switches or INI files. If a fatal error occurs before POV-Ray has read the
Fatal_Error_Command string then obviously no shell can occur.

Note that the entire scene is re-parsed for every frame. Future versions of
POV-Ray may allow you to hold over parts of a scene from one frame to the
next but for now it starts from scratch every time. Note also that the
Pre_Frame_Command occurs before the scene is parsed. You might use this to
call some custom scene generation utility before each frame. This utility
could rewrite your .pov or .inc files if needed. Perhaps you will want to
generate new .gif or .tga files for image maps or height fields on each
frame.

6.2.4.3          Shell Command Return Actions

  Fatal_Error_Return=sSet fatal return actionstions


Note that no +/- switches are available for these options. They cannot be
used from the command line. They may only be used from INI files.

Most operating systems allow application programs to return an error code if
something goes wrong. When POV-Ray executes a shell command it can make use
of this error code returned from the shell process and take some appropriate
action if the code is zero or non-zero. POV-Ray itself returns such codes. It
returns 0 for success, 1 for fatal error and 2 for user abort.

The actions are designated by a single letter in the different ..._Return=s
options. The possible actions are:

  F generate a fatal error in POV-Ray


For example if your Pre_Frame_Command calls a program which generates your
height field data and that utility fails then it will return a non-zero code.
We would probably want POV-Ray to abort as well. The option
Pre_Frame_Return=F will cause POV-Ray to do a fatal abort if the
Pre_Frame_Command returns a non-zero code.

Sometimes a non-zero code from the external process is a good thing. Suppose
you want to test if a frame has already been rendered. You could use the S
action to skip this frame if the file is already rendered. Most utilities
report an error if the file is not found. For example the command pkzip -V
myscene mysce012.tga tells pkzip you want to view the catalog of myscene.zip
for the file mysce012.tga. If the file isn't in the archive pkzip returns a
non-zero code.

However we want to skip if the file is found. Therefore we need to reverse
the action so it skips on zero and doesn't skip on non-zero. To reverse the
zero vs. non-zero triggering of an action precede it with a "-" sign (note a
"!" will also work since it is used in many programming languages as a negate
operator).

Pre_Frame_Return=S will skip if the code shows error (non-zero) and will
proceed normally on no error (zero). Pre_Frame_Return=-S will skip if there
is no error (zero) and will proceed normally if there is an error (non-zero).


The default for all shells is I which means that the return action is ignored
no matter what. POV-Ray simply proceeds with whatever it was doing before the
shell command. The other actions depend upon the context. You may want to
refer back to the animation loop sequence chart in the previous section. The
action for each shell is as follows.

On return from any User_Abort_Command if there is an action triggered and you
have specified...

  F            then turn this user abort into a fatal error. Do the
  S, A, Q, or Uthen proceed with the user abort. Exit POV-Ray with error code
2.


On return from any Fatal_Error_Command proceed with the fatal error no matter
what. Exit POV-Ray with error code 1. On return from any Pre_Scene_Command,
Pre_Frame_Command, Post_Frame_Command or Post_Scene_Commands if there is an
action triggered and you have specified...

  F then generate a fatal error. Do the Fatal_Error_Command, if any. Exit
  U then generate a user abort. Do the User_Abort_Command, if any. Exit
  Q then quit POV-Ray immediately. Acts as though POV-Ray never really ran.
    Do no further shells, (not even Post_Scene_Command) and exit POV-Ray with
    an error code 0.


On return from a Pre_Scene_Command if there is an action triggered and you
have specified...

  S then skip rendering all frames. Acts as though the scene completed all
    frames normally. Do not do any Pre_Frame_Command or Post_Frame_Commands.
    Do the Post_Scene_Command, if any. Exit POV-Ray with error code 0. On the
  A then skip all scene activity. Works exactly like Q quit. On the earlier
    chart this means skip to step #6.


On return from a Pre_Frame_Command if there is an action triggered and you
have specified...

  S then skip only this frame. Acts as though this frame never existed. Do
    not do the Post_Frame_Command. Proceed with the next frame. On the
    earlier chart this means skip steps #4b and #4c but loop back as needed
  A then skip rendering this frame and all remaining frames. Acts as though
    the scene completed all frames normally. Do not do any further
    Post_Frame_Commands. Do the Post_Scene_Command, if any. Exit POV-Ray with
    error code 0. On the earlier chart this means skip the rest of step #4
    and proceed at step #5.


On return from a Post_Frame_Command if there is an action triggered and you
have specified...

  S then skip rendering all remaining frames. Acts as though the scene
    completed all frames normally. Do the Post_Scene_Command, if any. Exit
    POV-Ray with error code 0. On the earlier chart this means skip the rest
  A same as S for this shell command..


On return from any Post_Scene_Command if there is an action triggered and you
have specified...


6.2.5            Text Output

Text output is an important way that POV-Ray keeps you informed about what it
is going to do, what it is doing and what it did. New to POV-Ray 3.0, the
program splits its text messages into 7 separate streams. Some versions of
POV-Ray color codes the various types of text. Some versions allow you to
scroll back several pages of messages. All versions allow you to turn some of
these text streams off/on or to direct a copy of the text output to one or
several files. This section details the options which give you control over
text output.

6.2.5.1          Text Streams

There are seven distinct text streams that POV-Ray uses for output. On some
versions each stream is designated by a particular color. Text from these
streams are displayed whenever it is appropriate so there is often an
intermixing of the text. The distinction is only important if you choose to
turn some of the streams off or to direct some of the streams to text files.
On some systems you may be able to review the streams separately in their own
scroll-back buffer.

Here is a description of each stream.

BANNER: This stream displays the program's sign-on banner, copyright,
contributor's list, and some help screens. It cannot be turned off or
directed to a file because most of this text is displayed before any options
or switches are read. Therefore you cannot use an option or switch to control
it. There are switches which display the help screens. They are covered in
section "Help Screen Switches".

DEBUG: This stream displays debugging messages. It was primarily designed for
developers but this and other streams may also be used by the user to display
messages from within their scene files. See section "Text Message Streams"
for details on this feature. This stream may be turned off and/or directed to
a text file.

FATAL: This stream displays fatal error messages. After displaying this text,
POV-Ray will terminate. When the error is a scene parsing error, you may be
shown several lines of scene text that leads up to the error. This stream may
be turned off and/or directed to a text file.

RENDER: This stream displays information about what options you have
specified to render the scene. It includes feedback on all of the major
options such as scene name, resolution, animation settings, anti-aliasing and
others. This stream may be turned off and/or directed to a text file.

STATISTICS: This stream displays statistics after a frame is rendered. It
includes information about the number of rays traced, the length of time of
the processing and other information. This stream may be turned off and/or
directed to a text file.

STATUS: This stream displays one-line status messages that explain what
POV-Ray is doing at the moment. On some systems this stream is displayed on a
status line at the bottom of the screen. This stream cannot be directed to a
file because there is generally no need to. The text displayed by the Verbose
option or +V switch is output to this stream so that part of the status
stream may be turned off.

WARNING: This stream displays warning messages during the parsing of scene
files and other warnings. Despite the warning, POV-Ray can continue to render
the scene. You will be informed if POV-Ray has made any assumptions about
your scene so that it can proceed. In general any time you see a warning, you
should also assume that this means that future versions of POV-Ray will not
allow the warned action. Therefore you should attempt to eliminate warning
messages so your scene will be able to run in future versions of POV-Ray.
This stream may be turned off and/or directed to a text file.

6.2.5.2          Console Text Output

  All_Console=boolboololTurn on/off all debug, fatal, render, statistic and
  -GA                   Same as All_Console=Off.


You may suppress the output to the console of the Debug, Fatal, Render,
Statistic or Warning text streams. For example the Statistic_Console=off
option or the -GS switch can turn off the Statistic stream. Using on or +GS
you may turn it on again. You may also turn all five of these streams on or
off at once using the All_Console option or +GA switch.

Note that these options take effect immediately when specified. Obviously any
Error or Warning messages that might occur before the option is read are not
be affected.

6.2.5.3          Directing Text Streams to Files

  All_File=truefileeeeEcho all debug, fatal, render, statistic and warning
  All_File=false      Turn off file output of all debug, fatal, render,
  All_File=file       Echo all debug, fatal, render, statistic and warning
  -GAfile             Both All_Console=Off, All_File=file


You may direct a copy of the text streams to a text file for the Debug,
Fatal, Render, Statistic or Warning text streams. For example the
Statistic_File=s option or the +GSs switch. If the string s is true or any of
the other valid true strings then that stream is redirected to a file with a
default name. Valid true values are true, yes, on or 1. If the value is false
the direction to a text file is turned off. Valid false values are false, no,
off or 0. Any other string specified turns on file output and the string is
interpreted as the output file name.

Similarly you may specify such a true, false or file name string after a
switch such as +GSfile. You may also direct all five streams to the same file
using the All_File option or +GA switch. You may not specify the same file
for two or more streams because POV-Ray will fail when it tries to open or
close the same file twice.

Note that these options take effect immediately when specified. Obviously any
Error or Warning messages that might occur before the option is read will not
be affected.

6.2.5.4          Help Screen Switches

  +?0 to +?8Same as +H0 to +H8 to 8 if this is the only switch


Note that there are no INI style equivalents to these options.

Graphical interface versions of POV-Ray such as Mac or Windows have extensive
online help. Other versions of POV-Ray have only a few quick-reference help
screens. The +? switch, optionally followed by a single digit from 0 to 8,
will display these help screens to the Banner text stream. After displaying
the help screens, POV-Ray terminates. Because some operating systems do not
permit a question mark as a command line switch you may also use the +H
switch. Note however that this switch is also used to specify the height of
the image in pixels. Therefore the +H switch is only interpreted as a help
switch if it is the only switch on the command line and if the value after
the switch is less than or equal to 8.

6.2.6            Tracing Options

There is more than one way to trace a ray. Sometimes there is a trade-off
between quality and speed. Sometimes options designed to make tracing faster
can slow things down. This section covers options that tell POV-Ray how to
trace rays with the appropriate speed and quality settings.

6.2.6.1          Quality Settings

  +Qnlity=nSame as Quality=n to n (0 <= n <= 11)


The Quality=n option or +Qn switch allows you to specify the image rendering
quality. You may choose to lower the quality for test rendering and raise it
for final renders. The quality adjustments are made by eliminating some of
the calculations that are normally performed. For example settings below 4 do
not render shadows. Settings below 8 do not use reflection or refraction. The
values correspond to the following quality levels:

  0,1Just show quick colors. Use full ambient lighting only. Quick colors are
  4,3Render shadows, but no extended lights. 5 Render shadows, including
  9,7Compute halos.ted, refracted, and transmitted rays.


6.2.6.2          Radiosity Setting

  +QRTurns radiosity on -QR Turns radiosity on


Radiosity is an additional calculation which computes diffuse
inter-reflection. It is an extremely slow calculation that is somewhat
experimental. The parameters which control how radiosity calculations are
performed are specified in the radiosity section of the global_settings
statement. See section "Radiosity" for further details.

6.2.6.3          Automatic Bounding Control

  -UVta_Buffer=boold=nTurn vista buffer offoffuture threshold to n


POV-Ray uses a variety of spatial sub-division systems to speed up ray-object
intersection tests. The primary system uses a hierarchy of nested bounding
boxes. This system compartmentalizes all finite objects in a scene into
invisible rectangular boxes that are arranged in a tree-like hierarchy.
Before testing the objects within the bounding boxes the tree is descended
and only those objects are tested whose bounds are hit by a ray. This can
greatly improve rendering speed. However for scenes with only a few objects
the overhead of using a bounding system is not worth the effort. The
Bounding=off option or -MB switch allows you to force bounding off. The
default value is on.

The Bounding_Threshold=n or +MBn switch allows you to set the minimum number
of objects necessary before bounding is used. The default is +MB25 which
means that if your scene has fewer than 25 objects POV-Ray will automatically
turn bounding off because the overhead isn't worth it. Generally it's a good
idea to use a much lower threshold like +MB5.

Additionally POV-Ray uses systems known as vista buffers and light buffers to
further speed things up. These systems only work when bounding is on and when
there are a sufficient number of objects to meet the bounding threshold. The
vista buffer is created by projecting the bounding box hierarchy onto the
screen and determining the rectangular areas that are covered by each of the
elements in the hierarchy. Only those objects whose rectangles enclose a
given pixel are tested by the primary viewing ray. The vista buffer can only
be used with perspective and orthographic cameras because they rely on a
fixed viewpoint and a reasonable projection (i. e. straight lines have to
stay straight lines after the projection).

The light buffer is created by enclosing each light source in an imaginary
box and projecting the bounding box hierarchy onto each of its six sides.
Since this relies on a fixed light source, light buffers will not be used for
area lights.

Reflected and transmitted rays do not take advantage of the light and vista
buffer.

The default settings are Vista_Buffer=on or +UV and Light_Buffer=on or +UL.
The option to turn these features off is available to demonstrate their
usefulness and as protection against unforeseen bugs which might exist in any
of these bounding systems.

In general, any finite object and many types of CSG of finite objects will
properly respond to this bounding system. In addition blobs and meshes use an
additional internal bounding system. These systems are not affected by the
above switch. They can be switched off using the appropriate syntax in the
scene file (see "Blob" and "Mesh" for details). Text objects are split into
individual letters that are bounded using the bounding box hierarchy. Some
CSG combinations of finite and infinite objects are also automatically bound.
The end result is that you will rarely need to add manual bounding objects as
was necessary in earlier versions of POV-Ray unless you use many infinite
objects.

6.2.6.4          Anti-Aliasing Options

  Jitter_Amount=n.nld=n.nSets aa-jitter amount to n.n. If n.n <= 0 aa-jitter
  +Jn.n                  Sets aa-jitter on; jitter amount to n.n. If n.n <= 0
  +Rnialias_Depth=n      Same as Antialias_Depth=n9)amount n.n in future)


The ray-tracing process is in effect a discrete, digital sampling of the
image with typically one sample per pixel. Such sampling can introduce a
variety of errors. This includes a jagged, stair-step appearance in sloping
or curved lines, a broken look for thin lines, moire patterns of interference
and lost detail or missing objects, which are so small they reside between
adjacent pixels. The effect that is responsible for those errors is called
aliasing.

Anti-aliasing is any technique used to help eliminate such errors or to
reduce the negative impact they have on the image. In general, anti-aliasing
makes the ray-traced image look smoother. The Antialias=on option or +A
switch turns on POV-Ray's anti-aliasing system.

When anti-aliasing is turned on, POV-Ray attempts to reduce the errors by
shooting more than one viewing ray into each pixel and averaging the results
to determine the pixel's apparent color. This technique is called
super-sampling and can improve the appearance of the final image but it
drastically increases the time required to render a scene since many more
calculations have to be done.

POV-Ray gives you the option to use one of two alternate super-sampling
methods. The Sampling_Method=n option or +AMn switch selects non-adaptive
super-sampling (method 1) or adaptive super-sampling (method 2). Selecting
one of those methods does not turn anti-aliasing on. This has to be done by
using the +A command line switch or Antialias=on option.

In the default, non-adaptive method (+AM1), POV-Ray initially traces one ray
per pixel. If the color of a pixel differs from its neighbors (to the left or
above) by more than a threshold value then the pixel is super-sampled by
shooting a given, fixed number of additional rays. The default threshold is
0.3 but it may be changed using the Antialias_Threshold=n.n option. When the
switches are used, the threshold may optionally follow the +A. For example
+A0.1 turns anti-aliasing on and sets the threshold to 0.1.

The threshold comparison is computed as follows. If r_1, g_1, b_1 and r_2,
g_2, b_2 are the rgb components of two pixels then the difference between
pixels is computed by

  diff = abs(r1-r2) + abs(g1-g2) + abs(b1-b2).


If this difference is greater than the threshold both pixels are
super-sampled. The rgb values are in the range from 0.0 to 1.0 thus the most
two pixels can differ is 3.0. If the anti-aliasing threshold is 0.0 then
every pixel is super-sampled. If the threshold is 3.0 then no anti-aliasing
is done. Lower threshold means more anti-aliasing and less speed. Use
anti-aliasing for your final version of a picture, not the rough draft. The
lower the contrast, the lower the threshold should be. Higher contrast
pictures can get away with higher tolerance values. Good values seem to be
around 0.2 to 0.4.

When using the non-adaptive method, the default number of super-samples is
nine per pixel, located on a 3*3 grid. The Antialias_Depth=n option or +Rn
switch controls the number of rows and columns of samples taken for a
super-sampled pixel. For example +R4 would give 4*4=16 samples per pixel.

The second, adaptive super-sampling method starts by tracing four rays at the
corners of each pixel. If the resulting colors differ more than the threshold
amount additional samples will be taken. This is done recursively, i. e. the
pixel is divided into four sub-pixels that are separately traced and tested
for further subdivision. The advantage of this method is the reduced number
of rays that have to be traced. Samples that are common among adjacent pixels
and sub-pixels are stored and reused to avoid re-tracing of rays. The
recursive character of this method makes it adaptive, i. e. the
super-sampling concentrates on those parts of the pixel that are more likely
to need super-sampling (see figure below).

Example of how the adapative super-sampling works.

The maximum number of subdivisions is specified by the Antialias_Depth=n
option or +Rn switch. This is different from the non-adaptive method were the
total number of super-samples is specified. A maximum number of n
subdivisions results in a maximum number of samples per pixel that is given
by the following table.

      Number of samples per    Maximum number of samples
      super-sampled pixel for  per super-sampled pixel for
 +Rn  the non-adaptive method  the adaptive method
  1                1                       9
  2                4                      25
  3                9                      81
  4               16                     289
  5               25                    1089
  6               36                    4225
  7               49                   16641
  8               64                   66049
  9               81                  263169


You should note that the maximum number of samples in the adaptive case is
hardly ever reached for a given pixel. If the adaptive method is used with no
anti-aliasing each pixel will be the average of the rays traced at its
corners. In most cases a recursion level of three is sufficient.

Another way to reduce aliasing artifacts is to introduce noise into the
sampling process. This is called jittering and works because the human visual
system is much more forgiving to noise than it is to regular patterns. The
location of the super-samples is jittered or wiggled a tiny amount when
anti-aliasing is used. Jittering is used by default but it may be turned off
with the Jitter=off option or -J switch. The amount of jittering can be set
with the Jitter_Amount=n.n option. When using switches the jitter scale may
be specified after the +J switch. For example +J0.5 uses half the normal
jitter. The default amount of 1.0 is the maximum jitter which will insure
that all super-samples remain inside the original pixel. Note that the
jittering noise is random and non-repeatable so you should avoid using jitter
in animation sequences as the anti-aliased pixels will vary and flicker
annoyingly from frame to frame.

If anti-aliasing is not used one sample per pixel is taken regardless of the
super-sampling method specified.
