Persistence of Vision Raytracer...

Thomas Mains explores the Persistence of Vision Raytracer...

The Persistence Of Vision Raytracer (POV-Ray) is a relatively new software package which transforms any Atari computer into a powerful graphics tool. POV-Ray allows you to create stunning and realistic three-dimensional images. Even if you don't possess traditional artistic drawing skills, with POV-Ray you will be able to create beautiful Truecolor images with perfect shading and perspective.

System requirements

The POV Raytracer runs on all Atari computers, but because of the nature of its output, 24-bit Truecolor images, it really requires a Falcon or ST/TT equipped with a graphics card. POV-Ray's renderings are maths-intensive so fitting a maths-coprocessor (FPU) significantly increases the speed images can be rendered and is recommended.

What is Raytracing?

Raytracing is a way of rendering pictures in three-dimensional space by describing objects which exist in that space and the light sources shining on them. For example, when we look out into the night sky and see a crescent moon, we see an object (in this case a sphere) which is only partially illuminated by its light source (the sun). If we were to trace the rays of light emanating from the sun, we would see some of them strike our object, forming the visible crescent, and others blocked by another object (the earth) which would form the shadow on the moon. The procedure of tracing rays of light to determine which objects are illuminated and which are not forms the basis of raytracing.

Raytracing is not limited simply to light and shadow. Colour intensity, texture, and reflection also play an important part. Let's bring our example down to earth. Imagine putting a tennis ball on a table and illuminating it with a desk lamp placed directly overhead. Viewing the tennis ball from table level, notice the top of the ball appears to be a brighter colour yellow than the ball's base. The gradation in the ball's colour from bright to dark yellow enhances our depth perception and allows us to see the ball as a sphere rather than a flat disk. A raytracer uses the same technique of colour shading to simulate a three-dimensional object on a computer screen.

The texture of a tennis ball also determines how we perceive light reflecting from it. For instance, a tennis ball is relatively dull and fuzzy compared to the smooth sheen of a marble. If the tennis ball was replaced with a white marble we would still see a gradation of colour on the marble but, because of the smooth and lustrous texture of the marble, other effects would become noticeable. For example, the marble's surface would have a spot reflecting the light source. This was unnoticeable on the tennis ball because its texture allowed for the spot's absorption. The spot of light on the marble that reflects its light source adds a greater degree of realism to our scene. We perceive the texture of objects without touching them using this kind of visual information all the time without realising it!

A raytracer uses texture information to calculate the way light should reflect from objects. A selection of textures are pre-defined in the POV-Raytracer, allowing realistic three-dimensional scenes to be easily created.
Finally we need to consider reflectivity. We have explained how rays of light reflected from textured objects influences our perception now we have to consider how direct reflections from other surfaces are added to give objects realism.
Replacing the marble in our example with a pinball we see the pinball not only as a sphere with shading, reflecting a light source, but we can also see the reflection of other surfaces upon its face. For example, we may see a representation of all the other objects in the room wrapped around its shape. The pinball acts as a mirror of the space surrounding it. Of course, because a pinball is spherical, the image is distorted. A raytracer mathematically calculates the amount of distortion of reflected objects appearing on the face of a sphere with a mirror finish and 'maps' or wraps the distorted picture, onto the sphere to achieve the illusion of three-dimensional realism on a two-dimensional computer screen.

POV software

The Persistence of Vision Raytracer is a unique program in the graphics field. It's actually text based! Unlike traditional painting and illustration programs the POV-Raytracer creates images from text input, instead of drawing using a mouse or graphics tablet you describe the scene using a simple scene description language. POV-Ray uses this information as a screen description file to render the final image.

It's only words

On well established theory asserts the two hemispheres in our brains support different types of thinking. The 'right brain' supports intuitive, creative, and artistic reasoning whereas the 'left brain' is oriented more towards analytical and rational reasoning. Since POV-Ray uses mathematics and a computer programming language to render its scenes, it's logical to conclude POV-Ray is a 'left brain' activity - indeed, it does have a logical and straightforward structure which often intimidates creative people. I see POV-Ray as a marriage requiring 'left brain' activity during implementation and 'right brain' activity during the design phase and I believe the results are better as a result.
POV-Ray's Scene Description Language (SDL) does seem daunting to anyone bought up using a mouse but I assure you the time spent learning a few commands is rewarded many times over when you see the quality of the scenes you can render with this amazing application. Mastering the POV-Ray SDL does take time but within half an hour anyone can render impressive looking images. Let's look at an example:

<Figure 1>

 

#include "colors.inc"
#include "shapes.inc"
#include "textures.inc"
camera {
     location <0,2,-3>
     look_at <0,1,2>
     }

sphere {
     <0,1,2>,2
     texture {pigment {color Yellow}}
     }

light_source { <2,4,-3> color White}
 
 

<Figure 1> shows a complete POV-Ray file to render a sphere on your computer screen. The first three lines tell the raytracer to use some pre-defined colours, shapes, and textures in this scene. Using these 'include' files, saves us the trouble of defining these picture elements ourselves. The second part of the file specifies where the 'camera' should be located. In other words, from what perspective shall the scene be viewed. Notice the locations of the camera, sphere, and light source are all given using three numbers. These numbers represent the object's location in three-dimensional space on the x, y and z axes. I bet you're wishing you'd paid attention during your maths lessons now now eh? The third part of the file specifies the object to be placed in the scene is a yellow sphere. Finally, the location of a light source is given to illuminate the object.

What's in the package?

POV-Raytracer comes complete with step-by-step tutorials, comprehensive reference documentation and some pre-defined textures and sample scenes ready to render. There are far too many to list here, but to give you a flavour here's a selection of pre-defined textures you'll be able to use:

* Classic white marble with red veins Jade

* Grey-blue agate pink granite

* Basic blue sky with clouds

* Cherry pine

* Rosewood

* Luminous, mirror and glass finishes

* Brass, gold, bronze, copper and silver textures

<Figure 2>

<Figure 2> uses the glass texture on a sphere with a pre-drawn background consisting of the Atari Fuji logo.

An array of basic shapes is also included with the POV-Ray distribution including spheres, cones, boxes and a multitude of geometric and original shapes. POV-Ray can include bitmap graphics into scenes and bitmap images can be wrapped around boxes, cones and any other object in your raytraced picture! The title image is an Atari Fuji logo I created using a paint program then mapped onto a a sphere using the POV-Ray package.

And there's more...

There wasn't room here to include many POV-Ray tools but I can't resist whetting your appetite by mentioning animation. Creating raytraced animation's is relatively simple because once you have created a scene, it's simply a matter of rendering additional frames to create animation's - you could simply move the camera position or do much more - the only limit is your imagination.

 
[Home] [Info] [Back] [Next]