Section 3.2.3
Alternatives to POVRAY.INI

The povray.ini file is supposed to hold your favorite global default options that you want to use all the time. You should feel free to edit it with new options that suit your needs. However it must be located in the same directory as povray.exe or it won't be found. The DOS path isn't searched nor will +L commands help because povray.ini is processed before any command line switches.

If your povray.exe resides on a CD-ROM then you can't edit the povray.ini on the CD. There is an alternative. You may use an environment variable to specify an alternative global default.

In your autoexec.bat file add a line similar to this:

  set POVINI=D:\DIRECT\FILE.INI

which sets the POVINI environment variable to whatever drive, directory and INI file you choose. If you specify any POVINI environment variable then povray.ini is not read. This is true even if the file you named doesn't exist. Note that you are specifying an entire path and file name. This is not a pointer to a directory containing povray.ini. It is a pointer to the actual file itself.

Note that the POVRAYOPT environment variable in previous versions of POV-Ray is no longer supported.


Section 3.2.4
Batch Files

We've already described how the file runpov.bat can be used as an alternative to running POV-Ray directly. runpov.bat also has one other use. It uses the +GI switch to create a file called rerun.ini. This makes it very easy to run the same file over again with the same parameters. When creating your own scene files you will probably make dozens of test renders. This is a very valuable feature. Here is how it works... Suppose you render a scene as follows:

  RUNPOV +IMYSCENE +D1 RES120

This renders myscene.pov at 120 by 90 resolution. Note there is no such scene. This is hypothetical. After viewing it, you noticed a mistake which you fixed with your text editor. To rerun the scene type:

  RERUNPOV

and that's all. It will rerun the same scene you just ran. Suppose you want more detail on the next run. You can add more switches or INI files. For example:

  RERUNPOV RES320

will rerun at higher resolution. Subsequent uses of rerunpov will be at 320 by 200 until you tell it differently. As another example, the +A switch turns on anti-aliasing. Typing "rerunpov +A" reruns with anti- aliasing on. All subsequent reruns will have it on until you do a "rerunpov -A" to turn it off. Note if you do another runpov it starts over from your povray.ini defaults and it overwrites the old rerun.ini.

Two other batch files are included. runphelp.bat is only used as an alternative way to run povhelp from another directory. If you used installation plan two then use runphelp.bat rather than povhelp.exe. This batch file serves no other purpose.

Finally t2g.bat invokes the tga2gif.exe program for converting TGA files to GIF files. You could run \FILE {tga2gif} directly but its default parameters do not generally produce the best results. If you use T2G instead, it adds some command line switches which work better. For a full list of switches available for tga2gif, type tga2gif with no parameters and it will display the available switches and options.


Section 3.2.5
Display Types

You have already seen how to turn on graphics preview using +D1. Here are details on other variations of the +D switch. Use -D to turn the display off. If you use -D then you will probably want to add the +V switch to turn on verbose status messages so you can monitor the progress of the rendering while in progress.

The number "1" after the +D tells it what kind of video hardware to use. If you use +D alone or +D0 then POV-Ray will attempt to auto detect your hardware type. Use +D? to see a message about what type of hardware POV-Ray found.

You may also explicitly tell POV-Ray what hardware to use. The following chart lists all of the supported types.

+D0Auto detect (S)VGA type (Default)
+D1Standard VGA 320x200
+D2Standard VGA 360 x 480
+D3Tseng Labs 3000 SVGA 640x480
+D4Tseng Labs 4000 SVGA
+D5AT&T VDC600 SVGA 640x400
+D6Oak Technologies SVGA 640x480
+D7Video 7 SVGA 640x480
+D8Video 7 Vega (Cirrus) VGA 360x480
+D9Paradise SVGA 640x480
+DAAhead Systems Ver. A SVGA 640x480
+DBAhead Systems Ver. B SVGA 640x480
+DCChips & Technologies SVGA 640x480
+DDATI SGVA 640x480
+DEEverex SVGA 640x480
+DFTrident SVGA 640x480
+DGVESA Standard SVGA Adapter
+DHATI XL display card
+DIDiamond Computer Systems SpeedSTAR 24X

The most common type is a VESA standard card which uses +DG. VESA is a standard software interface that works on a wide variety of cards. Those cards which do not have VESA support directly built-in, generally have a video driver that you can load to provide VESA support. The program UniVBE is a high quality universal VESA driver that may work for you. It can be found at http://www.povray.org or possibly other POV-Ray sites.

The options listed above had been tested worked under earlier versions of POV-Ray but there have been many changes in the program and we cannot guarantee these all still work. If you can use VESA then do so. It has been well tested and will give you the most flexibility.

After the +D and the type, you may specify a 3rd character that specifies the palette type.

+D?3Use 332 palette with dithering (default and best for VGA systems). This is a fixed palette of 256 colors with each color consisting 3-bits of red data, 3-bits green and 2-bits blue.
+D?0Use HSV palette option for VGA display. This is a fixed palette of 256 colors where colors are matched according to hue, saturation and intensity rather than the amount of red, green and blue.
+D?GUse fixed gray scale palette option for VGA display.
+D?HUse HiColor option. Displays more than 32,000 colors with dithering. Supported on VESA, SpeedSTAR 24X, ATI XL HiColor and Tseng 4000 based cards with high color 15 or 16 bit options.
+D?TFor Truecolor 24 bit cards. Use 24 bit color. Supported on the Diamond SpeedSTAR 24X and cards with 24-bit VESA support only.

Here are some examples:

   +D0H Auto detect the VGA display type and display the image to the
        screen as it's being worked on. Use the 15-bit HiColor chip and
        dithering to display more than 32,000 colors on screen.
   +D4  Display to a TSENG 4000 chipset VGA using the 332 palette option.
   +D4H Display to a TSENG 4000 chipset VGA using the HiColor option.
   +DG0 Display to a VESA VGA adapter and use the HSV palette option.
   +DG3 Display to a VESA VGA adapter and use the 332 palette option.
   +DGH Display to a VESA VGA adapter and use the HiColor option for
        over 32,000 colors.
   +DGT Display to a VESA VGA adapter and use the TrueColor option for
        over 16 million colors.

Note that your VESA BIOS must support these options in order for you to use them. Some cards may support HiColor and/or TrueColor at the hardware level but not through their VESA BIOS.


Section 4
Beginning Tutorial

The beginning tutorial explains step by step how to use POV-Ray's scene description language to create own scenes. The use of almost every feature of POV-Ray's language is explained in detail. We will learn basic things like placing cameras and light sources. We will also learn how to create a large variety of objects and how to assign different textures to them. The more sophisticated features like radiosity, halos and atmospheric effects will be explained in detail.

The following sections explain the features in roughly the same order as they are described in the reference guide.


Section 4.1
Our First Image

We will create the scene file for a simple picture. Since ray-tracers thrive on spheres, that is what we will render first.

Section 4.1.1
Understanding POV-Ray's Coordinate System

First, we have to tell POV-Ray where our camera is and where it is looking. To do this, we use 3D coordinates. The usual coordinate system for POV-Ray has the positive y-axis pointing up, the positive x-axis pointing to the right, and the positive z-axis pointing into the screen as follows:


The left-handed coordinate system (the z-axis is pointing away).

This kind of coordinate system is called a left-handed coordinate system. If we use our left hand's fingers we can easily see why it is called left-handed. We just point our thumb in the direction of the positive x-axis, the index finger in the direction of the positive y-axis and the middle finger in the positive z-axis direction. We can only do this with our left hand. If we had used our right hand we would not have been able to point the middle finger in the correct direction.

The left hand can also be used to determine rotation directions. To do this we must perform the famous Computer Graphics Aerobics exercise. We hold up our left hand and point our thumb in the positive direction of the axis of rotation. Our fingers will curl in the positive direction of rotation. Similarly if we point our thumb in the negative direction of the axis our fingers will curl in the negative direction of rotation.


"Computer Graphics Aerobics" to determine the rotation direction.

In the above illustration, the left hand is curling around the x-axis. The thumb points in the positive x direction and the fingers curl over in the positive rotation direction.

If we want to use a right-handed system, as some CAD systems and modellers do, the right vector in the camera specification needs to be changed. See the detailed description in "Handedness". In a right-handed system we use our right hand for the Aerobics.

There is some controversy over whether POV-Ray's method of doing a right-handed system is really proper. To avoid problems we stick with the left-handed system which is not in dispute.


Next Section
Table Of Contents