Renderer Overview

Select the desired rendering settings in the Control, Options, Settings, and Tracing tab pages of the Renderer dialog. Press one of the the Render buttons on the right of the Renderer dialog to start rendering.

By default the Scanline (Software) renderer is used to produce the images. Various levels of Ray tracing can be enabled in the Tracing tab page. Phong rendering is suggested in most cases since ray tracing is notoriously memory and time intensive.

If your hardware can support it the GPU Render button will be un-grayed and you can use the new Hardware renderer.

The software renderer is multi-threaded and will benefit greatly if additional processors/cores are installed in the system. Rendering on a two processor system will almost be twice as fast as with one processor.

Note that test renders be done quicker using the command File > Quick Render (F12) From the Animation and Design modules.


Render Control Tab Page

Renderer Control Tab Page

The Control page of the Renderer offers the most significant control parameters. The most important buttons are on the right and control whether the scanline software renderer is used or the harware rendering engine(GPU rendering) is used. The hardware rendering engine will be much faster for most images and movies (up to 30 times faster) but it will not work on older hardware and some graphics cards may not be compatible. (You must have a graphics adapter that supports OpenGL 2.0) All nVidia graphics adapters produced in the last 5 years should be compatible. Most ATI graphics cards should also work.) The GPU renderer has been successfully tested on a wide range of ATI and nVidia hardware.

Resolution - Choose the resolution to which the image is rendered. Choose one of the presets or enter the number of horizontal and/or vertical pixels in the edit controls. The number of pixels in the image is horizontal resolution multiplied by the vertical resolution. The higher the resolution the longer it takes and the more memory it needs to render the image.

Anti-Aliasing - Choose the level of anti-aliasing. In low resolution modes the appearance of an image can be improved if it is anti-aliased. Basically, anti-aliasing smoothes out some of the 'jaggies' that are visible at the edges of colored regions in the image. Anti-Aliasing is very time consuming: it will take a little under 4 times as long to render a Good anti-aliased image than an image with no anti-aliasing. Using Best level of anti-aliasing, the image will take approximately 9 times longer to render than a non anti-aliased one.

Accelerated Anti-Aliasing - Accelerate the anti-aliasing process, with small quality reduction. Normally anti-aliasing an image increase the rendering time quite significantly, up to 9 or 10 times for a setting of Best. The main effect of anti-aliasing is seen near the edges of models or where faces with different colors join. Pixels in the interior of faces benefit very little from anti-aliasing. When this option is selected, anti-aliasing is applied near the edges of faces and not in the center. For most models this is as good as full anti-aliasing and it can be up to 3 times faster. Images with models that have image maps or shaders, where there is quite a bit of detail in the interior of faces, will not benefit as much from having their anti-aliasing accelerated.

Image Format - Select the file format into which the image or images will be stored. This automatically determines the color resolution in the image. For an single image or multiple still images the GIF format uses an 8 bit palette, while the TGA and TIF formats are either High-Color or True-Color (16 bit or 24 bit).

Image Name - Name the image and the directory to which it is to be rendered. The default image directory is "Render".

Movie Name - Name the animation and the directory to which it is to be rendered and compressed. The default animation directory is "Movies". Movies are written in the AVI fiel format and can be written using any installed codec or in an uncompressed format for high quality postprocessing.

Current Frame - Specify which frame of an animation is to be rendered.

Range - Specify a range of frames to be rendered.


Renderer GPU

GPU Renderer

New to OpenFX 2 is the GPU renderer. The same control settings apply to it as to the software scanline renderer. Because this renderer relies on the graphics adapter's processor hardware it is important to appreciate that some limitations apply to this renderer.

  • Only the first 8 lights are used.
  • No spotlight shadows are available
  • No light distance attenuation applies
  • Not all image post-processors or plug-textures are available.
  • Ray tracing is disabled.

This renderer works much faster than the software renderer - up to 32 times as fast. When rendering some animations it will work almost in real-time at large frame sizes and high settings of anti-aliasing. It works most efficiently when rendering ansimations because all the models and image files are only loaded once at the start of the sequence and do not have to be loaded at every frame. When just rendering a single frame all the modes and images in use for that frame have to be loaded.


Render Options Tab Page

The Options page of the Renderer offers additional control parameters.

Show Image While Rendering - Displays a preview image in the Rendering Status Window during the rendering.

Startup Preferences - Enables preference settings to override the defaults.

Hardware Renderer Settings - These apply to the GPU renderer:

  • Output directly to Screen - If you use this option you will be limited in the resolution of the output you can make to the sise of your desktop window. And it must draw on top of your desktop so you will not be able to continue working while renderiing.
  • Render to Pixel buffer (P-buffer) - This is the best option,
  • Render to Frame Buffer Object (FBO) - Render to offscreen buffer. This should be the fastest option - but it behaves differently on different adapter cards.

If you tick the Apply Software Post..... button then the images created by the OpenGL renderer will be passed to the software processor functions (external DLLs). This is useful since not all the postprocessors have been re-written for use with the OpenGL renderer.

If you tick the Copy Hardware Depth... button then the hardware depth buffer is copied to the software depth buffer and you can use depth dependent software post-processors (like fog).


Render Settings Tab Page

The Settings page of the renderer offers additional control parameters. The Smoothing angle, ambient light, shadow density and spotlight buffer size ONLY apply to the scanline software renderer.

Note: These settings only apply to the Software Renderer.

Animation Speed - Set the speed value built into the FLI/FLC files. The value is in jiffies, zero implies the animation will play as fast as possible.

Smoothing Angle - Set the maximum Phong smoothing angle. If the angle between any adjacent faces exceeds this value, the Phong smoothing is automatically turned off for those faces. This switch can help eliminate artefacts that sometimes appear in an image if the smoothing in a model has been set inappropriately.

Ambient Lighting % - Overrides the ambient light settings usually specified in the Sky Actor. A maximum of 30% works quite well, values greater than 70% produce images that have very little contrast.

Shadow Density % - Specify the darkness of shadows cast on the Ground. Set the density of the shadows. 50% is the default, 100% gives completely black shadows, 0% gives no shadows at all.

Spotlight Buffer - Alter the resolution of the shadows cast by spotlights. The shadows created by the spotlights require a block of memory. A setting of 320 reserves a block of memory of 256k for each spotlight. The size of the block dictates the smoothness of the shadow. A value of zero implies that a spotlight will not cast a shadow. You can calculate optimum settings for best results by multiplying the number of pixels by 4 (e.g. 320x200x4=256,000 bytes required).

Motion Blur - Higher values generate Motion Blur. The normal range is 0-10. When a number outside this range is entered the full integrated motion blur comes into play.

Digits in Filenames - Specify the number of leading zeros in a Rendered filename.

JPEG Picture Quality - Specify the JPEG compression quality. Higher quality creates larger file sizes.


Render Trace Tab Page

Render Tracing Tab Page

The Tracing page of the Renderer enables Ray Trace rendering to be used. Turning on any of the Tracing options instructs the Renderer to use ray tracing where appropriate.

Note: These options and settings only apply to the Software Renderer.

Render_T.GIF (34397 bytes)

Trace Shadows - All shadows will be ray traced, this increases the rendering time significantly..

Trace Reflections - All reflective surfaces will be ray traced, this also increases the rendering time.

Trace Glass - All glass surfaces will be ray traced, this included normal glass, like windows, as well as refractive glass.

Algorithm Parameters - Ray tracing a sene with 10,000 of polygons requires some optimisation to be undertaken before the scene is rendered. This is explained more fully in the section on "Setting the ray tracing parameters". There are no 'hard and fast' rules for chosing which approach to use. If you have a very complex scene then you may wish to increase the "Polygons per Voxel" setting. Up to 1000 polygons per voxel will still be acceptable if you have a scene with several hundred thousand polygons.

It would be unwise to increase the Recursive depth beyond about 10 as this will hugely increase the amount of time it takes to optimise the scene before ray-tracing begins, and will also increase the amount of memory used to store the data.

The choice between Partition and Split is explained in the section on "Settings the Ray Tracing Paramters". Depending on what the scene is, one of these algorithmic approaches may work better.


Ray Tracing Parameters

Setting the Ray Tracing Parameters

Introduction

This page explains the action of the algorithm parameters and the information that is reported in the status display after the optimisation phase of rendering has completed.

The settings are:

  • Partition or Split the Polygons
  • Recursive Depth
  • Polygons per Voxel

The reported information in the status line of the renderer window can be very useful in making subsequent renderings of the same scene go faster.

setitings.png (5077 bytes)

  • F = (Number of faces in scene)
  • V = (Number of vertices in scene)
  • Dp = (Maximum octree depth used)
  • Th = (Target number of faces to be assigned per voxel)
  • F/V = (The maximum number of faces assigned by the optimisation algorithm per voxel)
  • Size = (The [maximum(and minimum)] dimension (in internal units) of any voxels created by the optimisation)
  • Vox = (Number of voxels created by the optimisation)
  • Fc = (Total number of face assignments made to voxels in the spatial subdivision)

Some of the terms used above may be unfamiliar to you but in order set the optimisation parameters you will need to understand these terms which arise in the standard ray tracing algorithm and how it is optimised to enable scenes with very large numbers of polygons (faces in the jargon) to be rendered.

The basics of a raytracing algorithm will be explained in this section and then we will move on to consider optimisation techniques. As we do this the nature and use of the raytracing optimisation parameters should become clear. (Hopefully!)

The Ray Tracing Algorithm

Ray tracing may be a slow procedure but it does give superb photographic quality images. There are many books that describe the theory of ray tracing in detail. A full description of a complete package is given in [1] and there are also many available freeware and shareware ray tracing programs. One of the most comprehensive is POV-Ray which is available from a large number of WWW locations.

The idea on which ray tracing is based seems almost too simple to be true but - here it is:

Follow the paths taken by particles of light (photons) on their journey from light source through the scene (as they are scattered back and forth between objects) and on until they are either captured by the camera or head off to infinity.

In practice this is a hopeless task because of the huge number of photons emitted by a light source and the fact that all but a minute fraction of them will ever be scattered into the camera or eye. So ray tracing does it in reverse. It sends feelers or rays along the path of the photos from the camera out into the scene. If the feeler rays find anything they work back towards the sources of illumination and give us a path for the photons to follow from source to photographic plate. Sometimes these feeler rays may encounter reflective surfaces and when that happens they follow a new path and continue their journey. There are lots of other things that can happen to
feeler rays. Sometimes they may divide with each sub-ray following separate paths. The way in which the ray tracing algorithm handles such situations and the sophistication of the mathematical models it uses for light/surface interaction governs the quality of the images produced.

The standard algorithm for ray tracing can be summarised in five steps:

  • Load the data describing objects in the scene to memory.
  • Move each model into its appointed position.
  • Apply the viewing transformation.
  • Calculate the direction of a feeler ray from the viewpoint so that it passes through the point in the projection plane equivalent to a pixel in the display raster.
  • The feeler ray is followed (traced) out into the scene until it intersects a polygon. Once the point of intersection is located the surface properties can be determined and the pixel set to the appropriate colour value.

If when a ray first hits something in the scene it isn't totally absorbed we can continue to trace its path until it reaches a final destination or is so attenuated that there is nothing to see.

So that's the basic algorithm, but if you have ever experimented with ray tracing software you probably found that at most you could use about 100 primitive shapes. Your main observation probably was the hours it took the computer to trace even an image of moderate resolution. What is worse is that the rendering time increases as the number of models in the scene increases thus if you need to render a scene with models made up from thousands of polygons a basic ray tracing renderer is virtually useless.

So the main question is: Why is ray tracing so much slower? The answer is in the algorithm, in particular the step: For each pixel test every polygon and find the one closest to the origin of the ray. This is potentially an enormous number of operations. For example to synthesize an image of size 640 by 480 using a 2 by 2 anti-aliasing supersample with a scene of 20,000 polygons requires 24 billion tests.

To try and reduce the time it takes to render a scene with a ray tracer some attempt must be made to try and reduce this enormous number of calculations. A technique we call optimisation.

Optimisation

It is the job of an optimisation routine to divide the scene up in some way so that every ray does not have to be tested against every polygon. Optimisation usually requires two modification to the ray tracing algorithms:

  • A scene evaluation step that takes place before the scene is renderer.
  • As each ray is traced the scene evaluation data is used to reduce the number of polygons that must be tested against it as the ray passes from point to point.

There are two approaches that have received much investigation:

  • Bounding volumes
  • Spatial subdivision

The renderer uses the spatial subdivision method and we will look at that:

The idea here is to break up space into a number of small boxes so that only a few polygons actually lie in each little box. Then as the rays are traced through the scene we follow them from box to box and check to see if a ray hits any of the polygons lying inside the boxes. If there are only a few polygons in each box we will have considerably reduced the number of calculations and hence the time it takes to render a scene! Ideally putting only one or two polygons in each box (in technical terms the "boxes" are know as "voxels") should be the goal of the first part of the optimisation scheme.

A two dimensional illustration of this principle is given below, it shows a collection of objects and a series of rectangles that divide up the region in which the objects lie so that so that only one object is in each little rectangle:

sfxtut1_0.JPG (22203 bytes)

It is the job of the first optimisation step (scene evaluation) to divide up the scene into the boxes to be used in the later tracing step. There are conflicting goals here, each voxel should have as few polygons (faces) inside them as possible. This implies that they should be small - but if there are too many boxes then the tracing step will not be very fast because as the ray is followed it will have to travel through a very large number of boxes. This is a "balancing act" - technical term "Optimisation". It requires quite a bit of processing to find the best arrangement of the voxels but since many hours of processor time might be saved during rendering it is usually well worth the effort.

One comment worth making: The time it takes to optimise a scene is dependent on the number of polygons in the scene not on the number of pixels in the output picture. So it takes just as long to optimise a scene when rendering a 60 by 40 image as it does for a 1024 by 768 image. However it takes much much longer to trace the image for the larger raster. Thus here again is another very profitable reason to do the best possible job at optimising the scene prior to tracing any rays.

Octrees

The optimisation step starts by calculating the volume of space occupied by all the faces in the scene to create a bounding box to enclose all the faces in the scene (the so called root node in the octree). If this box contains more than the minimum number of faces it is divided into 8 smaller volumes. These child volumes are checked and any faces assigned to the parent and also fall inside them are put into to a list for each child. If any child box contains more than the minimum number of faces it is further subdivided into 8 sub-volumes, just as its parent's box was. This process is recursive and gives us a tree like structure called an octree, because at each branch there are 8 subdivisions.

This subdivision process for a cubic region of space is illustrated below:

sfxtut1_1.JPG (17417 bytes)

The big cube has been divided into 8, one child node is further divided at each stage. In hierarchical terms the octree resembles:

sfxtut1_2.JPG (26697 bytes)

The numbers in the circles represent an example of the number of faces inside the box associated with that node in the octree. You can see that as the subdivision is refined the number of faces in each box decreases. In this particular example the subdivision process is stopped when the number of faces in each box falls below 10.

Once the octree is fully built ray tracing can proceed. Thus when the ray-tracing part of the algorithm follows a ray through the scene it moves from box to box and only a maximum of 10 faces have to tested in each box. A big saving in computation time. The tree structure of the octree makes the task of following a ray through the scene quite quick.

There is a bit of work involved in calculating the movement of the ray and in getting a fairly quick test to see in which box the current position of the traced ray lies but we don't need to worry about this to understand the setting of the optimisation parameters.

This following figure below illustrates how the division into voxels will work:

figure1.png (587224 bytes)

In (a) we see a model of a man made up about 25,000 triangular polygons. In (b) the subdivided polygons are shown using a false colour. In (d) the voxels and their subdivisions around the figure are shown. You can easily see how the larger voxels lie at the edge as they do not contain polygons and thus do not have to be subdivided. In (d) a close up of the man's hand is shown with a tracing ray passing through it. In (e) the same view as in (d) is shown but with the voxels also included. As the ray is traced through the scene it passes in and out of the voxels. When int enters a voxel that contains any polygons (or parts of polygons) the list of polygons are checked for intersection with the ray. Hopefully this number of polygons will be small for each voxel and when a ray does enter a voxel. Again hopefully, when there are polygons in a voxel an intersection will occur and there will be no need to trace the ray through any other voxels.

Polygon Splitting

Before actually looking at the parameters there is one complicating issue we must mention:

All this looks great in theory until we come to consider a model made from a connected network of polygonal facets, then we have a bit of a dilemma! A network of connected facets cannot be separated into individual faces. No matter how hard we try, (how may times we subdivide), there is no way that we can separate each polygon so that a rectangle in the subdivision contains only one polygon. The fact that the polygons are connection is responsible for that. The very best we could probably do is associate some polygons with more than one voxel simultaneously. We are going to have to accept that in practice a one polygon to one subdivision goal is unattainable. So we must set a more realistic limit on the number of polygons we are prepared to accept in each voxel.

How close the renderer gets to the 1 to 1 ideal can be determined from the reported information in the status bar. The (F) value is the number of faces in the scene, the (Fc) value reports how many faces have been placed in voxels. Thus if Fc=F we have a perfect 1 to 1 set-up and the ray tracing should be very fast. The (F/V) value is the maximum number of faces assigned to any one polygon, ideally this should be equal to the desired value (which is set by the Threshold parameter). In most cases we rarely have either Fc=F or F/V = Threshold , any scene in which Fc < 5 F should be regarded as acceptable. In other scenes it is probably worth experimenting with the paameter settings.

The parameters

  • OpenFX provides two alternative methods of partitions the triangles in the voxels.

    In 'partition' mode NO additional polygons are created in the model as they are divided up among the voxels. Instead, each voxel records a list of every face that passes through that volume. When a voxel is divided (at the boundary between at least one face) those lying completely on either side of the dividing plane are assigned to either side. If a polygon crosses the dividing plane then it is assigned to both sides. (By choosing the dividing plane so that it passes through a vertex we can be sure that eventually the voxels at the bottom of the tree will only contain the specified number of polygons.

    In 'Split' mode the polygons in the model are split along the boundary of the voxel and those that lie to one side are assigned to lie in the child voxel on that side, those that lie on the other side of the dividing plane are assigned to the voxel on that side.

    In both these cases the parent voxel retains NO polygons, all polygons lie in a voxel at the bottom of the hierarchy.

    Note: To make sure that we do not miss any polygons or make too many, or not enough voxels, OpenFX uses integer coordinates internally for its vertex representations whild carrying out the optimisation.

    This switch parameter gives you the option to choose which of these methods of model partitioning best suit your scene.
  • The Recursive Depth setting tells the renderer what is the maximum number of subdivisions the octree it may use. Thus OpenFX won't go on subdividing even if the other settings would allow or require it. This parameter is needed because in some scenes too much memory would be needed and the optimisation step would take too long to complete. (Each additional subdivision (where required) takes 8 times as much memory and 8 times as long to compute. (Not all voxels will require subdivision but the number of voxels will get enormous. For example the default setting of 8 subdivisions would require> 16 million voxels. Twelve subdivision would require > 68 billion voxels, about 6.8TB of memory.)
  • The Polygons per Voxel is related to the number of faces that are assigned to each voxel. It is the desired number of faces we would like to see assigned to each voxel. (All this is discussed above.) Ideally one or two but for larger models 9 or 10 or even 100 to 150 are possible values. It just depends on the number of polygons in the scene and only experimentation will tell if you are heading in the right direction. Again the (F/V) and (Fc) values reported should help you refine your settings.


TourVR

Tour Utility

This utility is designed to provide a virtual reality experience within an individual OpenFX scene or an OpenFX animation frame.

It can provide stereoscopic output for either a stereo-ready graphics adapter or the dual output for a head mounted display.

It also offers several methods of navigation through the scene:

  1. Keyboard keys
  2. Mouse
  3. Joystick
  4. Two joysticks
  5. Nintendo Wii remote
  6. VRPN connected navigation server (Wii or Vision based).

The basic tour program dialog looks like this:

tour1.jpg (193505 bytes)

It offers the choice of either an OpenFX scene (.MFX) that contains the virtual world to be toured or an OpenFX script file (.SCR) for a single movie frame that has been exported from the animator. The dialog provided the basic instructions for navigating around the virtual world with the keyboard or mouse.

The tick boxes offer stereoscopic behaviour on comptuers with stereo-ready graphics hardware or on dual output video systems the LEft and Right images can be generated for a Head Mounted display.

Rendering is effected using hardware acceleration driven by OpenGL. On recent graphics adapters programmable shaders may be used, this is OpenGL 2. Using OpenGL 2 allows for programmable textures etc. On non-OpenGL 2 compatible hardware the Start OpenGL 2 button will be disabled.

Since rendering takes place "Full Screen" remember to press the "ESC" key to return to the program's main dialog.

The tour program can be used with the Nintendo Wii remote control and suitable bluetooth hardware in one of two ways:

  • As a navigation device connected directly to the comptuter via a suitable Bluetooth interface. Instructions on how to use the Wii controller in this mode are given in the help dialog below. A menu command to display this dialog is included in the Tour program's system menu.
  • As a remote tracker connected to a remote server via the VRPN software library (discussed below).

tour2.jpg (268310 bytes)

Providing Tour movement signals remotely.

Instructions for configuring the tour program for remote navigation are given on the right side of the above dialog.
This is a development feature of the Tour program that can link to several VRPN servers. e.g. Nintendo Wii, or Vision based tracking software. Example servers for this purpose can be obrained from our research web site: http://www.ee.qub.ac.uk/graphics


Quick Render

Quick Render to Camera View

Right click on the Camera or view Windows and choose Quick Render to quickly preview a frame with phong rendering (OpenGL renders as Gourand) using maps, shaders, reflections, etc. (This option uses the scanline software renderer.)

Tip: Quick Render is much faster if monitor color depth is set to 16 million colors. Otherwise the rendering displays colour banding and renders slower.